File: rules

package info (click to toggle)
multipath-tools 0.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,992 kB
  • sloc: ansic: 63,788; perl: 1,622; makefile: 729; sh: 647; pascal: 150
file content (80 lines) | stat: -rwxr-xr-x 2,394 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
72
73
74
75
76
77
78
79
80
#!/usr/bin/make -f

# For Hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/pkg-info.mk

# Reproducible timestamp
export KBUILD_BUILD_TIMESTAMP = "@$(SOURCE_DATE_EPOCH)"

# Disable libdmmp, no known users exist
export ENABLE_LIBDMMP=0

TREENAMES = build-deb build-udeb

%:
	dh $@

execute_before_dh_clean:
	rm -f debian/libmpathpersist0.symbols
	for treename in $(TREENAMES); do \
		rm -rf debian/$$treename ;\
	done
	# Force recreation of docs re. reproducibility
	rm -fv libdmmp/docs/man/dmmp_strerror.3

execute_before_dh_auto_configure:
	# no out of tree build support, prepare two source trees
	for treename in $(TREENAMES); do \
		mkdir debian/$$treename ;\
		cp -r -t debian/$$treename $$(find . -mindepth 1 -maxdepth 1 \! -name debian \! -name .git) ;\
	done

override_dh_auto_configure:

override_dh_auto_build-indep:

override_dh_auto_build-arch:
	dh_auto_build --sourcedirectory=debian/build-deb -- V=1
	# multipath-udeb: build separately; don't reference dynamic libgcc at runtime (#779579); disable systemd
	dh_auto_build --sourcedirectory=debian/build-udeb -- V=1 \
		SYSTEMD= EXTRACFLAGS="-static-libgcc"

override_dh_auto_test:

override_dh_auto_install-arch:
	dh_auto_install --sourcedirectory=debian/build-deb -- DESTDIR=$(CURDIR)/debian/tmp/deb
	dh_auto_install --sourcedirectory=debian/build-udeb -- DESTDIR=$(CURDIR)/debian/tmp/udeb

	# udebs dont get manpages
	rm -rf $(CURDIR)/debian/tmp/udeb/usr/share/man

	# Delete development files from udebs.
	rm \
		$(CURDIR)/debian/tmp/udeb/usr/include/mpath_cmd.h \
		$(CURDIR)/debian/tmp/udeb/usr/include/mpath_persist.h \
		$(CURDIR)/debian/tmp/udeb/usr/lib/libm*.so

override_dh_auto_install-indep:

execute_after_dh_install:
	if strings debian/multipath-udeb/usr/lib/libmultipath.so.0 | grep libsystemd.so ; then \
		echo ERROR: udeb linked to libsystemd ;\
		exit 1 ;\
	fi

override_dh_bugfiles:
	dh_bugfiles -A -pmultipath-tools -pmultipath-tools-boot

override_dh_installsystemd:
	dh_installsystemd -pmultipath-tools multipathd.service multipathd-queueing.service \
		--no-stop-on-upgrade

debian/libmpathpersist0.symbols: debian/libmpathpersist0.symbols.in
	sed -e 's/$${DEB_VERSION}/${DEB_VERSION}/g' \
		< $< > $@

override_dh_makeshlibs: debian/libmpathpersist0.symbols
	dh_makeshlibs -a --add-udeb=multipath-udeb -- -c4