File: rules

package info (click to toggle)
util-linux 2.29.2-1+deb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 40,944 kB
  • sloc: ansic: 115,419; sh: 13,753; makefile: 375; xml: 316; python: 316; csh: 37; sed: 16; perl: 15
file content (183 lines) | stat: -rwxr-xr-x 5,772 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/pkg-info.mk

CONFOPTS += --enable-line
CONFOPTS += --libdir=/lib/$(DEB_HOST_MULTIARCH)
CONFOPTS += --libexecdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)

# Enable deprecated pg utility again as we're shipping it in the package.
# Needs closer investigation if it can safely be removed.
CONFOPTS += --enable-pg

ifeq ($(DEB_HOST_ARCH_OS),linux)
CONFOPTS += --enable-raw
CONFOPTS += --with-selinux
CONFOPTS += --enable-partx
ifneq ($(filter stage1,$(DEB_BUILD_PROFILES)),)
	CONFOPTS += --without-systemd --without-udev
else
	CONFOPTS += --with-systemd --with-udev
endif
CONFOPTS += --enable-tunelp
endif

# build static versions of programs used in fdisk-udeb and util-linux-udeb
CONFOPTS += --enable-static-programs=fdisk,sfdisk,blkid

CONFOPTS += --localstatedir=/run
CONFOPTS += --disable-silent-rules
CONFOPTS += --without-python

# never use /etc/mtab, it should be a link to /proc/mounts
# but in case it isn't - just don't use it, go straight for
# /proc/self/mountinfo or /proc/mounts.
CONFOPTS += --enable-libmount-force-mountinfo

# disable utilities shipped by other packages
# => login
CONFOPTS += --disable-login
CONFOPTS += --disable-nologin
CONFOPTS += --disable-su
# => procps
CONFOPTS += --disable-kill
# => eject
CONFOPTS += --disable-eject
# => passwd
CONFOPTS += --disable-chfn-chsh

ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
	CROSS :=
else
	CROSS := CC="$(DEB_HOST_GNU_TYPE)-gcc -std=gnu99"
endif

%:
	dh $@

override_dh_autoreconf:
	AM_OPTS=--copy LT_OPTS=--copy dh_autoreconf ./autogen.sh

override_dh_auto_configure:
	dh_auto_configure -- $(CONFOPTS) $(CROSS)

override_dh_auto_build:
	dh_auto_build -- $(CROSS)

override_dh_auto_install:
	dh_auto_install
ifneq ($(filter stage1,$(DEB_BUILD_PROFILES)),)
	# Manually generate and install units to avoid missing files when
        # util-linux.install gets executed in stage1 builds.
	install -d debian/tmp/lib/systemd/system
	make PATHFILES=sys-utils/fstrim.service sys-utils/fstrim.service
	install -m644 sys-utils/fstrim.service debian/tmp/lib/systemd/system/fstrim.service
	install -m644 sys-utils/fstrim.timer debian/tmp/lib/systemd/system/fstrim.timer
