File: rules

package info (click to toggle)
fence-agents 4.3.3-2%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,996 kB
  • sloc: xml: 12,756; python: 11,413; ansic: 3,175; makefile: 195; perl: 135; sh: 100
file content (71 lines) | stat: -rwxr-xr-x 2,364 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/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

%:
	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:
	#[ -f configure ] || sh autogen.sh # Use this when tarball is fixed
	if [ -e configure -a ! -x configure ]; then chmod u+x configure; fi
	./configure \
		--bindir=/usr/bin \
		--sbindir=/usr/sbin \
		--libexecdir=/usr/lib/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_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 ($(shell dpkg-architecture -qDEB_HOST_ARCH),s390x)
	# remove fence_zvm because it doesn't do anything except on 390x
	rm -v debian/tmp/usr/sbin/fence_zvm
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) continue;; esac; \
		echo "Testing $$agent"; \
		PYTHONPATH=debian/tmp/usr/share/fence $$agent --help >/dev/null || exit; \
	done

override_dh_missing:
	dh_missing --fail-missing

override_dh_auto_test:
	# disable testing for agents trying to access the network from build machines
	dh_auto_test -- TEST_TARGET_SKIP="ovh/fence_ovh azure_arm/fence_azure_arm aws/fence_aws gce/fence_gce"

override_dh_python3:
	dh_python3
	dh_python3 /usr/share/fence

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/* | \
	  sed -e 's/\(I.O \)\?\(Fence\|Fencing\) agent for //' | \
	  grep -v fence_amt_ws | \
	  while read line; do echo -n " $$line\$${Newline}"; done ; \
	  echo ; \
	) >> debian/fence-agents.substvars
	dh_gencontrol