diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 06:50:18 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 06:50:18 +0000 |
commit | a8f6774ad2693bebb5c45b437815a3dfc777627f (patch) | |
tree | adcb37c02a764490d40305ba8c4c25e82d3b8752 /debian/rules | |
parent | Adding upstream version 4.12.1. (diff) | |
download | fence-agents-a8f6774ad2693bebb5c45b437815a3dfc777627f.tar.xz fence-agents-a8f6774ad2693bebb5c45b437815a3dfc777627f.zip |
Adding debian version 4.12.1-1.debian/4.12.1-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/rules')
-rwxr-xr-x | debian/rules | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..56ca903 --- /dev/null +++ b/debian/rules @@ -0,0 +1,93 @@ +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS = hardening=+all +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk +include /usr/share/dpkg/pkg-info.mk +include /usr/share/dpkg/architecture.mk + +# Fix FTBFS in s390x with GCC 12 +ifeq ($(DEB_HOST_ARCH),s390x) +export DEB_CFLAGS_MAINT_APPEND=-Wno-stringop-truncation +endif + +%: + dh $@ --with python3 + +override_dh_autoreconf: + # fix version reported by agents + echo $(DEB_VERSION_UPSTREAM) > .tarball-version + dh_autoreconf ./autogen.sh + +override_dh_auto_configure: + dh_auto_configure -- \ + --libexecdir=/usr/libexec/fence-agents \ + --with-fencetmpdir=/run/fence-agents \ + PING_CMD=/bin/ping \ + PING6_CMD=/bin/ping6 \ + PING4_CMD="/bin/ping -4" \ + PYTHON=/usr/bin/python3 \ + SBD_PATH=/usr/sbin/sbd \ + VGS_PATH=/sbin/vgs + +override_dh_auto_build: + LC_ALL=C dh_auto_build + +override_dh_auto_install: + $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp + +override_dh_install: + rm -v debian/tmp/usr/share/doc/fence-agents/COPY* + rm -v debian/tmp/usr/share/doc/fence-agents/README.licence + rmdir debian/tmp/usr/share/doc/fence-agents +ifneq ($(DEB_HOST_ARCH),s390x) + # remove fence_zvm because it doesn't do anything except on 390x + rm -v debian/tmp/usr/sbin/fence_zvm + rm -v debian/tmp/usr/share/man/man8/fence_zvm.8 +endif + dh_install + # test agents (skip ack_manual, it doesn't have --help, skip vmware_helper, it wants VIRuntime.pm) + # we test in tmp after install so the .pyc files generated don't make it into the package + for agent in debian/tmp/usr/sbin/*; do \ + case $${agent##*/} in fence_ack_manual|fence_vmware_helper|fence_virt) continue;; esac; \ + echo "Testing $$agent"; \ + PYTHONPATH=debian/tmp/usr/share/fence $$agent --help >/dev/null || exit; \ + done + # fence_virt is in a separate package + rm -v debian/fence-agents/usr/sbin/fence_virt + rm -v debian/fence-agents/usr/sbin/fence_virtd + rm -v debian/fence-agents/usr/sbin/fence_xvm + rm -v debian/fence-agents/usr/share/man/man8/fence_virt.8 + rm -v debian/fence-agents/usr/share/man/man8/fence_virtd.8 + rm -v debian/fence-agents/usr/share/man/man8/fence_xvm.8 + +# tests are slow and require network access so moved to debian/tests/{delay,metadata} +override_dh_auto_test: + +override_dh_python3: + dh_python3 + dh_python3 /usr/share/fence + +override_dh_installsystemd: + mkdir -p debian/fence-virtd/lib/systemd/system/ + cp agents/virt/fence_virtd.service debian/fence-virtd/lib/systemd/system/ + dh_installsystemd -pfence-virtd + +override_dh_installinit: + dh_installinit -pfence-virtd --name=fence_virtd + +override_dh_missing: + rm debian/tmp/usr/lib/*/fence-virt/*.*a + dh_missing --fail-missing + +override_dh_gencontrol: + # extract agent descriptions for use in debian/control + export LC_ALL=C; \ + ( echo -n "agents="; \ + sed -ne 's/<resource-agent name="\(.*\)" shortdesc="\(.*\)".*/\1: \2/p' tests/data/metadata/*.xml | \ + sed -e 's/\(I.O \)\?\(Fence\|Fencing\) agent for //' | \ + grep -v 'fence_amt_ws:\|fence_virt:' | \ + while read line; do echo -n " $$line\$${Newline}"; done ; \ + echo ; \ + ) >> debian/fence-agents.substvars + dh_gencontrol |