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
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# scons flags
# Disable parallel build - it exhausts memory on s390, mipsel, mips
SCONS = $(shell which scons)
SCONS_FLAGS := -j1
# -O2
SCONS_FLAGS += OPTIMIZATION=2
SCONS_FLAGS += INPUT_PLUGINS=csv,gdal,geojson,ogr,osm,postgis,python,raster,rasterlite,shape,sqlite
SCONS_FLAGS += PROJ_INCLUDES=/usr/include PROJ_LIBS=/usr/lib
SCONS_FLAGS += SYSTEM_FONTS=/usr/share/fonts
SCONS_FLAGS += XMLPARSER=libxml2
SCONS_FLAGS += DEMO=False
SCONS_FLAGS += CPP_TESTS=False
SCONS_FLAGS += PREFIX=/usr LIB_DIR_NAME=/mapnik/2.2
SCONS_FLAGS += CUSTOM_CXXFLAGS="$(shell dpkg-buildflags --get CXXFLAGS) -g0"
SCONS_FLAGS += CUSTOM_CFLAGS="$(shell dpkg-buildflags --get CFLAGS) -g0"
SCONS_FLAGS += CUSTOM_LDFLAGS="$(shell dpkg-buildflags --get LDFLAGS) -g0"
SCONS_FLAGS += CUSTOM_DEFINES="$(shell dpkg-buildflags --get CPPFLAGS) -g0"
PYVERS = $(shell pyversions -r -v)
override_dh_auto_configure: $(PYVERS:%=debian/stamps/configure-python%)
debian/stamps/configure-python%:
-mkdir build-python$*
-mkdir debian/stamps
cp -r bindings boost demo deps fonts include plugins src tests utils workspace SConstruct build-python$*
touch $@
python$* $(SCONS) -C build-python$* configure \
$(SCONS_FLAGS) \
CCFLAGS="$(CFLAGS)" \
BOOST_PYTHON_LIB=boost_python-py$$(echo $* | sed 's@\.@@') \
DESTDIR=$(CURDIR)/debian/tmp
override_dh_auto_build: $(PYVERS:%=debian/stamps/build-python%)
debian/stamps/build-python%:
python$* $(SCONS) -C build-python$*
override_dh_prep:
dh_prep -Xdebian/tmp
override_dh_auto_install: $(PYVERS:%=debian/stamps/install-python%)
debian/stamps/install-python%:
python$* $(SCONS) -C build-python$* install
override_dh_install-arch:
dh_install
mv $(CURDIR)/debian/mapnik-utils/usr/bin/upgrade_map_xml.py \
$(CURDIR)/debian/mapnik-utils/usr/bin/upgrade-map-xml
override_dh_install-indep:
# build Python API documentation
# and trick epydoc into loading the shlib too
LD_LIBRARY_PATH=$(CURDIR)/debian/libmapnik2.2/usr/lib/ epydoc --no-private \
--no-frames \
--no-sourcecode \
--name mapnik \
--url http://mapnik.org \
--css $(CURDIR)/utils/epydoc_config/mapnik_epydoc.css \
$(CURDIR)/bindings/python/mapnik \
-o $(CURDIR)/debian/mapnik-doc/usr/share/doc/mapnik-doc/python
override_dh_auto_clean:
rm -rf build-python*
rm -rf debian/stamps
dh_clean
override_dh_auto_test: $(PYVERS:%=debian/stamps/test-python%)
debian/stamps/test-python%:
# nothing yet
%:
dh $@ --with python2
|