3 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
5 CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
6 CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
7 CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
8 LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
10 # Get the supported Python versions
11 PYVERS = $(shell pyversions -r -v)
12 # Get the default Python version
13 PYVERSION = $(shell pyversions -d -v)
15 # Callable functions to determine the correct PYTHONPATH
16 pythonpath = $$(ls -d $(CURDIR)/build/lib.*-$(1))
17 pythonpath_dbg = $$(ls -d $(CURDIR)/build/lib_d.*-$(1) 2>/dev/null || ls -d $(CURDIR)/build/lib.*$(1)-pydebug)
19 export HOME=$(CURDIR)/nonexistent
22 CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \
23 LDFLAGS="$(LDFLAGS)" dh --with python2 --buildsystem=python_distutils $*
25 override_dh_auto_build:
29 override_dh_auto_install:
30 dh_auto_install --destdir=debian/tmp
31 # Install everything excluding the *_d.so debug extensions to python-subvertpy
32 dh_install -X"*_d.so" "debian/tmp/*" -p python-subvertpy
33 # Install the debug extensions to python-subvertpy-dbg
34 dh_install "debian/tmp/usr/lib/python*/*-packages/subvertpy/*_d.so" -p python-subvertpy-dbg
35 mkdir -p debian/python-subvertpy/usr/share/doc/python-subvertpy
36 mv apidocs debian/python-subvertpy/usr/share/doc/python-subvertpy/api
38 override_dh_installdocs:
39 dh_installdocs --link-doc=python-subvertpy
41 override_dh_auto_test:
42 ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
44 for py in $(PYVERS); do \
45 cd $(call pythonpath,$$py); python$$py -m testtools.run subvertpy.tests.test_suite ;\
46 cd $(call pythonpath_dbg,$$py); python$$py-dbg -m testtools.run subvertpy.tests.test_suite ;\
51 ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
52 dh_strip --dbg-package=python-subvertpy-dbg