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 65 66 67
|
#!/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
PKGNAME=$(shell grep Package: debian/control.in | 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/-/'))
GDAL=$(shell cat VERSION | cut -d. -f1,2)
TEMPLATES=$(wildcard debian/*.in)
templates:
for TEMPLATE in $(TEMPLATES) ; do \
sed -e 's/@GDAL@/$(GDAL)/g' \
-e 's/@GRASS@/$(GRASS)/g' \
-e 's/@GRASS_ABI@/$(GRASS_ABI)/g' \
-e 's/@PKGNAME@/$(PKGNAME)/g' \
$$TEMPLATE > `echo $$TEMPLATE | sed 's/.in$$//'` ; \
done
%:
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: templates
# 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/$(GDAL) \
--with-grass=/usr/lib/$(GRASS) \
--with-postgres-includes=$(shell pg_config --includedir)
override_dh_auto_install:
mkdir -p $(CURDIR)/debian/$(PKGNAME)/usr/lib/$(GDAL)/grass
$(MAKE) install AUTOLOAD_DIR=$(CURDIR)/debian/$(PKGNAME)/usr/lib/gdalplugins/$(GDAL) \
GRASSTABLES_DIR=$(CURDIR)/debian/$(PKGNAME)/usr/lib/$(GDAL)/grass
# removes redundant stuff already installed by grass
rm -rf $(CURDIR)/debian/$(PKGNAME)/usr/lib/$(GDAL)
override_dh_shlibdeps:
dh_shlibdeps -l.:/usr/lib/$(GRASS)/lib
override_dh_strip:
# Debug files contain no debug symbols
dh_strip --no-automatic-dbgsym
|