Switch from cdbs to debhelper sequence
This commit is contained in:
parent
0808410404
commit
57fac761d2
3 changed files with 42 additions and 36 deletions
71
debian/rules
vendored
71
debian/rules
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue