File: rules

package info (click to toggle)
mapcache 1.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,444 kB
  • ctags: 1,304
  • sloc: ansic: 21,740; xml: 332; makefile: 60; python: 48; sh: 41
file content (93 lines) | stat: -rwxr-xr-x 2,631 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/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_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/^\(.*\)~.*/\1/' | sed -e 's/dev.*/.0/')

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

%:
	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 $(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)