File: rules

package info (click to toggle)
gmt 6.1.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 90,044 kB
  • sloc: ansic: 249,559; sh: 7,994; fortran: 49; makefile: 47; perl: 32; csh: 9
file content (77 lines) | stat: -rwxr-xr-x 2,347 bytes parent folder | download
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
68
69
70
71
72
73
74
75
76
77
#! /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)