summaryrefslogtreecommitdiffstats
path: root/debian/rules
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-09-16 09:09:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-09-16 09:09:41 +0000
commit0a8197f8c9a7990de49ba21cacc889ef4cbf7eeb (patch)
treef13241ba3d73956680ae05c890f8454f123c930c /debian/rules
parentAdding upstream version 3.1.0. (diff)
downloadterminaltables-9382e056bdff269a7150d07256f16d60021010a2.tar.xz
terminaltables-9382e056bdff269a7150d07256f16d60021010a2.zip
Adding debian version 3.1.0-4.debian/3.1.0-4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules31
1 files changed, 31 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..a3dbe71
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,31 @@
+#!/usr/bin/make -f
+#export DH_VERBOSE = 1
+
+export PYBUILD_NAME=terminaltables
+
+export PYBUILD_BEFORE_TEST=cp example*.py {build_dir}
+export PYBUILD_AFTER_TEST=rm {build_dir}/example*.py
+
+%:
+ dh $@ --with python3,sphinxdoc --buildsystem pybuild
+
+override_dh_sphinxdoc: export http_proxy=127.0.0.1:9
+override_dh_sphinxdoc: export https_proxy=127.0.0.1:9
+override_dh_sphinxdoc:
+ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
+ PYTHONPATH=. /usr/share/sphinx/scripts/python3/sphinx-build -N -q -E -b html docs/ debian/python-terminaltables-doc/usr/share/doc/python-terminaltables-doc/html/
+ dh_sphinxdoc
+endif
+
+override_dh_compress:
+ dh_compress -X example1.py -X example2.py -X example3.py -X html/
+
+override_dh_installchangelogs:
+ # Trim the changelog section out of the README file. Note that this will
+ # hang if the changelog-section-{start,end} strings don't appear exactly as
+ # they are in the README file.
+ python3 -c "with open('README.rst', encoding='utf-8') as r: print(''.join( \
+ ['' for x in iter(r.readline, '.. changelog-section-start\n')] + \
+ [x for x in iter(r.readline, '.. changelog-section-end\n')]))" \
+ > debian/upstream-changelog
+ dh_installchangelogs debian/upstream-changelog