summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules49
1 files changed, 49 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..b8b2e60
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,49 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+# export DH_VERBOSE=1
+
+# Prevent setuptools/distribute from accessing the internet.
+export http_proxy = http://127.0.0.1:9
+
+package=python-gnupg-ng
+package3=python3-gnupg-ng
+
+export PYBUILD_DESTDIR_python2=debian/$(package)/
+export PYBUILD_DESTDIR_python3=debian/$(package3)/
+
+PYVERS=$(shell pyversions -r)
+PY3VERS = $(shell py3versions -r)
+
+%:
+ dh $@ --with python2,python3,sphinxdoc --buildsystem=python_distutils
+
+override_dh_compress:
+ dh_compress -i -X.rst -X.js -X.html -X.txt
+
+override_dh_auto_build:
+ python$* setup.py build_sphinx
+ set -ex; \
+ for python in $(PYVERS) $(PY3VERS); do \
+ $$python setup.py build; \
+ done
+
+override_dh_auto_clean:
+ dh_auto_clean
+ rm -rf build debian/docs docs/_build *.egg-info __pycache__
+ find \( -name '._*' -o -name '*.pyc' \) -delete
+
+override_dh_auto_install:
+ set -ex; \
+ for python in $(PYVERS); do \
+ $$python setup.py install --skip-build --root $(PYBUILD_DESTDIR_python2) \
+ --install-layout deb; \
+ done
+ rm $(PYBUILD_DESTDIR_python2)usr/bin/versioneer.py
+
+ set -ex; \
+ for python in $(PY3VERS); do \
+ $$python setup.py install --skip-build --root $(PYBUILD_DESTDIR_python3) \
+ --install-layout deb; \
+ done
+ rm $(PYBUILD_DESTDIR_python3)usr/bin/versioneer.py