File: rules

package info (click to toggle)
mapserver 7.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 16,620 kB
  • sloc: ansic: 176,974; cpp: 58,161; python: 2,969; xml: 1,676; cs: 997; yacc: 856; lex: 766; java: 588; perl: 428; makefile: 374; sh: 184; tcl: 158; ruby: 55
file content (176 lines) | stat: -rwxr-xr-x 4,891 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.

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

# This has to be exported to make some magic below work.
export DH_OPTIONS

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

include /usr/share/dpkg/pkg-info.mk

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS   := $(shell dpkg-buildflags --get CFLAGS)
LDFLAGS  := $(shell dpkg-buildflags --get LDFLAGS)

CFLAGS += $(CPPFLAGS)
CFLAGS += $(LDFLAGS)

RUBYVERSIONS := $(shell dh_ruby --print-supported)
#PHPAPI      := $(shell php-config --phpapi)

MANPAGES := $(wildcard debian/man/*.*.xml)

MS_VERSION := $(shell echo $(DEB_VERSION_UPSTREAM) | sed -e 's/\+.*//')
BUILD_DATE := $(shell LC_ALL=C date -u "+%d %B %Y" -d "@$(SOURCE_DATE_EPOCH)")

CMAKE_OPTS := \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS)" \
		-DCMAKE_MODULE_LINKER_FLAGS="$(LDFLAGS)" \
		-DCMAKE_SHARED_LINKER_FLAGS="$(LDFLAGS)" \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_VERBOSE_MAKEFILE=1 \
		-DWITH_PROJ=1 \
		-DWITH_KML=1 \
		-DWITH_SOS=1 \
		-DWITH_WMS=1 \
		-DWITH_FRIBIDI=1 \
		-DWITH_HARFBUZZ=1 \
		-DWITH_ICONV=1 \
		-DWITH_CAIRO=1 \
		-DWITH_SVGCAIRO=0 \
		-DWITH_RSVG=1 \
		-DWITH_MYSQL=0 \
		-DWITH_FCGI=1 \
		-DWITH_GEOS=1 \
		-DWITH_POSTGIS=1 \
		-DWITH_GDAL=1 \
		-DWITH_OGR=1 \
		-DWITH_CURL=1 \
		-DWITH_CLIENT_WMS=1 \
		-DWITH_CLIENT_WFS=1 \
		-DWITH_WFS=1 \
		-DWITH_WCS=1 \
		-DWITH_LIBXML2=1 \
		-DWITH_THREAD_SAFETY=1 \
		-DWITH_GIF=1 \
		-DWITH_ORACLESPATIAL=0 \
		-DWITH_ORACLE_PLUGIN=0 \
		-DWITH_MSSQL2008=0 \
		-DWITH_EXEMPI=0 \
		-DWITH_XMLMAPFILE=0 \
		-DWITH_V8=0 \
		-DWITH_PIXMAN=0

%:
	dh $@ --with python2,pkgkde_symbolshelper \
	      --parallel \
	      --buildsystem cmake

override_dh_auto_clean:
	dh_clean

	-$(RM) -f $(CURDIR)/debian/man/*.1
	-$(RM) -rf obj-*/
	-$(RM) -rf build-ruby*/ debian/tmp-ruby*/

override_dh_auto_configure:
	dh_auto_configure -- $(CMAKE_OPTS) \
			     -DWITH_PYTHON=1 \
			     -DWITH_PHP=0 \
			     -DWITH_PERL=1 \
			     -DWITH_RUBY=0 \
			     -DWITH_JAVA=1 \
			     -DWITH_CSHARP=0

	for RUBY in $(RUBYVERSIONS); do \
		dh_auto_configure --builddirectory=build-$$RUBY -- $(CMAKE_OPTS) \
								   -DWITH_PYTHON=0 \
								   -DWITH_PHP=0 \
								   -DWITH_PERL=0 \
								   -DWITH_RUBY=1 \
								   -DWITH_JAVA=0 \
								   -DWITH_CSHARP=0 \
								   -DRUBY_EXECUTABLE=/usr/bin/$$RUBY \
		; \
	done
	

override_dh_auto_build:
	# Create man pages from DocBook XML
	for x in $(MANPAGES) ; do \
	  docbook2x-man --string-param header-3="$(BUILD_DATE)" $$x ; \
	  mv `basename $$x | sed 's/.xml$$//'` `dirname $$x` ; \
	done

	dh_auto_build

	for RUBY in $(RUBYVERSIONS); do \
		dh_auto_build --builddirectory=build-$$RUBY ; \
	done

override_dh_auto_test:
	# msautotest submodule is not used

override_dh_auto_install:
	dh_auto_install

	for RUBY in $(RUBYVERSIONS); do \
		dh_auto_install --builddirectory=build-$$RUBY --destdir=debian/tmp-$$RUBY ; \
		mkdir -p debian/tmp/`$$RUBY -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir']"` ; \
		mv -v debian/tmp-$$RUBY`$$RUBY -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir']"`/mapscript.so \
		      debian/tmp`$$RUBY -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir']"`/ ; \
	done

	-mkdir -p $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/
	-mv -v $(CURDIR)/debian/tmp/usr/lib/libmapserver*.so* $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/
	-sed -i "s/lib\/libmapserver/lib\/$(DEB_HOST_MULTIARCH)\/libmapserver/g" $(CURDIR)/debian/tmp/usr/share/*/cmake/*.cmake

	# removing embedded rpath in binaries
	-find $(CURDIR)/debian/tmp/usr/bin -type f -exec chrpath --delete {} \;

	# removing embedded rpath in libraries
	-find $(CURDIR)/debian/tmp/usr/lib -name "*.so*" -type f -exec chrpath --delete {} \;

	# TODO: Use dh_php for substvars & mapscript.ini installation
	# PHP mapscript
	#echo 'misc:Depends=phpapi-'$(PHPAPI) >> debian/php-mapscript.substvars

	#-mkdir -p debian/tmp/etc/php/7.0/mods-available/
	#install -m644 debian/mapscript.ini debian/tmp/etc/php/7.0/mods-available/

override_dh_installchangelogs:
	dh_installchangelogs HISTORY.TXT

override_dh_installexamples:
	dh_installexamples

	#-chmod a-x $(CURDIR)/debian/php-mapscript/usr/share/doc/php-mapscript/examples/*.phtml

override_dh_install:
	dh_install --autodest --list-missing

override_dh_compress:
	dh_compress -X.xml -X.xsd -X.xsl

override_dh_makeshlibs:
	dh_makeshlibs -Xphp_mapscript -- -c0 -v$(MS_VERSION)

override_dh_python2:
	dh_python2 -ppython-mapscript

override_dh_perl:
	dh_perl -plibmapscript-perl

override_dh_java:
	dh_java -plibmapscript-java

override_dh_strip:
	dh_strip --dbgsym-migration='libmapserver-dbg (<< 7.2.0~)'