File: rules

package info (click to toggle)
lvm2 2.03.02-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 13,316 kB
  • sloc: ansic: 156,233; sh: 24,495; python: 5,215; makefile: 1,958; ruby: 66; awk: 20; cpp: 10
file content (150 lines) | stat: -rwxr-xr-x 4,965 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
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
150
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

DEB_HOST_ARCH       ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_HOST_MULTIARCH  ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

DEB_CFLAGS_MAINT_STRIP = -O2
include /usr/share/dpkg/buildflags.mk

SOURCE := $(shell dpkg-parsechangelog | sed -ne 's,^Source: *\(.*\)$$,\1,p')
VERSION_COMPLETE := $(shell dpkg-parsechangelog | sed -ne 's,^Version: *\(.*\)$$,\1,p')
VERSION_DEBIAN := $(shell echo "$(VERSION_COMPLETE)" | sed -e 's,^[^-]*-,,')

DEVMAPPER_ABINAME = 1.02.1
DEVMAPPER_VERSION_PLAIN = $(shell awk '{print $$1}' VERSION_DM)
DEVMAPPER_VERSION = 2:$(DEVMAPPER_VERSION_PLAIN)
DEVMAPPER_VERSION_DEBIAN = $(DEVMAPPER_VERSION)-$(VERSION_DEBIAN)
DEVMAPPER_VERSION_FILE = $(DEVMAPPER_VERSION_PLAIN)-$(VERSION_DEBIAN)

ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS_OPT_DEB = -O2
CFLAGS_OPT_UDEB = -Os
endif

%:
	dh $@ --parallel --with python3

override_dh_auto_configure: SOURCE_FILES = $(filter-out debian, $(wildcard * .[^.]*))
override_dh_auto_configure:
	mkdir -p debian/build/build_deb debian/build/build_udeb
	cp -al $(SOURCE_FILES) debian/build/build_deb/
	cp -al $(SOURCE_FILES) debian/build/build_udeb/
	dh_auto_configure --sourcedirectory=debian/build/build_deb -- \
		--exec-prefix= \
		--bindir=/bin \
		--libdir=/lib/$(DEB_HOST_MULTIARCH) \
		--sbindir=/sbin \
		--with-usrlibdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
		--with-optimisation="$(CFLAGS_OPT_DEB)" \
		--with-cache=internal \
		--with-device-uid=0 \
		--with-device-gid=6 \
		--with-device-mode=0660 \
		--with-default-pid-dir=/run \
		--with-default-run-dir=/run/lvm \
		--with-default-locking-dir=/run/lock/lvm \
		--with-thin=internal \
		--with-thin-check=/usr/sbin/thin_check \
		--with-thin-dump=/usr/sbin/thin_dump \
		--with-thin-repair=/usr/sbin/thin_repair \
		--enable-applib \
		--enable-blkid_wiping \
		--enable-cmdlib \
		--enable-dmeventd \
		--enable-dbus-service \
		--enable-lvmlockd-dlm \
		--enable-lvmlockd-sanlock \
		--enable-lvmpolld \
		--enable-notify-dbus \
		--enable-pkgconfig \
		--enable-readline \
		--enable-udev_rules \
		--enable-udev_sync
	dh_auto_configure --sourcedirectory=debian/build/build_udeb -- \
		--exec-prefix= \
		--bindir=/bin \
		--libdir=/lib \
		--sbindir=/sbin \
		--with-usrlibdir=/usr/lib \
		--with-optimisation="$(CFLAGS_OPT_UDEB)" \
		--with-lvm1=none \
		--with-pool=none \
		--disable-readline \
		--disable-selinux

override_dh_auto_build:
	dh_auto_build --sourcedirectory=debian/build/build_deb -- \
		LIB_VERSION_DM=$(DEVMAPPER_ABINAME)
	dh_auto_build --sourcedirectory=debian/build/build_udeb -- \
		LIB_VERSION_DM=$(DEVMAPPER_ABINAME)

override_dh_auto_install:
	dh_auto_install --sourcedirectory=debian/build/build_deb \
		--destdir=debian/build/install_deb -- \
		install \
		install_systemd_generators \
		install_systemd_units \
		install_tmpfiles_configuration \
		LIB_VERSION_DM=$(DEVMAPPER_ABINAME)
	dh_auto_install --sourcedirectory=debian/build/build_udeb \
		--destdir=debian/build/install_udeb -- \
		LIB_VERSION_DM=$(DEVMAPPER_ABINAME)

override_dh_auto_clean:
	rm -rf debian/build

override_dh_gencontrol:
	dh_gencontrol \
		-pdmsetup \
		-pdmsetup-udeb \
		-pdmeventd \
		-plibdevmapper-dev \
		-plibdevmapper$(DEVMAPPER_ABINAME) \
		-plibdevmapper$(DEVMAPPER_ABINAME)-udeb \
		-plibdevmapper-event$(DEVMAPPER_ABINAME) \
		-- -v$(DEVMAPPER_VERSION_DEBIAN)
	dh_gencontrol --remaining-packages

override_dh_missing:
	dh_missing --sourcedir=debian/build/install_deb --fail-missing

override_dh_install:
	dh_install --sourcedir=debian/build/install_udeb \
		-pdmsetup-udeb \
		-plibdevmapper$(DEVMAPPER_ABINAME)-udeb \
		-plvm2-udeb
	dh_install --sourcedir=debian/build/install_deb \
		--remaining-packages

override_dh_installchangelogs:
	dh_installchangelogs -pdmeventd WHATS_NEW_DM
	dh_installchangelogs -plvm2 WHATS_NEW
	dh_installchangelogs --remaining-packages

override_dh_installinit:
	dh_installinit -plvm2 --no-start
	dh_installinit -plvm2 --restart-after-upgrade --name lvm2-lvmpolld

override_dh_makeshlibs:
	dh_makeshlibs -plibdevmapper$(DEVMAPPER_ABINAME) \
		--add-udeb 'libdevmapper$(DEVMAPPER_ABINAME)-udeb' \
	       	"-Vlibdevmapper$(DEVMAPPER_ABINAME) (>= $(DEVMAPPER_VERSION))" \
		-- "-v$(DEVMAPPER_VERSION_DEBIAN)" -c2
	dh_makeshlibs -plibdevmapper-event$(DEVMAPPER_ABINAME) \
		"-Vlibdevmapper-event$(DEVMAPPER_ABINAME) (>= $(DEVMAPPER_VERSION))" \
		-- "-v$(DEVMAPPER_VERSION_DEBIAN)" -c2
	dh_makeshlibs --remaining-packages -V \
		-- -c2

override_dh_installsystemd:
	dh_installsystemd -plvm2 --no-restart-after-upgrade --no-stop-on-upgrade \
		blk-availability.service \
		lvm2-monitor.service
	dh_installsystemd -plvm2 \
		lvm2-lvmpolld.socket
	dh_installsystemd --remaining-packages