#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 SHELL = /bin/bash export PYBUILD_NAME=twisted # Don't do any testing while build, it's done within autopkgtesting. export PYBUILD_DISABLE=test export PYBUILD_AFTER_INSTALL=rm -rf {destdir}/usr/lib/python3*/dist-packages/twisted/internet/iocpreactor/notes.txt %: dh $@ --with sphinxdoc --buildsystem=pybuild override_dh_clean: rm -rf *-stamp build tmp rm -rf docs/_build build-doc rm -rf build3-python* rm -rf $(addprefix debian/,$(packages)) debian/files debian/substvars rm -rf _trial_temp test.log rm -f twisted/plugins/dropin.cache find -name '__pycache__' -type d | xargs -r rm -rf find . -name "*.pyc" |xargs -r rm dh_clean override_dh_sphinxdoc: ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS))) PYTHONPATH=src python3 -m sphinx -b html -N docs/ $(CURDIR)/debian/twisted-doc/usr/share/doc/twisted-doc/html dh_sphinxdoc cp -a docs/core/* debian/twisted-doc/usr/share/doc/twisted-doc/ -find debian/twisted-doc -type d -name man | xargs rm -rf # Replace all '#!' calls to python with /usr/bin/python3 and make them # NON executable. for i in `find debian/twisted-doc -mindepth 3 -type f`; do \ sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python3\1,' \ $${i} > $${i}.temp; \ if cmp --quiet $${i} $${i}.temp; then \ rm -f $${i}.temp; \ else \ mv -f $${i}.temp $${i}; \ chmod 644 $${i}; \ echo "fixed interpreter: $${i}"; \ fi; \ done endif override_dh_auto_install: dh_auto_install find debian/python3-twisted -name '__pycache__' | xargs -r rm -rf # Replace all '#!' calls to python with /usr/bin/python3 and make them # executable. for i in `find debian/python3-twisted -mindepth 3 -type f`; do \ sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python3\1,' \ $${i} > $${i}.temp; \ if cmp --quiet $${i} $${i}.temp; then \ rm -f $${i}.temp; \ else \ mv -f $${i}.temp $${i}; \ chmod 755 $${i}; \ echo "fixed interpreter: $${i}"; \ fi; \ done # Tune Python3 man pages. for i in debian/python3-twisted/usr/bin/*; do \ mv $${i} $${i}3; \ done mkdir -p debian/python3-twisted/usr/share/man/man1 for i in docs/core/man/{trial,twistd}.1; do \ i2=$$(basename $${i} .1)3.1; \ cp -p $${i} debian/python3-twisted/usr/share/man/man1/$${i2}; \ done override_dh_compress: # Don't compress an Python files. Especially not in twisted-doc. dh_compress -i -X.py override_dh_python3: dh_python3 -i -X hamcrest