#! /usr/bin/make -f # Enable hardening build flags export DEB_BUILD_MAINT_OPTIONS=hardening=+all include /usr/share/dpkg/pkg-info.mk CFLAGS += $(CPPFLAGS) ifneq (,$(findstring verbose,$(DEB_BUILD_OPTIONS))) DH_VERBOSE=1 export DH_VERBOSE endif UPSTREAM_VERSION=$(shell echo $(DEB_VERSION_UPSTREAM) | sed -e 's/\+.*//') BUILDDIR = $(CURDIR)/debian/build CMAKE_OPTS = -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_C_FLAGS="-fstrict-aliasing $(CFLAGS)" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DDCW_ROOT=/usr/share/gmt-dcw \ -DGSHHG_ROOT=/usr/share/gmt-gshhg \ -DNETCDF_ROOT=/usr \ -DFFTW3_ROOT=/usr \ -DGDAL_ROOT=/usr \ -DPCRE_ROOT=/usr \ -DGMT_INSTALL_MODULE_LINKS=off \ -DGMT_INSTALL_TRADITIONAL_FOLDERNAMES=off \ -DLICENSE_RESTRICTED=LGPL %: dh $@ --buildsystem cmake \ --sourcedirectory=$(CURDIR) \ --builddirectory=$(BUILDDIR) override_dh_auto_configure: dh_auto_configure -- $(CMAKE_OPTS) override_dh_auto_install: dh_auto_install # Uncompress examples stuff #find $(CURDIR)/debian/gmt-examples/usr/share/doc/gmt-examples/examples -name "*.gz" -exec gunzip {} \; # Remove +x #find $(CURDIR)/debian/gmt-examples/usr/share/doc/gmt-examples/examples -name "*.bat" -exec chmod -x {} \; # Remove executable bit from shell includes chmod -x debian/tmp/usr/share/gmt/tools/gmt_aliases.csh # Remove extra license files rm -rf debian/tmp/usr/share/doc/gmt/copying/ # Fix bash-completion installation mkdir -p debian/tmp/usr/share/bash-completion/completions mv debian/tmp/usr/etc/bash_completion.d/gmt_completion.bash debian/tmp/usr/share/bash-completion/completions rm -rf debian/tmp/usr/etc/bash_completion.d rmdir debian/tmp/usr/etc/ # Strip RPATH chrpath --delete \ debian/tmp/usr/lib/*/gmt/plugins/supplements.so \ debian/tmp/usr/lib/*/lib*.so.*.* \ debian/tmp/usr/bin/gmt override_dh_install: dh_install --list-missing override_dh_compress: # Don't compress the pdf files needed for the gmt-doc-pdf package, nor the examples dh_compress -X.pdf -Xusr/share/doc/gmt-examples/examples/ override_dh_strip: dh_strip --dbgsym-migration='gmt-dbg (<< 5.4.2+dfsg-2~)' override_dh_makeshlibs: dh_makeshlibs -- -v$(UPSTREAM_VERSION)