Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/files/, sys-fs/lvm2/
Date: Sat, 04 Aug 2018 22:13:24
Message-Id: 1533420646.8824d7cd4c9edd30b727559ecc5fb0e8d985b7dd.robbat2@gentoo
1 commit: 8824d7cd4c9edd30b727559ecc5fb0e8d985b7dd
2 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 4 21:45:48 2018 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 4 22:10:46 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8824d7cd
7
8 sys-fs/lvm2: bump to 2.02.181
9
10 Fixes: https://bugs.gentoo.org/631016
11 Fixes: https://bugs.gentoo.org/662650
12 Package-Manager: Portage-2.3.40, Repoman-2.3.9
13 Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
14
15 sys-fs/lvm2/Manifest | 1 +
16 .../files/lvm2-2.02.176-pthread-pkgconfig.patch | 29 ++
17 sys-fs/lvm2/files/lvm2-2.02.178-asneeded.patch | 15 ++
18 .../lvm2-2.02.178-dynamic-static-ldflags.patch | 59 ++++
19 .../lvm2/files/lvm2-2.02.178-example.conf.in.patch | 50 ++++
20 .../lvm2-2.02.178-static-pkgconfig-libs.patch | 102 +++++++
21 sys-fs/lvm2/lvm2-2.02.181.ebuild | 299 +++++++++++++++++++++
22 7 files changed, 555 insertions(+)
23
24 diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
25 index bec7881f969..c7ab460dfd3 100644
26 --- a/sys-fs/lvm2/Manifest
27 +++ b/sys-fs/lvm2/Manifest
28 @@ -6,3 +6,4 @@ DIST LVM2.2.02.166.tgz 2148324 BLAKE2B a57ad21b1f31a6e78c56e4cf77e0d6fd99262c95a
29 DIST LVM2.2.02.171.tgz 2333643 BLAKE2B 169155354ba1de7f97a4f9e9156f3f7ba8553a2313883152371637986e8c3355906831368cd2e2c8c30d85045865c24667dc624fdbd36ae6a632a1a678c5cd23 SHA512 801adcc2ae483f81edf6bfba73090b6b8f710370e48764f08a62da71d617157075bea01593c2535ad5ba71dcb5e0cfe83cec9a65180a6e8b9e0d214bdee79883
30 DIST LVM2.2.02.172.tgz 2351684 BLAKE2B d303bceab0f30ac726563cbf6491439b0528223c1cb0351aff348b08502912b53b6df449b261ead011c3c40c63603840bfcbc8432f79d047733b7da673ff2b76 SHA512 402612667f279be5f1c682b9037022788e9b76e3157907a0832e8b7847c3aa96e4b44a3bd880657a7e577ab46db0e4f283ac6edbb52502e365617633c802ae40
31 DIST LVM2.2.02.173.tgz 2363504 BLAKE2B a516bc9b68b7b7529f4436d8849ca741eb3ca1b5ac2eb2fb2915507935bdd28b5e234e74c1bce827e5761f57b5936510d08107e0dc1c320190f952c706f128d3 SHA512 c2ea8beafe006abf9282f51ec98600fd0ebff816d53c10ecbb19bbf336ada4825135cf9c92ccd364afb18f8b1d7e163eff5bdec8dfdd70dfb9ba45db2f6bdd5e
32 +DIST LVM2.2.02.181.tgz 2375093 BLAKE2B 4e4e7c65511af5902e765254a4316a9f887a6ec5c079333d78f19bff71ed3ed9d0e2e2367b0bb5e619ec6778adc9ddf944156921cec67af4d73aafc08196b73e SHA512 599d992823510e27f3ec3ceaf0d2332402b731afc0d2df88096ab55ed98dba8c3bdc5408d51b9f5b0ffbbb9ac3760ee37b878a0f36ab379449dc076c58e59511
33
34 diff --git a/sys-fs/lvm2/files/lvm2-2.02.176-pthread-pkgconfig.patch b/sys-fs/lvm2/files/lvm2-2.02.176-pthread-pkgconfig.patch
35 new file mode 100644
36 index 00000000000..c0265e81268
37 --- /dev/null
38 +++ b/sys-fs/lvm2/files/lvm2-2.02.176-pthread-pkgconfig.patch
39 @@ -0,0 +1,29 @@
40 +--- LVM2.2.02.176/libdm/libdevmapper.pc.in
41 ++++ LVM2.2.02.176/libdm/libdevmapper.pc.in
42 +@@ -9,4 +9,4 @@
43 + Cflags: -I${includedir}
44 + Libs: -L${libdir} -ldevmapper
45 + Requires.private: @SELINUX_PC@ @UDEV_PC@
46 +-Libs.private: -lm @RT_LIBS@
47 ++Libs.private: -lm @RT_LIBS@ @PTHREAD_LIBS@
48 +--- LVM2.2.02.176/tools/Makefile.in
49 ++++ LVM2.2.02.176/tools/Makefile.in
50 +@@ -93,6 +93,7 @@
51 + INSTALL_LVM_TARGETS += install_tools_static
52 + INSTALL_DMSETUP_TARGETS += install_dmsetup_static
53 + INSTALL_CMDLIB_TARGETS += install_cmdlib_static
54 ++ STATIC_LIBS += @PTHREAD_LIBS@
55 + endif
56 +
57 + LVMLIBS = $(LVMINTERNAL_LIBS) -ldevmapper
58 +@@ -118,6 +119,10 @@
59 +
60 + include $(top_builddir)/make.tmpl
61 +
62 ++ifeq ("@STATIC_LINK@", "yes")
63 ++ STATIC_LIBS += @PTHREAD_LIBS@
64 ++endif
65 ++
66 + device-mapper: $(TARGETS_DM)
67 +
68 + CFLAGS_dmsetup.o += $(UDEV_CFLAGS) $(EXTRA_EXEC_CFLAGS)
69
70 diff --git a/sys-fs/lvm2/files/lvm2-2.02.178-asneeded.patch b/sys-fs/lvm2/files/lvm2-2.02.178-asneeded.patch
71 new file mode 100644
72 index 00000000000..c831c6d6e60
73 --- /dev/null
74 +++ b/sys-fs/lvm2/files/lvm2-2.02.178-asneeded.patch
75 @@ -0,0 +1,15 @@
76 +http://bugs.gentoo.org/330255
77 +
78 +liblvm2app.so: undefined reference to `floor'
79 +
80 +--- LVM2.2.02.178/liblvm/Makefile.in
81 ++++ LVM2.2.02.178/liblvm/Makefile.in
82 +@@ -43,7 +43,7 @@
83 + include $(top_builddir)/make.tmpl
84 +
85 + LDFLAGS += -L$(top_builddir)/lib -L$(top_builddir)/daemons/dmeventd
86 +-LIBS += $(LVMINTERNAL_LIBS) -ldevmapper -laio
87 ++LIBS += $(LVMINTERNAL_LIBS) -ldevmapper -laio -lm
88 +
89 + .PHONY: install_dynamic install_static install_include install_pkgconfig
90 +
91
92 diff --git a/sys-fs/lvm2/files/lvm2-2.02.178-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.02.178-dynamic-static-ldflags.patch
93 new file mode 100644
94 index 00000000000..0a0e7320906
95 --- /dev/null
96 +++ b/sys-fs/lvm2/files/lvm2-2.02.178-dynamic-static-ldflags.patch
97 @@ -0,0 +1,59 @@
98 +--- LVM2.2.02.178/configure.ac
99 ++++ LVM2.2.02.178/configure.ac
100 +@@ -33,6 +33,7 @@
101 + CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
102 + # equivalent to -rdynamic
103 + ELDFLAGS="-Wl,--export-dynamic"
104 ++ STATIC_LDFLAGS="-Wl,--no-export-dynamic"
105 + # FIXME Generate list and use --dynamic-list=.dlopen.sym
106 + CLDWHOLEARCHIVE="-Wl,-whole-archive"
107 + CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
108 +@@ -2042,6 +2043,7 @@
109 + AC_SUBST(SYSTEMD_LIBS)
110 + AC_SUBST(SNAPSHOTS)
111 + AC_SUBST(STATICDIR)
112 ++AC_SUBST(STATIC_LDFLAGS)
113 + AC_SUBST(STATIC_LINK)
114 + AC_SUBST(TESTSUITE_DATA)
115 + AC_SUBST(THIN)
116 +--- LVM2.2.02.178/daemons/dmeventd/Makefile.in
117 ++++ LVM2.2.02.178/daemons/dmeventd/Makefile.in
118 +@@ -64,7 +64,7 @@
119 + -o $@ $(DL_LIBS) $(DMEVENT_LIBS) $(LIBS)
120 +
121 + dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a
122 +- $(CC) $(CFLAGS) $(LDFLAGS) -static -L. -L$(interfacebuilddir) dmeventd.o \
123 ++ $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L. -L$(interfacebuilddir) dmeventd.o \
124 + -o $@ $(DL_LIBS) $(DMEVENT_LIBS) $(LIBS) $(STATIC_LIBS)
125 +
126 + ifeq ("@PKGCONFIG@", "yes")
127 +--- LVM2.2.02.178/make.tmpl.in
128 ++++ LVM2.2.02.178/make.tmpl.in
129 +@@ -64,6 +64,7 @@
130 + # FIXME set this only where it's needed, not globally?
131 + CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
132 + LDFLAGS ?= @LDFLAGS@
133 ++STATIC_LDFLAGS += @STATIC_LDFLAGS@
134 + CLDFLAGS += @CLDFLAGS@
135 + ELDFLAGS += @ELDFLAGS@
136 + LDDEPS += @LDDEPS@
137 +--- LVM2.2.02.178/tools/Makefile.in
138 ++++ LVM2.2.02.178/tools/Makefile.in
139 +@@ -129,7 +129,7 @@
140 +
141 + dmsetup.static: dmsetup.o $(interfacebuilddir)/libdevmapper.a
142 + @echo " [CC] $@"
143 +- $(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
144 ++ $(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
145 + -o $@ dmsetup.o -ldevmapper $(M_LIBS) $(PTHREAD_LIBS) $(STATIC_LIBS) $(LIBS)
146 +
147 + all: device-mapper
148 +@@ -159,7 +159,7 @@
149 +
150 + lvm.static: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a $(interfacebuilddir)/libdevmapper.a
151 + @echo " [CC] $@"
152 +- $(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
153 ++ $(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
154 + $(OBJECTS) lvm-static.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS)
155 +
156 + liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o
157
158 diff --git a/sys-fs/lvm2/files/lvm2-2.02.178-example.conf.in.patch b/sys-fs/lvm2/files/lvm2-2.02.178-example.conf.in.patch
159 new file mode 100644
160 index 00000000000..34c710d4392
161 --- /dev/null
162 +++ b/sys-fs/lvm2/files/lvm2-2.02.178-example.conf.in.patch
163 @@ -0,0 +1,50 @@
164 +--- LVM2.2.02.178/conf/example.conf.in
165 ++++ LVM2.2.02.178/conf/example.conf.in
166 +@@ -128,6 +128,9 @@
167 + # Example
168 + # Accept every block device:
169 + # filter = [ "a|.*/|" ]
170 ++ # Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
171 ++ # noise when you probed while not available.
172 ++ filter = [ "r|/dev/nbd.*|", "a/.*/" ]
173 + # Reject the cdrom drive:
174 + # filter = [ "r|/dev/cdrom|" ]
175 + # Work with just loopback devices, e.g. for testing:
176 +@@ -704,7 +707,8 @@
177 + # Configuration option global/fallback_to_lvm1.
178 + # This setting is no longer used.
179 + # This configuration option has an automatic default value.
180 +- # fallback_to_lvm1 = 0
181 ++ # Gentoo: the LVM tools are a seperate package.
182 ++ fallback_to_lvm1 = 0
183 +
184 + # Configuration option global/format.
185 + # This setting is no longer used.
186 +@@ -1508,7 +1512,7 @@
187 +
188 + # Configuration section metadata.
189 + # This configuration section has an automatic default value.
190 +-# metadata {
191 ++metadata {
192 +
193 + # Configuration option metadata/check_pv_device_sizes.
194 + # Check device sizes are not smaller than corresponding PV sizes.
195 +@@ -1553,7 +1557,8 @@
196 + #
197 + # This configuration option is advanced.
198 + # This configuration option has an automatic default value.
199 +- # pvmetadatacopies = 1
200 ++ # Gentoo: enable for data safety, but PV resize is then disabled.
201 ++ # pvmetadatacopies = 2
202 +
203 + # Configuration option metadata/vgmetadatacopies.
204 + # Number of copies of metadata to maintain for each VG.
205 +@@ -1608,7 +1613,7 @@
206 + #
207 + # This configuration option is advanced.
208 + # This configuration option does not have a default value defined.
209 +-# }
210 ++}
211 +
212 + # Configuration section report.
213 + # LVM report command output formatting.
214
215 diff --git a/sys-fs/lvm2/files/lvm2-2.02.178-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.02.178-static-pkgconfig-libs.patch
216 new file mode 100644
217 index 00000000000..989b3082576
218 --- /dev/null
219 +++ b/sys-fs/lvm2/files/lvm2-2.02.178-static-pkgconfig-libs.patch
220 @@ -0,0 +1,102 @@
221 +--- LVM2.2.02.178/configure.ac
222 ++++ LVM2.2.02.178/configure.ac
223 +@@ -1238,6 +1238,7 @@
224 + PKG_CHECK_MODULES(BLKID, blkid >= 2.24,
225 + [ BLKID_WIPING=yes
226 + BLKID_PC="blkid"
227 ++ BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
228 + DEFAULT_USE_BLKID_WIPING=1
229 + AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
230 + ], [if test "$BLKID_WIPING" = maybe; then
231 +@@ -1286,6 +1287,7 @@
232 + if test "$UDEV_SYNC" = yes; then
233 + pkg_config_init
234 + PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
235 ++ UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
236 + AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
237 +
238 + AC_CHECK_LIB(udev, udev_device_get_is_initialized, AC_DEFINE([HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED], 1,
239 +@@ -1564,19 +1566,32 @@
240 + if test "$SELINUX" = yes; then
241 + AC_CHECK_LIB([sepol], [sepol_check_context], [
242 + AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
243 +- SELINUX_LIBS="-lsepol"])
244 ++ SEPOL_LIBS="-lsepol"])
245 ++
246 ++ dnl -- init pkgconfig if required
247 ++ if test x$PKGCONFIG_INIT != x1; then
248 ++ pkg_config_init
249 ++ fi
250 ++ PKG_CHECK_MODULES(SELINUX, libselinux, [
251 ++ SELINUX_PC="libselinux"
252 ++ SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
253 ++ SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
254 ++ AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
255 ++ ],[
256 ++ dnl -- old non-pkgconfig method, is buggy with static builds
257 +
258 + AC_CHECK_LIB([selinux], [is_selinux_enabled], [
259 + AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
260 + AC_CHECK_HEADERS([selinux/label.h])
261 + AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
262 +- SELINUX_LIBS="-lselinux $SELINUX_LIBS"
263 ++ SELINUX_LIBS="-lselinux $SEPOL_LIBS"
264 + SELINUX_PC="libselinux"
265 + HAVE_SELINUX=yes ], [
266 + AC_MSG_WARN(Disabling selinux)
267 + SELINUX_LIBS=
268 + SELINUX_PC=
269 + HAVE_SELINUX=no ])
270 ++ ])
271 + fi
272 +
273 + ################################################################################
274 +@@ -1927,6 +1942,7 @@
275 + ################################################################################
276 + AC_SUBST(APPLIB)
277 + AC_SUBST(AWK)
278 ++AC_SUBST(BLKID_STATIC_LIBS)
279 + AC_SUBST(BLKID_PC)
280 + AC_SUBST(BUILD_CMIRRORD)
281 + AC_SUBST(BUILD_DMEVENTD)
282 +@@ -2037,6 +2053,7 @@
283 + AC_SUBST(SALCK_LIBS)
284 + AC_SUBST(SBINDIR)
285 + AC_SUBST(SELINUX_LIBS)
286 ++AC_SUBST(SELINUX_STATIC_LIBS)
287 + AC_SUBST(SELINUX_PC)
288 + AC_SUBST(SYSCONFDIR)
289 + AC_SUBST(SYSTEMD_LIBS)
290 +@@ -2053,6 +2070,7 @@
291 + AC_SUBST(CACHE_DUMP_CMD)
292 + AC_SUBST(CACHE_REPAIR_CMD)
293 + AC_SUBST(CACHE_RESTORE_CMD)
294 ++AC_SUBST(UDEV_STATIC_LIBS)
295 + AC_SUBST(UDEV_PC)
296 + AC_SUBST(UDEV_RULES)
297 + AC_SUBST(UDEV_SYNC)
298 +--- LVM2.2.02.178/make.tmpl.in
299 ++++ LVM2.2.02.178/make.tmpl.in
300 +@@ -59,7 +59,7 @@
301 +
302 + LIBS = @LIBS@
303 + # Extra libraries always linked with static binaries
304 +-STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS)
305 ++STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
306 + DEFS += @DEFS@
307 + # FIXME set this only where it's needed, not globally?
308 + CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
309 +@@ -75,10 +75,13 @@
310 + PTHREAD_LIBS = @PTHREAD_LIBS@
311 + READLINE_LIBS = @READLINE_LIBS@
312 + SELINUX_LIBS = @SELINUX_LIBS@
313 ++SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
314 + UDEV_CFLAGS = @UDEV_CFLAGS@
315 + UDEV_LIBS = @UDEV_LIBS@
316 ++UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
317 + BLKID_CFLAGS = @BLKID_CFLAGS@
318 + BLKID_LIBS = @BLKID_LIBS@
319 ++BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
320 + SYSTEMD_LIBS = @SYSTEMD_LIBS@
321 + VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
322 +
323
324 diff --git a/sys-fs/lvm2/lvm2-2.02.181.ebuild b/sys-fs/lvm2/lvm2-2.02.181.ebuild
325 new file mode 100644
326 index 00000000000..1363c1d32cf
327 --- /dev/null
328 +++ b/sys-fs/lvm2/lvm2-2.02.181.ebuild
329 @@ -0,0 +1,299 @@
330 +# Copyright 1999-2018 Gentoo Foundation
331 +# Distributed under the terms of the GNU General Public License v2
332 +
333 +EAPI=6
334 +inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
335 +
336 +DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
337 +HOMEPAGE="https://sourceware.org/lvm2/"
338 +SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
339 + ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
340 +
341 +LICENSE="GPL-2"
342 +SLOT="0"
343 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
344 +IUSE="readline static static-libs systemd clvm cman corosync lvm1 lvm2create_initrd openais sanlock selinux +udev +thin device-mapper-only"
345 +REQUIRED_USE="device-mapper-only? ( !clvm !cman !corosync !lvm1 !lvm2create_initrd !openais !sanlock !thin )
346 + systemd? ( udev )
347 + clvm? ( !systemd )"
348 +
349 +DEPEND_COMMON="
350 + clvm? (
351 + cman? ( =sys-cluster/cman-3* )
352 + corosync? ( sys-cluster/corosync )
353 + openais? ( sys-cluster/openais )
354 + =sys-cluster/libdlm-3*
355 + )
356 +
357 + readline? ( sys-libs/readline:0= )
358 + sanlock? ( sys-cluster/sanlock )
359 + systemd? ( >=sys-apps/systemd-205:0= )
360 + udev? ( >=virtual/libudev-208:=[static-libs?] )"
361 +# /run is now required for locking during early boot. /var cannot be assumed to
362 +# be available -- thus, pull in recent enough baselayout for /run.
363 +# This version of LVM is incompatible with cryptsetup <1.1.2.
364 +RDEPEND="${DEPEND_COMMON}
365 + >=sys-apps/baselayout-2.2
366 + !<sys-apps/openrc-0.11
367 + !<sys-fs/cryptsetup-1.1.2
368 + !!sys-fs/clvm
369 + !!sys-fs/lvm-user
370 + >=sys-apps/util-linux-2.16
371 + lvm2create_initrd? ( sys-apps/makedev )
372 + thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
373 +# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
374 +# USE 'static' currently only works with eudev, bug 520450
375 +DEPEND="${DEPEND_COMMON}
376 + virtual/pkgconfig
377 + >=sys-devel/binutils-2.20.1-r1
378 + sys-devel/autoconf-archive
379 + static? (
380 + selinux? ( sys-libs/libselinux[static-libs] )
381 + udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
382 + >=sys-apps/util-linux-2.16[static-libs]
383 + )"
384 +
385 +S=${WORKDIR}/${PN/lvm/LVM}.${PV}
386 +
387 +PATCHES=(
388 + # Gentoo specific modification(s):
389 + "${FILESDIR}"/${PN}-2.02.178-example.conf.in.patch
390 +
391 + # For upstream -- review and forward:
392 + "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
393 + "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
394 + "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
395 + "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
396 + "${FILESDIR}"/${PN}-2.02.178-asneeded.patch # -Wl,--as-needed
397 + "${FILESDIR}"/${PN}-2.02.178-dynamic-static-ldflags.patch #332905
398 + "${FILESDIR}"/${PN}-2.02.178-static-pkgconfig-libs.patch #370217, #439414 + blkid
399 + "${FILESDIR}"/${PN}-2.02.176-pthread-pkgconfig.patch #492450
400 + "${FILESDIR}"/${PN}-2.02.171-static-libm.patch #617756
401 + "${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446
402 + #"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062 # Merged upstream
403 +)
404 +
405 +pkg_setup() {
406 + local CONFIG_CHECK="~SYSVIPC"
407 +
408 + if use udev; then
409 + local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
410 + if linux_config_exists; then
411 + local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
412 + if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
413 + ewarn "It's recommended to set an empty value to the following kernel config option:"
414 + ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
415 + fi
416 + fi
417 + fi
418 +
419 + check_extra_config
420 +
421 + # 1. Genkernel no longer copies /sbin/lvm blindly.
422 + if use static; then
423 + elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
424 + elog "their static versions. If you need the static binaries,"
425 + elog "you must append .static to the filename!"
426 + fi
427 +}
428 +
429 +src_prepare() {
430 + default
431 +
432 + sed -i \
433 + -e "1iAR = $(tc-getAR)" \
434 + -e "s:CC ?= @CC@:CC = $(tc-getCC):" \
435 + make.tmpl.in || die #444082
436 +
437 + sed -i -e '/FLAG/s:-O2::' configure{.ac,} || die #480212
438 +
439 + if use udev && ! use device-mapper-only; then
440 + sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
441 + elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
442 + elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
443 + elog "if it was previously disabled."
444 + fi
445 +
446 + sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
447 +
448 + # Without thin-privision-tools, there is nothing to install for target install_man7:
449 + use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
450 +
451 + eautoreconf
452 +}
453 +
454 +src_configure() {
455 + filter-flags -flto
456 + local myconf=()
457 + local buildmode
458 +
459 + myconf+=( $(use_enable !device-mapper-only dmeventd) )
460 + myconf+=( $(use_enable !device-mapper-only cmdlib) )
461 + myconf+=( $(use_enable !device-mapper-only applib) )
462 + myconf+=( $(use_enable !device-mapper-only fsadm) )
463 + myconf+=( $(use_enable !device-mapper-only lvmetad) )
464 + use device-mapper-only && myconf+=( --disable-udev-systemd-background-jobs )
465 +
466 + # Most of this package does weird stuff.
467 + # The build options are tristate, and --without is NOT supported
468 + # options: 'none', 'internal', 'shared'
469 + if use static; then
470 + buildmode="internal"
471 + # This only causes the .static versions to become available
472 + myconf+=( --enable-static_link )
473 + else
474 + buildmode="shared"
475 + fi
476 + dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
477 +
478 + # dmeventd requires mirrors to be internal, and snapshot available
479 + # so we cannot disable them
480 + myconf+=( --with-mirrors=${dmbuildmode} )
481 + myconf+=( --with-snapshots=${dmbuildmode} )
482 + if use thin; then
483 + myconf+=( --with-thin=internal --with-cache=internal )
484 + local texec
485 + for texec in check dump repair restore; do
486 + myconf+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
487 + myconf+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
488 + done
489 + else
490 + myconf+=( --with-thin=none --with-cache=none )
491 + fi
492 +
493 + if use lvm1; then
494 + myconf+=( --with-lvm1=${buildmode} )
495 + else
496 + myconf+=( --with-lvm1=none )
497 + fi
498 +
499 + # disable O_DIRECT support on hppa, breaks pv detection (#99532)
500 + use hppa && myconf+=( --disable-o_direct )
501 +
502 + if use clvm; then
503 + myconf+=( --with-cluster=${buildmode} )
504 + # 4-state! Make sure we get it right, per bug 210879
505 + # Valid options are: none, cman, gulm, all
506 + #
507 + # 2009/02:
508 + # gulm is removed now, now dual-state:
509 + # cman, none
510 + # all still exists, but is not needed
511 + #
512 + # 2009/07:
513 + # TODO: add corosync and re-enable ALL
514 + local clvmd=""
515 + use cman && clvmd="cman"
516 + #clvmd="${clvmd/cmangulm/all}"
517 + use corosync && clvmd="${clvmd:+$clvmd,}corosync"
518 + use openais && clvmd="${clvmd:+$clvmd,}openais"
519 + [ -z "${clvmd}" ] && clvmd="none"
520 + myconf+=( --with-clvmd=${clvmd} )
521 + myconf+=( --with-pool=${buildmode} )
522 + myconf+=( --enable-lvmlockd-dlm )
523 + else
524 + myconf+=( --with-clvmd=none --with-cluster=none )
525 + fi
526 +
527 + econf \
528 + $(use_enable readline) \
529 + $(use_enable selinux) \
530 + --enable-pkgconfig \
531 + --with-confdir="${EPREFIX}"/etc \
532 + --exec-prefix="${EPREFIX}" \
533 + --sbindir="${EPREFIX}/sbin" \
534 + --with-staticdir="${EPREFIX}"/sbin \
535 + --libdir="${EPREFIX}/$(get_libdir)" \
536 + --with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
537 + --with-default-dm-run-dir=/run \
538 + --with-default-run-dir=/run/lvm \
539 + --with-default-locking-dir=/run/lock/lvm \
540 + --with-default-pid-dir=/run \
541 + $(use_enable udev udev_rules) \
542 + $(use_enable udev udev_sync) \
543 + $(use_with udev udevdir "$(get_udevdir)"/rules.d) \
544 + $(use_enable sanlock lvmlockd-sanlock) \
545 + $(use_enable systemd udev-systemd-background-jobs) \
546 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
547 + ${myconf[@]} \
548 + CLDFLAGS="${LDFLAGS}"
549 +}
550 +
551 +src_compile() {
552 + pushd include >/dev/null
553 + emake
554 + popd >/dev/null
555 +
556 + if use device-mapper-only ; then
557 + emake device-mapper
558 + else
559 + emake
560 + emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
561 + fi
562 +}
563 +
564 +src_install() {
565 + local inst
566 + INSTALL_TARGETS="install install_tmpfiles_configuration"
567 + # install systemd related files only when requested, bug #522430
568 + use systemd && INSTALL_TARGETS="${INSTALL_TARGETS} install_systemd_units install_systemd_generators"
569 + use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
570 + for inst in ${INSTALL_TARGETS}; do
571 + emake DESTDIR="${D}" ${inst}
572 + done
573 +
574 + newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
575 + newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
576 +
577 + if use !device-mapper-only ; then
578 + newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
579 + newinitd "${FILESDIR}"/lvm.rc-2.02.172 lvm
580 + newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
581 +
582 + newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
583 + newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
584 + fi
585 +
586 + if use sanlock; then
587 + newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
588 + fi
589 +
590 + if use clvm; then
591 + newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
592 + newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
593 + fi
594 +
595 + if use static-libs; then
596 + dolib.a libdm/ioctl/libdevmapper.a
597 + dolib.a libdaemon/client/libdaemonclient.a #462908
598 + #gen_usr_ldscript libdevmapper.so
599 + dolib.a daemons/dmeventd/libdevmapper-event.a
600 + #gen_usr_ldscript libdevmapper-event.so
601 + else
602 + rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
603 + fi
604 +
605 + if use lvm2create_initrd; then
606 + dosbin scripts/lvm2create_initrd/lvm2create_initrd
607 + doman scripts/lvm2create_initrd/lvm2create_initrd.8
608 + newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
609 + fi
610 +
611 + insinto /etc
612 + doins "${FILESDIR}"/dmtab
613 +
614 + dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
615 +}
616 +
617 +pkg_postinst() {
618 + ewarn "Make sure the \"lvm\" init script is in the runlevels:"
619 + ewarn "# rc-update add lvm boot"
620 + ewarn
621 + ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
622 + ewarn "to enable lvm autoactivation and metadata caching."
623 +}
624 +
625 +src_test() {
626 + einfo "Tests are disabled because of device-node mucking, if you want to"
627 + einfo "run tests, compile the package and see ${S}/tests"
628 +}