| 1 |
#! /usr/bin/make -f |
| 2 |
|
| 3 |
# Uncomment this to turn on verbose mode. |
| 4 |
#export DH_VERBOSE=1 |
| 5 |
|
| 6 |
# This has to be exported to make some magic below work. |
| 7 |
export DH_OPTIONS |
| 8 |
|
| 9 |
include /usr/share/dpkg/architecture.mk |
| 10 |
|
| 11 |
CURLVERS := $(strip $(shell /usr/bin/curl-config --version | awk '{print $$2}' | sed 's/-rc/~rc/')) |
| 12 |
|
| 13 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 14 |
|
| 15 |
DO_PACKAGES = $(shell dh_listpackages) |
| 16 |
|
| 17 |
ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)) |
| 18 |
export _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__$(DEB_HOST_MULTIARCH) |
| 19 |
endif |
| 20 |
|
| 21 |
export no_proxy=localhost,127.0.0.1 |
| 22 |
export PYBUILD_NAME=pycurl |
| 23 |
export PYBUILD_BEFORE_TEST=make -C tests/fake-curl/libcurl && mkdir -p tests/tmp |
| 24 |
export PYBUILD_TEST_ARGS=-v -ra -m 'not online' |
| 25 |
export PYCURL_VSFTPD_PATH=vsftpd |
| 26 |
|
| 27 |
%: |
| 28 |
dh $@ --buildsystem=pybuild |
| 29 |
|
| 30 |
override_dh_auto_build-indep: |
| 31 |
$(MAKE) docs PYTHON=python3 |
| 32 |
|
| 33 |
override_dh_auto_test-indep: |
| 34 |
|
| 35 |
execute_after_dh_auto_install-arch: |
| 36 |
# Remove documentation as installed by setup.py |
| 37 |
rm -rf $(CURDIR)/debian/python*-pycurl*/usr/share/doc/pycurl |
| 38 |
|
| 39 |
override_dh_installdocs: |
| 40 |
mkdir -p debian/python-pycurl-doc/usr/share/doc/python-pycurl-doc/html |
| 41 |
ifneq (,$(filter python-pycurl-doc,$(DO_PACKAGES))) |
| 42 |
cp -a build/doc/* $(CURDIR)/debian/python-pycurl-doc/usr/share/doc/python-pycurl-doc/html |
| 43 |
endif |
| 44 |
dh_installdocs -ppython3-pycurl --link-doc=python3-pycurl |
| 45 |
dh_installdocs -Npython3-pycurl |
| 46 |
|
| 47 |
override_dh_installchangelogs: |
| 48 |
dh_installchangelogs ChangeLog |
| 49 |
|
| 50 |
override_dh_strip: |
| 51 |
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS))) |
| 52 |
dh_strip -ppython3-pycurl --dbgsym-migration='python3-pycurl-dbg (<< 7.44.1-2~)' |
| 53 |
endif |
| 54 |
|
| 55 |
override_dh_compress: |
| 56 |
dh_compress -X.py |
| 57 |
|
| 58 |
override_dh_shlibdeps: |
| 59 |
dh_shlibdeps -a |
| 60 |
sed -i '/shlibs:Depends/s,\(libcurl[0-9]*t64-gnutls (>= \)[^)]*\().*\),\1$(CURLVERS)\2,' debian/python3-pycurl*.substvars |