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
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# Enable hardening build flags
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
NJOBS := -j1
ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
NJOBS := -j$(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
endif
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
# Disable parallel builds for problematic architectures
NO_PARALLEL_ARCHS = "arm64 armel armhf alpha hurd-i386 kfreebsd-i386 kfreebsd-amd64"
ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
# From mapnik (3.0.8+ds-1ubuntu1):
# The amd64 buildds are castrated to 4G RAM and 4G swap,
# the ppc64el buildds to 12G RAM and 4G swap.
NO_PARALLEL_ARCHS += "amd64 ppc64el"
endif
ifneq (,$(findstring $(DEB_HOST_ARCH),$(NO_PARALLEL_ARCHS)))
NJOBS = -j1
endif
# scons flags
SCONS = $(shell which scons)
SCONS_FLAGS := $(NJOBS)
# -O2
SCONS_FLAGS += OPTIMIZATION=2
SCONS_FLAGS += FULL_LIB_PATH=False
SCONS_FLAGS += INPUT_PLUGINS=csv,gdal,geojson,ogr,pgraster,postgis,raster,shape,sqlite,topojson
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/3.0
SCONS_FLAGS += CUSTOM_CXXFLAGS="$(shell dpkg-buildflags --get CXXFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) -g0"
SCONS_FLAGS += CUSTOM_CFLAGS="$(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) -g0"
SCONS_FLAGS += CUSTOM_LDFLAGS="$(shell dpkg-buildflags --get LDFLAGS) -g0"
%:
dh $@ --parallel
override_dh_auto_clean:
rm -rf build-python
rm -rf debian/stamps
dh_clean
override_dh_auto_configure: debian/stamps/configure-python
debian/stamps/configure-python:
-mkdir build-python
-mkdir debian/stamps
cp -r demo deps fonts include plugins src test utils SConstruct build-python
touch $@
$(SCONS) -C build-python configure \
$(SCONS_FLAGS) \
CCFLAGS="$(CFLAGS)" \
DESTDIR=$(CURDIR)/debian/tmp
override_dh_auto_build: debian/stamps/build-python
debian/stamps/build-python:
$(SCONS) $(NJOBS) -C build-python
override_dh_auto_test: debian/stamps/test-python
debian/stamps/test-python:
# nothing yet
override_dh_auto_install: debian/stamps/install-python
debian/stamps/install-python:
$(SCONS) $(NJOBS) -C build-python install
override_dh_install:
dh_install --list-missing
override_dh_strip:
dh_strip --no-automatic-dbgsym
override_dh_prep:
dh_prep -Xdebian/tmp
override_dh_makeshlibs:
dh_makeshlibs -V
|