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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
|
#!/usr/bin/make -f
INITRAMFS=$(CURDIR)/debian/multipath-tools-boot/usr/share/initramfs-tools/
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM = install -s
else
INSTALL_PROGRAM = install
endif
# 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
export KBUILD_BUILD_TIMESTAMP = "@$(SOURCE_DATE_EPOCH)"
#
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
build: build-arch build-indep
build-arch: build-multipath-udeb-stamp build-stamp
build-indep:
# Nothing to do here.
touch $@
build-stamp: clean-tree
dh_testdir
[ ! -f kpartx/del-part-nodes.rules ] || cp kpartx/del-part-nodes.rules debian/kpartx.del-part-nodes.udev
[ ! -f kpartx/dm-parts.rules ] || cp kpartx/dm-parts.rules debian/kpartx.dm-parts.udev
[ ! -f kpartx/kpartx.rules ] || cp kpartx/kpartx.rules debian/kpartx.udev
[ ! -f multipath/multipath.rules ] || cp multipath/multipath.rules debian/multipath.udev
[ ! -f multipath/11-dm-mpath.rules ] || cp multipath/11-dm-mpath.rules debian/dm-mpath.udev
dh_auto_build -- $(OPTFLAGS) LIB=/lib SYSTEMDPATH=/lib USE_SYSTEMD=1
touch $@
# multipath-udeb: build separately; don't reference dynamic libgcc at runtime (#779579)
build-multipath-udeb-stamp:
dh_testdir
DEB_CFLAGS_MAINT_APPEND="-static-libgcc" dh_auto_build -- $(OPTFLAGS) LIB=/lib USE_SYSTEMD=0
# store files for install target
mkdir -p $(CURDIR)/debian/tmp-multipath-udeb/sbin
$(MAKE) install INSTALL_PROGRAM=$(INSTALL_PROGRAM) DESTDIR=$(CURDIR)/debian/tmp-multipath-udeb LIB=/lib USE_SYSTEMD=0
touch $@
clean-tree:
$(MAKE) clean
clean: clean-tree
dh_testdir
rm -f build-stamp build-multipath-udeb-stamp
dh_prep
debconf-updatepo
rm -rf debian/*.debhelper.log
rm -rf debian/tmp-multipath-udeb
dh_clean
install-indep:
dh_testdir
dh_testroot
dh_prep
dh_installdirs
# initramfs stuff:
install -D -m 755 debian/initramfs/hooks $(INITRAMFS)/hooks/multipath
install -D -m 755 debian/initramfs/local-top \
$(INITRAMFS)/scripts/local-top/multipath
install -D -m 755 debian/initramfs/init-top \
$(INITRAMFS)/scripts/init-top/multipath
# reportbug:
for pkg in "multipath-tools" "multipath-tools-boot"; do \
install -D -m 755 debian/reportbug/script debian/$${pkg}/usr/share/bug/$${pkg}/script; \
done
# lintian override
install -D -m 644 debian/multipath-tools-boot.lintian-overrides \
debian/multipath-tools-boot/usr/share/lintian/overrides/multipath-tools-boot
install: install-indep
dh_testdir
dh_testroot
dh_installdirs
mkdir -p $(CURDIR)/debian/tmp/sbin
$(MAKE) install INSTALL_PROGRAM=$(INSTALL_PROGRAM) DESTDIR=$(CURDIR)/debian/tmp LIB=/lib SYSTEMDPATH=/lib USE_SYSTEMD=1
install -m 755 debian/dmsetup_env $(CURDIR)/debian/tmp/lib/udev/
dh_install -X.rules --fail-missing -Nmultipath-udeb --sourcedir=$(CURDIR)/debian/tmp
dh_install -Xkpartx_id -X.rules -X.service -X.socket --fail-missing -pmultipath-udeb --sourcedir=$(CURDIR)/debian/tmp-multipath-udeb
binary-indep: build-indep install-indep
dh_testdir -i
dh_testroot -i
dh_installdirs -i
dh_installchangelogs -i
dh_installdocs -i
dh_installexamples -i
dh_installinit -pmultipath-tools-boot --name=multipath-tools-boot --no-start -- start 21 S .
dh_installinit -pmultipath-tools-boot
dh_installdebconf -pmultipath-tools-boot
dh_installman -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir -a
dh_testroot -a
dh_installchangelogs -a
dh_installdocs -a
dh_installexamples -a
dh_lintian -a
dh_systemd_enable -pmultipath-tools multipathd.service
dh_installinit -pmultipath-tools
dh_installudev -pkpartx
dh_installudev -pkpartx --name=dm-parts --priority=56
dh_installudev -pkpartx --name=del-part-nodes --priority=68
dh_installudev -pmultipath-tools --name=multipath
dh_installudev -pmultipath-tools --name=dm-mpath --priority=56
dh_link -a lib/systemd/system/multipathd.service \
lib/systemd/system/multipath-tools.service
dh_systemd_start -pmultipath-tools multipathd.service
dh_installman -a
dh_makeshlibs -a --add-udeb=multipath-udeb
dh_link -a
dh_strip -a
dh_compress -a
dh_fixperms -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: binary binary-arch binary-indep unpack configure build clean
|