#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 PY3_PROVIDES=sip-py3api-12.0, sip-py3api-12.1, sip-py3api-12.2, sip-py3api-12.3, sip-py3api-12.4, sip-py3api-12.5, sip-py3api-12.6, sip-py3api-12.7 # `dh_python3 --depends sip` should generate dependency on newest API only PYDIST=sip $(lastword $(PY3_PROVIDES)) PYTHON3S := $(shell py3versions -vr) CONFIGURE_PY_ARGS=--destdir /usr/lib/python{version}/dist-packages --debug --no-dist-info \ "CFLAGS=$(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)" \ "CXXFLAGS=$(shell dpkg-buildflags --get CXXFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)" \ "LFLAGS=$(shell dpkg-buildflags --get LDFLAGS)" export DEB_BUILD_MAINT_OPTIONS=reproducible=+fixfilepath export PYBUILD_NAME=sip export PYBUILD_SYSTEM=custom export PYBUILD_CONFIGURE_ARGS=mkdir build-{interpreter}; cd build-{interpreter}; {interpreter} ../configure.py $(CONFIGURE_PY_ARGS) export PYBUILD_CONFIGURE_ARGS_python3-dbg=$(PYBUILD_CONFIGURE_ARGS) --no-tools --no-stubs export PYBUILD_BUILD_ARGS=$(MAKE) -C build-{interpreter} export PYBUILD_AFTER_BUILD=sed -Ei "s, -f(debug|file)-prefix-map=$(CURDIR)=.,,g" build-{interpreter}/sipconfig.py export PYBUILD_INSTALL_ARGS=$(MAKE) -C build-{interpreter} install DESTDIR=$(CURDIR)/debian/tmp export PYBUILD_INSTALL_ARGS_python3-dbg=$(MAKE) -C build-{interpreter} install DESTDIR=$(CURDIR)/debian/{package} export PYBUILD_CLEAN_ARGS=rm -rf build-{interpreter} %: dh $@ --with python3 --buildsystem=pybuild sipgen/lexer.c: sipgen/metasrc/lexer.l flex --outfile=sipgen/lexer.c sipgen/metasrc/lexer.l sipgen/parser.c: sipgen/metasrc/parser.y bison --yacc --defines=sipgen/parser.h --output=sipgen/parser.c sipgen/metasrc/parser.y override_dh_auto_configure: sipgen/lexer.c sipgen/parser.c dh_auto_configure debian/sipconfig_py3.py: cp debian/sipconfig_py3.header debian/sipconfig_py3.py set -e; for version in $(PYTHON3S:3.%=%); do \ sed -e "s/@MINORVERS@/$$version/g" debian/sipconfig_py3.snippet \ >> debian/sipconfig_py3.py; \ done override_dh_auto_install: debian/sipconfig_py3.py dh_auto_install mkdir -p debian/tmp/usr/lib/python3/dist-packages cp debian/sipconfig_py3.py debian/tmp/usr/lib/python3/dist-packages/sipconfig.py set -ex; for version in $(PYTHON3S:3.%=%); do \ sed -Ei "s,python3\.$$version/dist-packages,python3/dist-packages," build-python3.$$version/sipconfig.py; \ sed -Ei "s,python3\.$$version/dist-packages,python3/dist-packages," build-python3.$$version-dbg/sipconfig.py; \ cp build-python3.$$version/sipconfig.py debian/tmp/usr/lib/python3/dist-packages/sipconfig_nd$$version.py; \ cp build-python3.$$version-dbg/sipconfig.py debian/tmp/usr/lib/python3/dist-packages/sipconfig_d$$version.py; \ abiflags=$$(python3.$$version -c "import sys; print(sys.abiflags)"); \ abiflags_dbg=$$(python3.$$version-dbg -c "import sys; print(sys.abiflags)"); \ mkdir debian/tmp/usr/include/python3.$${version}$${abiflags_dbg}; \ ln -s ../python3.$${version}$${abiflags}/sip.h debian/tmp/usr/include/python3.$${version}$${abiflags_dbg}/sip.h; \ done override_dh_installman: pod2man -c Debhelper -r '' debian/dh_sip3 debian/manpages/dh_sip3.1 dh_installman override_dh_strip: dh_strip -ppython3-sip --dbg-package=python3-sip-dbg dh_strip --remaining-packages -Npython3-sip-dbg override_dh_install-indep: python3 -m sphinx sphinx debian/python-sip-doc/usr/share/doc/python-sip-doc/html dh_sphinxdoc override_dh_installdocs: dh_installdocs -ppython3-sip-dbg --link-doc=python3-sip dh_installdocs --remaining-packages -A NEWS override_dh_python3: echo "$(PYDIST)" > debian/python3-sip.pydist dh_python3 --no-dbg-cleaning override_dh_gencontrol: echo "sip3:Provides=$(PY3_PROVIDES)" >> debian/python3-sip.substvars dh_gencontrol override_dh_missing-indep: dh_missing --list-missing