Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: sys-fs/lvm2/files/, sys-fs/lvm2/
Date: Tue, 16 Apr 2019 20:43:49
Message-Id: 1555447351.6cb28982a11b0bbd9479ba40e9f9bfd78cd37f54.blueness@gentoo
1 commit: 6cb28982a11b0bbd9479ba40e9f9bfd78cd37f54
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 16 20:42:31 2019 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 16 20:42:31 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=6cb28982
7
8 sys-fs/lvm2: forward port patches to 2.02.184
9
10 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
11 Package-Manager: Portage-2.3.62, Repoman-2.3.11
12
13 sys-fs/lvm2/Manifest | 1 +
14 sys-fs/lvm2/files/lvmpolld.initd-2.02.183 | 17 ++
15 sys-fs/lvm2/lvm2-2.02.184-r1.ebuild | 266 ++++++++++++++++++++++++++++++
16 sys-fs/lvm2/lvm2-2.02.184.ebuild | 262 +++++++++++++++++++++++++++++
17 4 files changed, 546 insertions(+)
18
19 diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
20 index bcbab95..bad5158 100644
21 --- a/sys-fs/lvm2/Manifest
22 +++ b/sys-fs/lvm2/Manifest
23 @@ -1,2 +1,3 @@
24 DIST LVM2.2.02.145.tgz 1986370 BLAKE2B 0c9e5efae17f26ff86152cecbf0b11a74e85007b2fa9491f44dec03ac8c11375bacf6685213b4be19037c8fbf70e13549516716ecf8fa262919a44625e6aab34 SHA512 84e28b3efc940837ea9da70fce620744aea0945ba29383b76ad7bcd4b5259b897c714162a8e8b7cfe26ae736a3ad2eca633a3e0df4d6280a32b28bd4cf472d27
25 DIST LVM2.2.02.183.tgz 2380574 BLAKE2B b1fe71b6cdb8ee20dd53d0ad3399c553487baafa12657ec81a794c84ad161988afdb8693ac247877a2645d693a0740c74c8b991047ed2ba4adc9ec75f1c261a9 SHA512 3947523c6b0862ada40677ed171ed0cf95e070119e377296fc5ccb153e9c4212d34c0b16a887dbd68ccf265525345dabfed2aa59fb3604555429a7e2ecfff4d7
26 +DIST LVM2.2.02.184.tgz 2383698 BLAKE2B b6e308d76d541b9461dfcc6e82db256a175ccdabfae9c9d57d84eabd0d5ea50e3e09954b34741903e027412c2c26f72a5005fe934261576337a810738139deb8 SHA512 9db74f675e7c58f663a39afb79b6f33a33ad2cfbda63e9783ef5027f33977b4a1262a2e6754aa67c586eed083ee119a2e837c32a7746dcc53f13877c9d65c390
27
28 diff --git a/sys-fs/lvm2/files/lvmpolld.initd-2.02.183 b/sys-fs/lvm2/files/lvmpolld.initd-2.02.183
29 new file mode 100644
30 index 0000000..6b26010
31 --- /dev/null
32 +++ b/sys-fs/lvm2/files/lvmpolld.initd-2.02.183
33 @@ -0,0 +1,17 @@
34 +#!/sbin/openrc-run
35 +# Copyright 1999-2019 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +pidfile="/run/lvmpolld.pid"
39 +command="/sbin/lvmpolld"
40 +command_args="${LVMPOLLD_OPTS:=-p ${pidfile}}"
41 +start_stop_daemon_args="--pidfile ${pidfile}"
42 +
43 +depend() {
44 + :
45 +}
46 +
47 +start_pre()
48 +{
49 + checkpath --directory /run/lvm || return 1
50 +}
51
52 diff --git a/sys-fs/lvm2/lvm2-2.02.184-r1.ebuild b/sys-fs/lvm2/lvm2-2.02.184-r1.ebuild
53 new file mode 100644
54 index 0000000..1da43dc
55 --- /dev/null
56 +++ b/sys-fs/lvm2/lvm2-2.02.184-r1.ebuild
57 @@ -0,0 +1,266 @@
58 +# Copyright 1999-2019 Gentoo Authors
59 +# Distributed under the terms of the GNU General Public License v2
60 +
61 +EAPI=6
62 +inherit autotools linux-info multilib systemd toolchain-funcs udev flag-o-matic
63 +
64 +DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
65 +HOMEPAGE="https://sourceware.org/lvm2/"
66 +SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
67 + ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
68 +
69 +LICENSE="GPL-2"
70 +SLOT="0"
71 +KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~x86"
72 +IUSE="readline static static-libs systemd lvm2create_initrd sanlock selinux +udev +thin device-mapper-only"
73 +REQUIRED_USE="device-mapper-only? ( !lvm2create_initrd !sanlock !thin )
74 + systemd? ( udev )"
75 +
76 +DEPEND_COMMON="
77 + dev-libs/libaio[static-libs?]
78 + static? ( dev-libs/libaio[static-libs] )
79 + !static? ( dev-libs/libaio[static-libs?] )
80 + readline? ( sys-libs/readline:0= )
81 + sanlock? ( sys-cluster/sanlock )
82 + systemd? ( >=sys-apps/systemd-205:0= )
83 + udev? ( >=virtual/libudev-208:=[static-libs?] )"
84 +# /run is now required for locking during early boot. /var cannot be assumed to
85 +# be available -- thus, pull in recent enough baselayout for /run.
86 +# This version of LVM is incompatible with cryptsetup <1.1.2.
87 +RDEPEND="${DEPEND_COMMON}
88 + >=sys-apps/baselayout-2.2
89 + !<sys-apps/openrc-0.11
90 + !<sys-fs/cryptsetup-1.1.2
91 + !!sys-fs/lvm-user
92 + >=sys-apps/util-linux-2.16
93 + lvm2create_initrd? ( sys-apps/makedev )
94 + thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
95 +# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
96 +# USE 'static' currently only works with eudev, bug 520450
97 +DEPEND="${DEPEND_COMMON}
98 + virtual/pkgconfig
99 + >=sys-devel/binutils-2.20.1-r1
100 + sys-devel/autoconf-archive
101 + static? (
102 + selinux? ( sys-libs/libselinux[static-libs] )
103 + udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
104 + >=sys-apps/util-linux-2.16[static-libs]
105 + )"
106 +
107 +S=${WORKDIR}/${PN/lvm/LVM}.${PV}
108 +
109 +PATCHES=(
110 + # Gentoo specific modification(s):
111 + "${FILESDIR}"/${PN}-2.02.178-example.conf.in.patch
112 +
113 + # Musl fixes
114 + "${FILESDIR}"/${PN}-2.02.183-fix-stdio-usage.patch
115 + "${FILESDIR}"/${PN}-2.02.183-portability.patch
116 +
117 + # For upstream -- review and forward:
118 + "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
119 + "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
120 + "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
121 + "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
122 + "${FILESDIR}"/${PN}-2.02.178-asneeded.patch # -Wl,--as-needed
123 + "${FILESDIR}"/${PN}-2.02.178-dynamic-static-ldflags.patch #332905
124 + "${FILESDIR}"/${PN}-2.02.178-static-pkgconfig-libs.patch #370217, #439414 + blkid
125 + "${FILESDIR}"/${PN}-2.02.176-pthread-pkgconfig.patch #492450
126 + "${FILESDIR}"/${PN}-2.02.171-static-libm.patch #617756
127 + "${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446
128 + #"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062 # Merged upstream
129 +)
130 +
131 +pkg_setup() {
132 + local CONFIG_CHECK="~SYSVIPC"
133 +
134 + if use udev; then
135 + local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
136 + if linux_config_exists; then
137 + local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
138 + if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
139 + ewarn "It's recommended to set an empty value to the following kernel config option:"
140 + ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
141 + fi
142 + fi
143 + fi
144 +
145 + check_extra_config
146 +
147 + # 1. Genkernel no longer copies /sbin/lvm blindly.
148 + if use static; then
149 + elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
150 + elog "their static versions. If you need the static binaries,"
151 + elog "you must append .static to the filename!"
152 + fi
153 +}
154 +
155 +src_prepare() {
156 + default
157 +
158 + sed -i \
159 + -e "1iAR = $(tc-getAR)" \
160 + -e "s:CC ?= @CC@:CC = $(tc-getCC):" \
161 + make.tmpl.in || die #444082
162 +
163 + sed -i -e '/FLAG/s:-O2::' configure{.ac,} || die #480212
164 +
165 + if use udev && ! use device-mapper-only; then
166 + sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
167 + elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
168 + elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
169 + elog "if it was previously disabled."
170 + fi
171 +
172 + sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
173 +
174 + # Without thin-privision-tools, there is nothing to install for target install_man7:
175 + if ! use thin ; then
176 + sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die
177 + fi
178 +
179 + eautoreconf
180 +}
181 +
182 +src_configure() {
183 + filter-flags -flto
184 + local myeconfargs=()
185 +
186 + # Most of this package does weird stuff.
187 + # The build options are tristate, and --without is NOT supported
188 + # options: 'none', 'internal', 'shared'
189 + myeconfargs+=(
190 + $(use_enable !device-mapper-only dmfilemapd)
191 + $(use_enable !device-mapper-only dmeventd)
192 + $(use_enable !device-mapper-only cmdlib)
193 + $(use_enable !device-mapper-only applib)
194 + $(use_enable !device-mapper-only fsadm)
195 + $(use_enable !device-mapper-only lvmetad)
196 + $(use_enable !device-mapper-only lvmpolld)
197 + $(usex device-mapper-only --disable-udev-systemd-background-jobs '')
198 +
199 + # This only causes the .static versions to become available
200 + $(usex static --enable-static_link '')
201 +
202 + # dmeventd requires mirrors to be internal, and snapshot available
203 + # so we cannot disable them
204 + --with-mirrors="$(usex device-mapper-only none internal)"
205 + --with-snapshots="$(usex device-mapper-only none internal)"
206 +
207 + # disable O_DIRECT support on hppa, breaks pv detection (#99532)
208 + $(usex hppa --disable-o_direct '')
209 + )
210 +
211 + if use thin; then
212 + myeconfargs+=( --with-thin=internal --with-cache=internal )
213 + local texec
214 + for texec in check dump repair restore; do
215 + myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
216 + myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
217 + done
218 + else
219 + myeconfargs+=( --with-thin=none --with-cache=none )
220 + fi
221 +
222 + myeconfargs+=( --with-clvmd=none --with-cluster=none )
223 +
224 + myeconfargs+=(
225 + $(use_enable readline)
226 + $(use_enable selinux)
227 + --enable-pkgconfig
228 + --with-confdir="${EPREFIX}"/etc
229 + --exec-prefix="${EPREFIX}"
230 + --sbindir="${EPREFIX}/sbin"
231 + --with-staticdir="${EPREFIX}"/sbin
232 + --libdir="${EPREFIX}/$(get_libdir)"
233 + --with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
234 + --with-default-dm-run-dir=/run
235 + --with-default-run-dir=/run/lvm
236 + --with-default-locking-dir=/run/lock/lvm
237 + --with-default-pid-dir=/run
238 + $(use_enable udev udev_rules)
239 + $(use_enable udev udev_sync)
240 + $(use_with udev udevdir "$(get_udevdir)"/rules.d)
241 + $(use_enable sanlock lvmlockd-sanlock)
242 + $(use_enable systemd udev-systemd-background-jobs)
243 + $(use_enable systemd notify-dbus)
244 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
245 + CLDFLAGS="${LDFLAGS}"
246 + )
247 + econf "${myeconfargs[@]}"
248 +}
249 +
250 +src_compile() {
251 + pushd include >/dev/null
252 + emake
253 + popd >/dev/null
254 +
255 + if use device-mapper-only ; then
256 + emake device-mapper
257 + else
258 + emake
259 + emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
260 + fi
261 +}
262 +
263 +src_install() {
264 + local inst INSTALL_TARGETS
265 + INSTALL_TARGETS=( install install_tmpfiles_configuration )
266 + # install systemd related files only when requested, bug #522430
267 + use systemd && INSTALL_TARGETS+=( install_systemd_units install_systemd_generators )
268 + use device-mapper-only && INSTALL_TARGETS=( install_device-mapper )
269 + for inst in ${INSTALL_TARGETS[@]}; do
270 + emake DESTDIR="${D}" ${inst}
271 + done
272 +
273 + newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
274 + newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
275 +
276 + if use !device-mapper-only ; then
277 + newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
278 + newinitd "${FILESDIR}"/lvm.rc-2.02.172 lvm
279 + newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
280 +
281 + newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
282 + newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
283 + newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
284 + fi
285 +
286 + if use sanlock; then
287 + newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
288 + fi
289 +
290 + if use static-libs; then
291 + dolib.a libdm/ioctl/libdevmapper.a
292 + dolib.a libdaemon/client/libdaemonclient.a #462908
293 + #gen_usr_ldscript libdevmapper.so
294 + dolib.a daemons/dmeventd/libdevmapper-event.a
295 + #gen_usr_ldscript libdevmapper-event.so
296 + else
297 + rm -f "${ED%/}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
298 + fi
299 +
300 + if use lvm2create_initrd; then
301 + dosbin scripts/lvm2create_initrd/lvm2create_initrd
302 + doman scripts/lvm2create_initrd/lvm2create_initrd.8
303 + newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
304 + fi
305 +
306 + insinto /etc
307 + doins "${FILESDIR}"/dmtab
308 +
309 + dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
310 +}
311 +
312 +pkg_postinst() {
313 + ewarn "Make sure the \"lvm\" init script is in the runlevels:"
314 + ewarn "# rc-update add lvm boot"
315 + ewarn
316 + ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
317 + ewarn "to enable lvm autoactivation and metadata caching."
318 +}
319 +
320 +src_test() {
321 + einfo "Tests are disabled because of device-node mucking, if you want to"
322 + einfo "run tests, compile the package and see ${S}/tests"
323 +}
324
325 diff --git a/sys-fs/lvm2/lvm2-2.02.184.ebuild b/sys-fs/lvm2/lvm2-2.02.184.ebuild
326 new file mode 100644
327 index 0000000..87f9ac2
328 --- /dev/null
329 +++ b/sys-fs/lvm2/lvm2-2.02.184.ebuild
330 @@ -0,0 +1,262 @@
331 +# Copyright 1999-2019 Gentoo Authors
332 +# Distributed under the terms of the GNU General Public License v2
333 +
334 +EAPI=6
335 +inherit autotools linux-info multilib systemd toolchain-funcs udev flag-o-matic
336 +
337 +DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
338 +HOMEPAGE="https://sourceware.org/lvm2/"
339 +SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
340 + ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
341 +
342 +LICENSE="GPL-2"
343 +SLOT="0"
344 +KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~x86"
345 +IUSE="readline static static-libs systemd lvm2create_initrd sanlock selinux +udev +thin device-mapper-only"
346 +REQUIRED_USE="device-mapper-only? ( !lvm2create_initrd !sanlock !thin )
347 + systemd? ( udev )"
348 +
349 +DEPEND_COMMON="
350 + dev-libs/libaio[static-libs?]
351 + static? ( dev-libs/libaio[static-libs] )
352 + !static? ( dev-libs/libaio[static-libs?] )
353 + readline? ( sys-libs/readline:0= )
354 + sanlock? ( sys-cluster/sanlock )
355 + systemd? ( >=sys-apps/systemd-205:0= )
356 + udev? ( >=virtual/libudev-208:=[static-libs?] )"
357 +# /run is now required for locking during early boot. /var cannot be assumed to
358 +# be available -- thus, pull in recent enough baselayout for /run.
359 +# This version of LVM is incompatible with cryptsetup <1.1.2.
360 +RDEPEND="${DEPEND_COMMON}
361 + >=sys-apps/baselayout-2.2
362 + !<sys-apps/openrc-0.11
363 + !<sys-fs/cryptsetup-1.1.2
364 + !!sys-fs/lvm-user
365 + >=sys-apps/util-linux-2.16
366 + lvm2create_initrd? ( sys-apps/makedev )
367 + thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
368 +# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
369 +# USE 'static' currently only works with eudev, bug 520450
370 +DEPEND="${DEPEND_COMMON}
371 + virtual/pkgconfig
372 + >=sys-devel/binutils-2.20.1-r1
373 + sys-devel/autoconf-archive
374 + static? (
375 + selinux? ( sys-libs/libselinux[static-libs] )
376 + udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
377 + >=sys-apps/util-linux-2.16[static-libs]
378 + )"
379 +
380 +S=${WORKDIR}/${PN/lvm/LVM}.${PV}
381 +
382 +PATCHES=(
383 + # Gentoo specific modification(s):
384 + "${FILESDIR}"/${PN}-2.02.178-example.conf.in.patch
385 +
386 + # Musl fixes
387 + "${FILESDIR}"/${PN}-2.02.183-fix-stdio-usage.patch
388 + "${FILESDIR}"/${PN}-2.02.183-portability.patch
389 +
390 + # For upstream -- review and forward:
391 + "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
392 + "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
393 + "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
394 + "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
395 + "${FILESDIR}"/${PN}-2.02.178-asneeded.patch # -Wl,--as-needed
396 + "${FILESDIR}"/${PN}-2.02.178-dynamic-static-ldflags.patch #332905
397 + "${FILESDIR}"/${PN}-2.02.178-static-pkgconfig-libs.patch #370217, #439414 + blkid
398 + "${FILESDIR}"/${PN}-2.02.176-pthread-pkgconfig.patch #492450
399 + "${FILESDIR}"/${PN}-2.02.171-static-libm.patch #617756
400 + "${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446
401 + #"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062 # Merged upstream
402 +)
403 +
404 +pkg_setup() {
405 + local CONFIG_CHECK="~SYSVIPC"
406 +
407 + if use udev; then
408 + local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
409 + if linux_config_exists; then
410 + local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
411 + if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
412 + ewarn "It's recommended to set an empty value to the following kernel config option:"
413 + ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
414 + fi
415 + fi
416 + fi
417 +
418 + check_extra_config
419 +
420 + # 1. Genkernel no longer copies /sbin/lvm blindly.
421 + if use static; then
422 + elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
423 + elog "their static versions. If you need the static binaries,"
424 + elog "you must append .static to the filename!"
425 + fi
426 +}
427 +
428 +src_prepare() {
429 + default
430 +
431 + sed -i \
432 + -e "1iAR = $(tc-getAR)" \
433 + -e "s:CC ?= @CC@:CC = $(tc-getCC):" \
434 + make.tmpl.in || die #444082
435 +
436 + sed -i -e '/FLAG/s:-O2::' configure{.ac,} || die #480212
437 +
438 + if use udev && ! use device-mapper-only; then
439 + sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
440 + elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
441 + elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
442 + elog "if it was previously disabled."
443 + fi
444 +
445 + sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
446 +
447 + # Without thin-privision-tools, there is nothing to install for target install_man7:
448 + if ! use thin ; then
449 + sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die
450 + fi
451 +
452 + eautoreconf
453 +}
454 +
455 +src_configure() {
456 + filter-flags -flto
457 + local myeconfargs=()
458 +
459 + # Most of this package does weird stuff.
460 + # The build options are tristate, and --without is NOT supported
461 + # options: 'none', 'internal', 'shared'
462 + myeconfargs+=(
463 + $(use_enable !device-mapper-only dmeventd)
464 + $(use_enable !device-mapper-only cmdlib)
465 + $(use_enable !device-mapper-only applib)
466 + $(use_enable !device-mapper-only fsadm)
467 + $(use_enable !device-mapper-only lvmetad)
468 + $(usex device-mapper-only --disable-udev-systemd-background-jobs '')
469 +
470 + # This only causes the .static versions to become available
471 + $(usex static --enable-static_link '')
472 +
473 + # dmeventd requires mirrors to be internal, and snapshot available
474 + # so we cannot disable them
475 + --with-mirrors="$(usex device-mapper-only none internal)"
476 + --with-snapshots="$(usex device-mapper-only none internal)"
477 +
478 + # disable O_DIRECT support on hppa, breaks pv detection (#99532)
479 + $(usex hppa --disable-o_direct '')
480 + )
481 +
482 + if use thin; then
483 + myeconfargs+=( --with-thin=internal --with-cache=internal )
484 + local texec
485 + for texec in check dump repair restore; do
486 + myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
487 + myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
488 + done
489 + else
490 + myeconfargs+=( --with-thin=none --with-cache=none )
491 + fi
492 +
493 + myeconfargs+=( --with-clvmd=none --with-cluster=none )
494 +
495 + myeconfargs+=(
496 + $(use_enable readline)
497 + $(use_enable selinux)
498 + --enable-pkgconfig
499 + --with-confdir="${EPREFIX}"/etc
500 + --exec-prefix="${EPREFIX}"
501 + --sbindir="${EPREFIX}/sbin"
502 + --with-staticdir="${EPREFIX}"/sbin
503 + --libdir="${EPREFIX}/$(get_libdir)"
504 + --with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
505 + --with-default-dm-run-dir=/run
506 + --with-default-run-dir=/run/lvm
507 + --with-default-locking-dir=/run/lock/lvm
508 + --with-default-pid-dir=/run
509 + $(use_enable udev udev_rules)
510 + $(use_enable udev udev_sync)
511 + $(use_with udev udevdir "$(get_udevdir)"/rules.d)
512 + $(use_enable sanlock lvmlockd-sanlock)
513 + $(use_enable systemd udev-systemd-background-jobs)
514 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
515 + CLDFLAGS="${LDFLAGS}"
516 + )
517 + econf "${myeconfargs[@]}"
518 +}
519 +
520 +src_compile() {
521 + pushd include >/dev/null
522 + emake
523 + popd >/dev/null
524 +
525 + if use device-mapper-only ; then
526 + emake device-mapper
527 + else
528 + emake
529 + emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
530 + fi
531 +}
532 +
533 +src_install() {
534 + local inst INSTALL_TARGETS
535 + INSTALL_TARGETS=( install install_tmpfiles_configuration )
536 + # install systemd related files only when requested, bug #522430
537 + use systemd && INSTALL_TARGETS+=( install_systemd_units install_systemd_generators )
538 + use device-mapper-only && INSTALL_TARGETS=( install_device-mapper )
539 + for inst in ${INSTALL_TARGETS[@]}; do
540 + emake DESTDIR="${D}" ${inst}
541 + done
542 +
543 + newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
544 + newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
545 +
546 + if use !device-mapper-only ; then
547 + newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
548 + newinitd "${FILESDIR}"/lvm.rc-2.02.172 lvm
549 + newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
550 +
551 + newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
552 + newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
553 + fi
554 +
555 + if use sanlock; then
556 + newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
557 + fi
558 +
559 + if use static-libs; then
560 + dolib.a libdm/ioctl/libdevmapper.a
561 + dolib.a libdaemon/client/libdaemonclient.a #462908
562 + #gen_usr_ldscript libdevmapper.so
563 + dolib.a daemons/dmeventd/libdevmapper-event.a
564 + #gen_usr_ldscript libdevmapper-event.so
565 + else
566 + rm -f "${ED%/}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
567 + fi
568 +
569 + if use lvm2create_initrd; then
570 + dosbin scripts/lvm2create_initrd/lvm2create_initrd
571 + doman scripts/lvm2create_initrd/lvm2create_initrd.8
572 + newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
573 + fi
574 +
575 + insinto /etc
576 + doins "${FILESDIR}"/dmtab
577 +
578 + dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
579 +}
580 +
581 +pkg_postinst() {
582 + ewarn "Make sure the \"lvm\" init script is in the runlevels:"
583 + ewarn "# rc-update add lvm boot"
584 + ewarn
585 + ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
586 + ewarn "to enable lvm autoactivation and metadata caching."
587 +}
588 +
589 +src_test() {
590 + einfo "Tests are disabled because of device-node mucking, if you want to"
591 + einfo "run tests, compile the package and see ${S}/tests"
592 +}