#!/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 # 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),trusty xenial bionic)) export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie endif export DEB_LDFLAGS_MAINT_APPEND=-Wl,--no-as-needed 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 $@ --with autoreconf --parallel 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)"