[Python-modules-commits] [python-roman] 07/12: d/rules: Rewrite using the dh sequencer and the pybuild build system.

Mattia Rizzolo mattia at debian.org
Mon Jan 22 23:06:43 UTC 2018


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository python-roman.

commit 55229b6013f7dffbbe6c2f7b5374dd1001604865
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Mon Jan 22 23:53:07 2018 +0100

    d/rules: Rewrite using the dh sequencer and the pybuild build system.
    
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 debian/rules | 51 +++++++++------------------------------------------
 1 file changed, 9 insertions(+), 42 deletions(-)

diff --git a/debian/rules b/debian/rules
index 9c021f5..b55f132 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,46 +1,13 @@
 #!/usr/bin/make -f
 
-include /usr/share/python3/python.mk
+export PYBUILD_NAME=roman
 
-python2_all = pyversions -r | tr ' ' '\n' | xargs -t -I {} env PYTHONWARNINGS=d {}
-python3_all = $(patsubst py%,py3%,$(python2_all))
-build2 = python setup.py build --build-lib build/2/
-build3 = python3 setup.py build --build-lib build/3/
-install = install $(py_setup_install_args)
+%:
+	dh $@ --with python2,python3 --buildsystem pybuild
 
-.PHONY: clean
-clean: debian/control
-	dh_clean
-	rm -rf build
-
-.PHONY: build build-arch build-indep
-build build-indep: build/stamp
-
-build/stamp: setup.py
-	$(build2)
-	$(build3)
-ifeq "$(filter nocheck,$(DEB_BUILD_OPTIONS))" ""
-	export PYTHONPATH=build/2/ && $(python2_all) tests/romantest.py --verbose
-	export PYTHONPATH=build/3/ && $(python3_all) tests/romantest.py --verbose
-endif
-	touch $(@)
-
-.PHONY: binary binary-arch binary-indep
-binary binary-indep: build/stamp debian/control
-	dh_testroot
-	dh_prep
-	$(build2) $(install) --root=debian/python-roman/
-	$(build3) $(install) --root=debian/python3-roman/
-	sed -i 's/^\(Metadata-Version\): 1\.0$$/\1: 1\.1/' debian/*/usr/lib/python*/*-packages/*.egg-info
-	dh_python2
-	dh_python3
-	dh_installdocs
-	dh_installchangelogs
-	dh_compress
-	dh_fixperms
-	dh_installdeb
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
-
-# vim:ts=4 sw=4 noet
+override_dh_auto_test:
+	PYBUILD_SYSTEM=custom \
+	PYBUILD_BEFORE_TEST="cp -rv {dir}/tests {build_dir}" \
+	PYBUILD_TEST_ARGS="cd {build_dir}; python{version} tests/romantest.py --verbose" \
+	PYBUILD_AFTER_TEST="rm -rfv {build_dir}/tests" \
+	dh_auto_test

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-roman.git



More information about the Python-modules-commits mailing list