File: rules

package info (click to toggle)
mapcache 1.4.1-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,892 kB
  • ctags: 2,572
  • sloc: ansic: 25,570; xml: 367; sh: 92; makefile: 66; python: 48
file content (101 lines) | stat: -rwxr-xr-x 3,038 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
#!/usr/bin/make -f
# -*- makefile -*-

# 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

DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
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)

MAPCACHE_VERSION=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p' | sed -e 's/\+.*//; s/^[0-9]://')
BUILD_DATE=$(shell dpkg-parsechangelog | sed -ne 's/^Date: //p' | LC_ALL=C date -u "+%d %B %Y" -f -)

CMAKE_OPTS:= \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_VERBOSE_MAKEFILE=1 \
		-DWITH_PIXMAN=1 \
		-DWITH_SQLITE=1 \
		-DWITH_BERKELEY_DB=0 \
		-DWITH_TIFF=1 \
		-DWITH_TIFF_WRITE_SUPPORT=0 \
		-DWITH_GEOTIFF=0 \
		-DWITH_MAPSERVER=0 \
		-DWITH_PCRE=1 \
		-DWITH_APACHE=1 \
		-DWITH_VERSION_STRING=1 \
		-DWITH_CGI=1 \
		-DWITH_FCGI=1 \
		-DWITH_GEOS=1 \
		-DWITH_OGR=1

# Disable memcache support on architectures where it's not supported
ifneq (,$(findstring $(DEB_HOST_ARCH),"armel armhf i386 mips mipsel powerpc hppa hurd-i386"))
	CMAKE_OPTS += -DWITH_MEMCACHE=0
else
	CMAKE_OPTS += -DWITH_MEMCACHE=1
endif

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

override_dh_clean:
	dh_clean

	-$(RM) -rf obj-*/
	-$(RM) nginx/config
	-$(RM) debian/*.1

override_dh_auto_configure:
	dh_auto_configure -- $(CMAKE_OPTS)

override_dh_auto_build:
	# Create man page from DocBook XML
	-docbook2x-man --string-param header-3="$(BUILD_DATE)" $(CURDIR)/debian/mapcache_seed.1.xml
	-mv mapcache_seed.1 $(CURDIR)/debian/

	dh_auto_build

override_dh_auto_install:
	dh_auto_install

	-mkdir -p $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/
	-mv -v $(CURDIR)/debian/tmp/usr/lib/libmapcache*.so* $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/

	mkdir -p $(CURDIR)/debian/tmp/usr/lib/cgi-bin/
	mv $(CURDIR)/debian/tmp/usr/bin/mapcache.fcgi $(CURDIR)/debian/tmp/usr/lib/cgi-bin/mapcache

	# Strip RPATH
	-find $(CURDIR)/debian/tmp/usr/bin -type f -exec chrpath --delete {} \;
	-find $(CURDIR)/debian/tmp/usr/lib -name "*.so*" -type f -exec chrpath --delete {} \;
	-find $(CURDIR)/obj-*/apache -name "*.so*" -type f -exec chrpath --delete {} \;

	# libmapcache-dev headers
	-mkdir -p $(CURDIR)/debian/tmp/usr/include/mapcache/
	install -m 644 $(CURDIR)/include/*.h $(CURDIR)/debian/tmp/usr/include/mapcache/
	install -m 644 $(CURDIR)/obj-*/*/*.h $(CURDIR)/debian/tmp/usr/include/mapcache/

	# Install apache module
	install -d $(CURDIR)/debian/tmp/etc/apache2/mods-available
	install -m 644 $(CURDIR)/debian/mapcache.load $(CURDIR)/debian/tmp/etc/apache2/mods-available

override_dh_install:
	dh_install --autodest --list-missing

override_dh_makeshlibs:
	dh_makeshlibs -- -c0 -v$(MAPCACHE_VERSION)