diff --git a/debian/changelog b/debian/changelog index 1ac3e95..bfaabed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ nut (2.7.4-9) UNRELEASED; urgency=medium LP: #1814314) [ Laurent Bigonville ] + * Switch from cdbs to debhelper sequence * Add libltdl-dev to the build-dependencies and fix FTBFS when it is installed (Closes: #831740) * debian/control: Bump Standards-Version to 4.4.0 (no further changes) @@ -32,7 +33,7 @@ nut (2.7.4-9) UNRELEASED; urgency=medium by nut-server initscript * debian/nut-client.lintian-overrides: Drop unused override - -- Laurent Bigonville Sat, 27 Jul 2019 14:31:16 +0200 + -- Laurent Bigonville Sat, 27 Jul 2019 15:16:11 +0200 nut (2.7.4-8) unstable; urgency=medium diff --git a/debian/control b/debian/control index 2d3669e..4ebf1ce 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,6 @@ Priority: optional Maintainer: Arnaud Quette Uploaders: Laurent Bigonville Build-Depends: autotools-dev, - cdbs (>= 0.4.122~), debhelper (>= 9.20160709~), dh-autoreconf, dh-python, @@ -19,6 +18,7 @@ Build-Depends: autotools-dev, libusb-dev (>= 0.1.8), libwrap0-dev (>= 7.6), python (>= 2.6.6-3~), + python3, systemd [linux-any] Build-Depends-Indep: asciidoc (>= 8.6.3), asciidoc-dblatex, @@ -51,7 +51,7 @@ Depends: adduser, nut-client (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}, - ${udev} + udev [linux-any] Suggests: nut-cgi, nut-ipmi, nut-snmp, nut-xml Conflicts: nut-hal-drivers Replaces: nut (<< 2.6.1-2~) diff --git a/debian/rules b/debian/rules index 02144ba..376931d 100755 --- a/debian/rules +++ b/debian/rules @@ -1,29 +1,16 @@ #!/usr/bin/make -f -include /usr/share/cdbs/1/rules/debhelper.mk -include /usr/share/cdbs/1/class/autotools.mk -include /usr/share/cdbs/1/class/python-module.mk - -include /usr/share/cdbs/1/rules/autoreconf.mk -# We cannot call autoreconf -f -i as it updates INSTALL which is used for doc -# generation -DEB_DH_AUTORECONF_ARGS = --as-needed - DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null) -# List any files which are not installed -include /usr/share/cdbs/1/rules/utils.mk -common-binary-post-install-arch:: list-missing - DEB_BUILD_MAINT_OPTIONS=hardening=+all DEB_LDFLAGS_MAINT_APPEND=-Wl,-z,defs -Wl,-O1 -Wl,--as-needed include /usr/share/dpkg/buildflags.mk -DEB_CONFIGURE_PREFIX := -DEB_CONFIGURE_SYSCONFDIR := /etc/nut -DEB_CONFIGURE_INCLUDEDIR := /usr/include -DEB_CONFIGURE_MANDIR := /usr/share/man -DEB_CONFIGURE_EXTRA_FLAGS := --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ +DEB_CONFIGURE_EXTRA_FLAGS := --prefix= \ + --sysconfdir=/etc/nut \ + --includedir=/usr/include \ + --mandir=/usr/share/man \ + --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ --with-ssl --with-nss \ --with-cgi \ --with-dev \ @@ -47,7 +34,21 @@ ifneq ($(shell which asciidoc),) DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=html-chunked,pdf endif -common-install-arch:: +%: + dh $@ --with python2 --with python3 --with autoreconf --with systemd + +override_dh_auto_configure: + dh_auto_configure -- $(DEB_CONFIGURE_EXTRA_FLAGS) + +override_dh_autoreconf: + dh_autoreconf --as-needed + +override_dh_install: + dh_install --list-missing + +override_dh_auto_install-arch: + dh_auto_install -a + # install the bash completion script mkdir -p $(CURDIR)/debian/tmp/usr/share/bash-completion/completions/ cp $(CURDIR)/scripts/misc/nut.bash_completion \ @@ -115,7 +116,9 @@ ifeq (linux,$(DEB_HOST_ARCH_OS)) $(CURDIR)/debian/nut-server/usr/lib/tmpfiles.d/nut-server.conf endif -common-install-indep:: +override_dh_auto_install-indep: + dh_auto_install -i + #install documentation mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/pdf mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/html @@ -127,18 +130,20 @@ common-install-indep:: cp -a $${f} $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/html/$${nf}/; \ done -binary-install/nut-monitor:: - dh_python2 -pnut-monitor +override_dh_installinit: + dh_installinit --restart-after-upgrade --error-handler=handle_start_failure -DEB_DH_INSTALLINIT_ARGS_nut-server := --init-script=nut-server --restart-after-upgrade --error-handler=handle_start_failure -DEB_DH_INSTALLINIT_ARGS_nut-client := --init-script=nut-client --restart-after-upgrade --error-handler=handle_start_failure -DEB_DH_SYSTEMD_START_ARGS_nut-server := --restart-after-upgrade -DEB_DH_SYSTEMD_START_ARGS_nut-client := --restart-after-upgrade -DEB_DH_COMPRESS_ARGS_nut-doc := -X.pdf +override_dh_systemd_start: + dh_systemd_start --restart-after-upgrade -ifeq (linux,$(DEB_HOST_ARCH_OS)) -# for Debian - DEB_DH_GENCONTROL_ARGS := -- -Vudev="udev (>= 0.124-1)" -# for Ubuntu -# DEB_DH_GENCONTROL_ARGS := -- -Vudev="udev (>= 136-1)" -endif +override_dh_compress: + dh_compress -X.pdf + +override_dh_installdocs: + dh_installdocs -A ./README ./NEWS ./TODO ./AUTHORS + +override_dh_installchangelogs: +# dh_installchangelogs automagically rename history.txt to changelog, let's try +# to avoid that + dh_installchangelogs -pnut -Xhistory.txt + dh_installchangelogs --remaining-packages