From c16bc503527c71c51bd3e5b90dcf20f869c9d52c Mon Sep 17 00:00:00 2001 From: sebres Date: Mon, 23 Nov 2020 14:43:54 +0100 Subject: [PATCH] allow to create package without tests: DEB_BUILD_OPTIONS='nocheck notest' dpkg-buildpackage -b -rfakeroot -us -uc -d --- debian/rules | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/debian/rules b/debian/rules index 6f5de86d..3ea95443 100755 --- a/debian/rules +++ b/debian/rules @@ -10,6 +10,11 @@ export DH_VERBOSE=1 export PYBUILD_DISABLE_python2=1 +ifneq (,$(filter notest,$(DEB_BUILD_OPTIONS))) +: # no test in package needed +export PYBUILD_BUILD_ARGS=--without-tests +export PYBUILD_INSTALL_ARGS=--without-tests +endif %: dh $@ --with python3,systemd --buildsystem pybuild @@ -23,11 +28,21 @@ override_dh_clean: dh_clean : # auto generated -rm -f bin/fail2ban-python +ifneq (,$(filter notest,$(DEB_BUILD_OPTIONS))) + : # no test in package needed (2to3 ist faster): + -rm -f bin/fail2ban-testcases + -rm -rf fail2ban/tests +endif override_dh_auto_configure: LANG=C ./fail2ban-2to3 dh_auto_configure +override_dh_auto_test: +ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) + LC_ALL=C.UTF-8 python3 bin/fail2ban-testcases --verbosity=2 --no-network +endif + override_dh_install: rm -f $(DESTDIR)/usr/share/doc/fail2ban/README.Solaris find "$(DESTDIR)/etc/fail2ban/" -type f -name 'paths-*.conf' -not -name 'paths-common.conf' -not -name 'paths-debian.conf' -delete @@ -52,12 +67,6 @@ override_dh_install: install -m 644 debian/debian-files/jail.d_defaults-debian.conf $(DESTDIR)/etc/fail2ban/jail.d/defaults-debian.conf dh_install -override_dh_auto_test: -ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) -# fails for now (4 tests), accept it for now - FAIL2BAN_CONFIG_DIR="$(CURDIR)/config" LC_ALL=C.UTF-8 bin/fail2ban-testcases --verbosity=2 --no-network || true -endif - override_dh_installexamples: dh_installexamples files/ipmasq-* files/nagios files/cacti