File: rules

package info (click to toggle)
mapcache 1.10.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 2,760 kB
  • sloc: ansic: 32,573; xml: 843; sh: 143; makefile: 69; python: 48
file content (108 lines) | stat: -rwxr-xr-x 3,128 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/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

# Remove buildpath from binaries
export DEB_CFLAGS_MAINT_APPEND=-DNDEBUG

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

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

UPSTREAM_VERSION = $(shell echo $(DEB_VERSION_UPSTREAM) | sed -e 's/\+.*//')

BUILD_DATE = $(shell LC_ALL=C date -u "+%d %B %Y" -d "@$(SOURCE_DATE_EPOCH)")

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

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 (,$(filter $(DEB_BUILD_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 \
	      --buildsystem cmake

override_dh_clean:
	dh_clean debian/man/*.1

	-$(RM) -rf obj-*/
	-$(RM) nginx/config

override_dh_auto_configure:
	dh_auto_configure -- $(CMAKE_OPTS)

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

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$(UPSTREAM_VERSION)