summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules78
1 files changed, 78 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..55ae4f2
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,78 @@
+#!/usr/bin/make -f
+
+#export DH_VERBOSE=1
+
+include /usr/share/python/python.mk
+
+PYVERS=$(shell pyversions -vr)
+PKGDIR=$(CURDIR)/debian/python-pycryptopp
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -rf dist build build-*
+ find . -name '*\.pyc' -delete
+ dh_clean install-stamp build-stamp \
+ $(PYVERS:%=install-python%) $(PYVERS:%=build-python%) \
+ $(PYVERS:%=install-debug-python%) $(PYVERS:%=build-debug-python%)
+
+build: build-stamp
+
+build-stamp: $(PYVERS:%=build-python%) $(PYVERS:%=build-debug-python%)
+ touch $@
+
+build-python%:
+ python$* setup.py build --disable-embedded-cryptopp
+ touch $@
+
+build-debug-python%:
+ python$*-dbg setup.py build --disable-embedded-cryptopp
+ touch $@
+
+install: $(PYVERS:%=install-python%) $(PYVERS:%=install-debug-python%)
+ # pkg_resources is not used (see patches), no need to require setuptools
+ find $(PKGDIR)/usr/ -type f -name requires.txt -delete
+ # docs are in /usr/share/doc/python-pycryptopp/, remove duplicates
+ rm -rf $(PKGDIR)/usr/share/doc/pycryptopp/
+ rm -rf $(PKGDIR)-dbg/usr/share/doc/pycryptopp/
+
+install-python%: build
+ dh_installdirs
+ python$* setup.py install $(py_setup_install_args) \
+ --skip-build --single-version-externally-managed --root $(PKGDIR)
+ # move test vectors outside site-packages
+ if [ -d $(PKGDIR)/usr/share/python-pycryptopp/testvectors ]; then \
+ rm -rf $(PKGDIR)/$(call py_libdir,$*)/pycryptopp/testvectors; \
+ else mv $(PKGDIR)/$(call py_libdir,$*)/pycryptopp/testvectors $(PKGDIR)/usr/share/python-pycryptopp/; fi
+ touch $@
+
+install-debug-python%: build
+ python$*-dbg setup.py install $(py_setup_install_args) \
+ --skip-build --single-version-externally-managed --root $(PKGDIR)-dbg/
+ find $(PKGDIR)-dbg/usr/lib/python$*/ ! -type d ! -name '*_d\.so' -delete
+ find $(PKGDIR)-dbg/usr/lib/python$*/ -depth -empty -delete
+ touch $@
+
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_python2
+ dh_makeshlibs
+ dh_strip --dbg-package=python-pycryptopp-dbg
+ rm -rf $(PKGDIR)-dbg/usr/share/doc/python-pycryptopp-dbg
+ ln -s python-pycryptopp $(PKGDIR)-dbg/usr/share/doc/python-pycryptopp-dbg
+ dh_compress -a -X.py
+ dh_fixperms -a
+ dh_installdeb -a
+ dh_shlibdeps -a
+ dh_gencontrol -a
+ dh_md5sums -a
+ dh_builddeb -a -- -Z bzip2
+
+binary-indep:
+
+binary: binary-indep binary-arch
+
+.PHONY: build clean binary-indep binary-arch binary install