endif
	#
	# the version in bsdmainutils seems newer.
	rm -f debian/tmp/usr/bin/look debian/tmp/usr/share/man/man1/look.1
	rm -f debian/tmp/usr/bin/hexdump debian/tmp/usr/share/man/man1/hexdump.1
	# and it's less pain to just let bsmainutils deliver col for now.
	rm -f debian/tmp/usr/bin/col* debian/tmp/usr/share/man/man1/col*.1
	rm -f debian/tmp/usr/bin/ul debian/tmp/usr/share/man/man1/ul*.1
	rm -f debian/tmp/usr/bin/cal debian/tmp/usr/share/man/man1/cal.1
	# remove *.la files
	rm -f debian/tmp/usr/lib/*/*.la

override_dh_auto_clean:
	dh_auto_clean
	# drop arch-overrides, generated in dh_install by dh-exec usage.
	rm -f debian/uuid-runtime.install.$(DEB_HOST_ARCH) \
		debian/util-linux.install.$(DEB_HOST_ARCH)

override_dh_install:
	# generate arch-override, as dh-exec install-rename can only run once.
	[ -f debian/util-linux.install.$(DEB_HOST_ARCH) ] || \
		debian/util-linux.install > \
		debian/util-linux.install.$(DEB_HOST_ARCH)
	[ -f debian/uuid-runtime.install.$(DEB_HOST_ARCH) ] || \
		debian/uuid-runtime.install > \
		debian/uuid-runtime.install.$(DEB_HOST_ARCH)
	#
	install -D -p -m644 debian/fdisk-udeb.lintian-overrides \
		debian/fdisk-udeb/usr/share/lintian/overrides/fdisk-udeb
	dh_install \
		-Nfdisk-udeb -Nlibblkid1-udeb \
		-Nlibfdisk1-udeb -Nlibsmartcols1-udeb -Nlibuuid1-udeb \
		-Nutil-linux-udeb
	dh_install --remaining-packages
	#
	# Install bash-completions only for binaries we ship
	for PACKAGE in util-linux uuid-runtime bsdutils mount; do \
	for BINARY in debian/$$PACKAGE/bin/* debian/$$PACKAGE/sbin/* \
			debian/$$PACKAGE/usr/bin/* \
			debian/$$PACKAGE/usr/sbin/* ; \
	do \
		BASENAME=$$(basename $$BINARY); \
		BCDIR=usr/share/bash-completion/completions/; \
		BCNAME=$$BCDIR/$$BASENAME ; \
		if [ "$$BASENAME" != '*' ] && [ -e "debian/tmp/$$BCNAME" ]; \
		then \
			echo "$$PACKAGE: Installing $$BCNAME"; \
			[ -d debian/$$PACKAGE/$$BCDIR ] || \
				mkdir -p debian/$$PACKAGE/$$BCDIR; \
			mv debian/tmp/$$BCNAME debian/$$PACKAGE/$$BCNAME; \
		fi; \
	done; \
	done
	#
	rm -rf debian/*-udeb/usr/share/doc

override_dh_installman:
	dh_installman --language=C

override_dh_gencontrol:
ifeq ($(filter stage1,$(DEB_BUILD_PROFILES)),)
	dh_gencontrol --package=bsdutils -- -v1:$(DEB_VERSION_UPSTREAM_REVISION)
endif
	dh_gencontrol --remaining-packages

override_dh_installinit:
	# install /etc/init.d/hwclock.sh
	# - update-rc.d manually handled in maintainers scripts as there
	#   is special per-arch considerations.
	dh_installinit --name=hwclock.sh --noscripts
	# install /etc/default/hwclock
	dh_installinit --name=hwclock
	# install uuidd sysvinit script
	make misc-utils/uuidd.rc
	ln -s ../misc-utils/uuidd.rc debian/uuid-runtime.uuidd.init
	dh_installinit --name=uuidd --restart-after-upgrade
	rm -f debian/uuid-runtime.uuidd.init

override_dh_installpam:
	dh_installpam --package=util-linux --name=runuser
	dh_installpam --package=util-linux --name=runuser-l

override_dh_makeshlibs:
	dh_makeshlibs \
		-N libsmartcols1 -N libblkid1 \
		-N libfdisk1 -N libmount1 -N libuuid1
	dh_makeshlibs -plibsmartcols1 -V \
		--add-udeb=libsmartcols1-udeb
	dh_makeshlibs -plibblkid1 -V \
		--add-udeb=libblkid1-udeb
	dh_makeshlibs -plibfdisk1 -V \
		--add-udeb=libfdisk1-udeb
	dh_makeshlibs -plibmount1 -V \
		--add-udeb=libmount1-udeb
	dh_makeshlibs -plibuuid1 -V \
		--add-udeb=libuuid1-udeb

override_dh_fixperms:
	dh_fixperms -i -s -Xusr/bin/wall -Xbin/mount -Xbin/umount

override_dh_auto_test:
ifeq ($(DEB_HOST_ARCH_OS), linux)
	dh_auto_test --max-parallel=1
else
	dh_auto_test --max-parallel=1 || true
endif