From a30fb774a82f7a775940c6238742c48dc3dc147a Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sun, 15 May 2016 04:56:50 +0200 Subject: [PATCH] Switch build system to pybuild, enable hardening --- debian/docs | 2 -- debian/rules | 90 ++++++++++++---------------------------------------- 2 files changed, 21 insertions(+), 71 deletions(-) diff --git a/debian/docs b/debian/docs index 66d4f41..0bd3136 100644 --- a/debian/docs +++ b/debian/docs @@ -1,3 +1 @@ -NEWS -README doc/html diff --git a/debian/rules b/debian/rules index d472727..f15dc53 100755 --- a/debian/rules +++ b/debian/rules @@ -1,9 +1,4 @@ #!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. -# -# Modified to make a template file for a multi-binary package with separated -# build-arch and build-indep targets by Bill Allombert 2001 # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 @@ -11,77 +6,34 @@ # This has to be exported to make some magic below work. export DH_OPTIONS -PYVERS := $(shell pyversions -vr) -PY3VERS := $(shell py3versions -vr) +export PYBUILD_NAME = pylibacl +export PYBUILD_DISABLE = test -PKGROOT=debian/python-pylibacl -DBGROOT=debian/python-pylibacl-dbg -PKG3ROOT=debian/python3-pylibacl -DBG3ROOT=debian/python3-pylibacl-dbg +export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk -build: build-arch build-indep - touch $@ +%: + dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild -build-arch: $(PYVERS:%=build-python%) $(PY3VERS:%=build-python%) - $(MAKE) doc - touch $@ +# Also build the documentation +override_dh_auto_build: + dh_auto_build + PYTHONPATH=. http_proxy='127.0.0.1:9' make doc -build-python%: - python$* setup.py build - python$*-dbg setup.py build - touch $@ - -build-indep: - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-indep build-arch +# ... and clean it +override_dh_auto_clean: + dh_auto_clean $(MAKE) clean - rm -f $(PYVERS:%=build-python%) - rm -f $(PY3VERS:%=build-python%) - rm -rf pylibacl.egg-info - dh_clean - -install: build $(PYVERS:%=install-python%) $(PY3VERS:%=install-python%) - find $(DBGROOT) ! -type d ! -name '*_d.so' | xargs rm -f - find $(DBGROOT) -depth -empty -print0 | xargs -r0 rmdir - -install-python2%: - python2$* setup.py install --root $(PKGROOT) --install-layout=deb - python2$*-dbg setup.py install --root $(DBGROOT) --install-layout=deb - -install-python3%: - python3$* setup.py install --root $(PKG3ROOT) --install-layout=deb - python3$*-dbg setup.py install --root $(DBG3ROOT) --install-layout=deb -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs - dh_installdocs - dh_sphinxdoc +override_dh_strip: dh_strip -ppython-pylibacl --dbg-package=python-pylibacl-dbg dh_strip -ppython3-pylibacl --dbg-package=python3-pylibacl-dbg - rm -rf $(DBGROOT)/usr/share/doc/python-pylibacl-dbg - ln -s python-pylibacl $(DBGROOT)/usr/share/doc/python-pylibacl-dbg - rm -rf $(DBG3ROOT)/usr/share/doc/python3-pylibacl-dbg - ln -s python3-pylibacl $(DBG3ROOT)/usr/share/doc/python3-pylibacl-dbg - dh_compress -X.js - dh_fixperms - dh_python2 - dh_python3 - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb -# Build architecture independant packages here. -binary-indep: build install -# Nothing to do +override_dh_installdocs: + dh_installdocs --link-doc=python-pylibacl -ppython-pylibacl-dbg + dh_installdocs --link-doc=python3-pylibacl -ppython3-pylibacl-dbg + dh_installdocs -A --remaining-packages README -binary: binary-arch binary-indep -.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure +override_dh_installchangelogs: + dh_installchangelogs -A NEWS -- 2.39.5