File: rules

package info (click to toggle)
mapnik 2.0.0%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 35,496 kB
  • sloc: cpp: 91,793; python: 6,051; xml: 3,528; sh: 848; makefile: 70; lisp: 10
file content (93 lines) | stat: -rwxr-xr-x 2,666 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

UPVER := $(shell dpkg-parsechangelog | grep ^Version | cut -d' ' -f2 | cut -d- -f1 | cut -d+ -f1)
TARNAME := mapnik_$(UPVER)+ds1.orig.tar

# scons flags
SCONS_FLAGS := INPUT_PLUGINS=gdal,geos,kismet,ogr,osm,postgis,raster,rasterlite,shape,sqlite
SCONS_FLAGS += PROJ_INCLUDES=/usr/include PROJ_LIBS=/usr/lib
SCONS_FLAGS += SYSTEM_FONTS=/usr/share/fonts/truetype/ttf-dejavu
SCONS_FLAGS += XMLPARSER=libxml2
SCONS_FLAGS += PREFIX=/usr LIB_DIR_NAME=/mapnik/2.0

override_dh_auto_configure:
	scons $(SCONS_FLAGS) \
		CCFLAGS="$(CFLAGS)" \
		configure

override_dh_auto_build:
	set -e; \
	for ver in $(shell pyversions -r -v); do \
		scons $(SCONS_FLAGS) \
			BOOST_PYTHON_LIB=boost_python-py$$(echo $$ver | sed 's@\.@@') \
			PYTHON=/usr/bin/python$$ver ; \
	done

override_dh_prep:
	dh_prep -Xdebian/tmp

override_dh_auto_install:
	for ver in $(shell pyversions -r -v); do \
		scons $(SCONS_FLAGS) \
			CCFLAGS="$(CFLAGS)" \
			BOOST_PYTHON_LIB=boost_python-py$$(echo $$ver | sed 's@\.@@') \
			PYTHON=/usr/bin/python$$ver \
			DESTDIR=$(CURDIR)/debian/tmp \
			install ; \
	done

override_dh_install:
	dh_install
	find $(CURDIR)/debian/ -name "modserver.py" | xargs chmod -x

	mv $(CURDIR)/debian/mapnik-utils/usr/bin/upgrade_map_xml.py \
		$(CURDIR)/debian/mapnik-utils/usr/bin/upgrade-map-xml

	# build Python API documentation
	# and trick epydoc into loading the shlib too
	-ln -s ../_mapnik2.so bindings/python/mapnik/
	-( cd docs/epydoc_config ; \
	LD_LIBRARY_PATH=$(CURDIR)/debian/libmapnik2-2.0/usr/lib/ ./build_epydoc.sh )
	rm -rf bindings/python/mapnik/_mapnik2.so
	dh_install -pmapnik-doc docs/api_docs/python /usr/share/doc/mapnik-doc/

override_dh_auto_clean:
	scons --clean $(SCONS_FLAGS)
	find -name '*.pyc' -exec rm -f {} \;
	find -name '.sconsign*' -exec rm -f {} \;
	find -name '*.o' -exec rm -f {} \;
	rm -rf .sconf_temp config.log bindings/python/mapnik/paths.py \
		utils/shapeindex/shapeindex config.py config.cache \
		docs/api_docs/python/*

	dh_auto_clean

override_dh_installexamples:
	dh_installexamples -Xdata/new
	find $(CURDIR)/debian/ -name "*.png" | xargs -r chmod -x

%:
	dh $@ \
		--with python2

get-orig-source:
	uscan \
		--verbose \
		--force-download \
		--download-version $(UPVER) \
		--rename \
		--destdir .

	tar xvf mapnik_$(UPVER).orig.tar.gz
	@rm -vrf mapnik_$(UPVER).orig.tar.gz
	@echo Removing third-party sources from orig.tar.gz
	@rm -rf mapnik-$(UPVER)/fonts/dejavu*
	@rm -rf mapnik-$(UPVER)/scons/
	@rm -rf mapnik-$(UPVER)/tinyxml/
	tar cf $(TARNAME) mapnik-$(UPVER)/
	gzip -9 $(TARNAME)
	rm -rf mapnik-$(UPVER)/