File: rules

package info (click to toggle)
libgdal-grass 3.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 368 kB
  • sloc: cpp: 1,704; makefile: 100
file content (64 lines) | stat: -rwxr-xr-x 2,004 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Enable hardening build flags
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

# Don't link with as-needed to prevent missing libraries
export DEB_LDFLAGS_MAINT_APPEND=-Wl,--no-as-needed

# Disable PIE on Ubuntu where it's still problematic
VENDOR_DERIVES_FROM_UBUNTU ?= $(shell dpkg-vendor --derives-from Ubuntu && echo yes)
DISTRIBUTION_RELEASE       := $(shell lsb_release -cs)

ifeq ($(VENDOR_DERIVES_FROM_UBUNTU),yes)
  ifneq (,$(filter $(DISTRIBUTION_RELEASE),xenial bionic))
    export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie
  endif
endif

PKGNAME=$(shell grep Package: debian/control | head -1 | cut -d' ' -f2)
GRASS=grass$(subst .,,$(shell pkg-config --modversion grass | cut -d. -f1,2))
GRASS_ABI=grass$(subst .,,$(shell pkg-config --modversion grass | cut -d. -f1,2,3 | sed -e 's/RC/-/'))

%:
	dh $@

override_dh_autoreconf:
	mv configure configure.pre-autoreconf
	dh_autoreconf

override_dh_autoreconf_clean:
	dh_autoreconf_clean
	if [ -e "configure.pre-autoreconf" ]; then \
		mv configure.pre-autoreconf configure ; \
	fi

override_dh_auto_configure:
	# Abort if source and gdal have not the same versions.
	if [ `gdal-config --version` != `cat VERSION` ]; then \
		echo "GDAL version and GDAL GRASS plugin version are not aligned. Please, upload a proper plugin source version."; \
		exit 1; \
	fi

	dh_auto_configure -- \
	                  --prefix=/usr \
	                  --with-autoload=/usr/lib/gdalplugins \
	                  --with-grass=/usr/lib/$(GRASS) \
	                  --with-postgres-includes=$(shell pg_config --includedir)

override_dh_auto_install:
	dh_auto_install -- AUTOLOAD_DIR=$(CURDIR)/debian/$(PKGNAME)/usr/lib/gdalplugins

override_dh_shlibdeps:
	dh_shlibdeps -l.:/usr/lib/$(GRASS)/lib

override_dh_strip:
	# Debug files contain no debug symbols
	dh_strip --no-automatic-dbgsym

override_dh_gencontrol:
	dh_gencontrol -- -Vgrass:Depends="$(GRASS_ABI)"