/[gentoo-x86]/sys-fs/lvm2/lvm2-2.02.108.ebuild
Gentoo

Contents of /sys-fs/lvm2/lvm2-2.02.108.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Thu Jul 31 18:44:17 2014 UTC (6 years, 4 months ago) by ssuominen
Branch: MAIN
Changes since 1.3: +2 -2 lines
Use type -P to get path of true instead of hardcoding it.

(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)

1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/lvm2-2.02.108.ebuild,v 1.3 2014/07/30 19:38:03 ssuominen Exp $
4
5 EAPI=5
6 inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
7
8 DESCRIPTION="User-land utilities for LVM2 (device-mapper) software."
9 HOMEPAGE="http://sources.redhat.com/lvm2/"
10 SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
11 ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
16 IUSE="readline static static-libs systemd clvm cman lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
17 REQUIRED_USE="device-mapper-only? ( !clvm !cman !lvm1 !lvm2create_initrd !thin )"
18
19 DEPEND_COMMON="clvm? ( cman? ( =sys-cluster/cman-3* ) =sys-cluster/libdlm-3* )
20 readline? ( sys-libs/readline )
21 udev? ( >=virtual/libudev-208:=[static-libs?] )"
22 # /run is now required for locking during early boot. /var cannot be assumed to
23 # be available -- thus, pull in recent enough baselayout for /run.
24 # This version of LVM is incompatible with cryptsetup <1.1.2.
25 RDEPEND="${DEPEND_COMMON}
26 >=sys-apps/baselayout-2.2
27 !<sys-apps/openrc-0.11
28 !<sys-fs/cryptsetup-1.1.2
29 !!sys-fs/clvm
30 !!sys-fs/lvm-user
31 >=sys-apps/util-linux-2.16
32 lvm2create_initrd? ( sys-apps/makedev )
33 thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
34 # note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
35 DEPEND="${DEPEND_COMMON}
36 virtual/pkgconfig
37 >=sys-devel/binutils-2.20.1-r1
38 static? (
39 selinux? ( sys-libs/libselinux[static-libs] )
40 udev? ( >=virtual/libudev-208:=[static-libs] )
41 >=sys-apps/util-linux-2.16[static-libs]
42 )"
43
44 S=${WORKDIR}/${PN/lvm/LVM}.${PV}
45
46 pkg_setup() {
47 local CONFIG_CHECK="~SYSVIPC"
48
49 if use udev; then
50 local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
51 if linux_config_exists; then
52 local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
53 if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
54 ewarn "It's recommended to set an empty value to the following kernel config option:"
55 ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
56 fi
57 fi
58 fi
59
60 check_extra_config
61
62 # 1. Genkernel no longer copies /sbin/lvm blindly.
63 if use static; then
64 elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
65 elog "their static versions. If you need the static binaries,"
66 elog "you must append .static to the filename!"
67 fi
68 }
69
70 src_prepare() {
71 # Gentoo specific modification(s):
72 epatch "${FILESDIR}"/${PN}-2.02.108-example.conf.in.patch
73
74 sed -i \
75 -e "1iAR = $(tc-getAR)" \
76 -e "s:CC ?= @CC@:CC = $(tc-getCC):" \
77 make.tmpl.in || die #444082
78
79 sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
80
81 if use systemd && ! use device-mapper-only; then
82 sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
83 fi
84
85 sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
86
87 # For upstream -- review and forward:
88 epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
89 epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
90 epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
91 epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
92 epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
93 epatch "${FILESDIR}"/${PN}-2.02.92-dynamic-static-ldflags.patch #332905
94 epatch "${FILESDIR}"/${PN}-2.02.108-static-pkgconfig-libs.patch #370217, #439414 + blkid
95 epatch "${FILESDIR}"/${PN}-2.02.106-pthread-pkgconfig.patch #492450
96
97 # Without thin-privision-tools, there is nothing to install for target install_man7:
98 use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
99
100 eautoreconf
101 }
102
103 src_configure() {
104 filter-flags -flto
105 local myconf
106 local buildmode
107
108 myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
109 myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
110 myconf="${myconf} $(use_enable !device-mapper-only applib)"
111 myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
112 myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
113 use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
114
115 # Most of this package does weird stuff.
116 # The build options are tristate, and --without is NOT supported
117 # options: 'none', 'internal', 'shared'
118 if use static; then
119 buildmode="internal"
120 # This only causes the .static versions to become available
121 myconf="${myconf} --enable-static_link"
122 else
123 buildmode="shared"
124 fi
125 dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
126
127 # dmeventd requires mirrors to be internal, and snapshot available
128 # so we cannot disable them
129 myconf="${myconf} --with-mirrors=${dmbuildmode}"
130 myconf="${myconf} --with-snapshots=${dmbuildmode}"
131 if use thin; then
132 myconf="${myconf} --with-thin=internal --with-cache=internal"
133 local texec
134 for texec in check dump repair restore; do
135 myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
136 myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
137 done
138 else
139 myconf="${myconf} --with-thin=none --with-cache=none"
140 fi
141
142 if use lvm1; then
143 myconf="${myconf} --with-lvm1=${buildmode}"
144 else
145 myconf="${myconf} --with-lvm1=none"
146 fi
147
148 # disable O_DIRECT support on hppa, breaks pv detection (#99532)
149 use hppa && myconf="${myconf} --disable-o_direct"
150
151 if use clvm; then
152 myconf="${myconf} --with-cluster=${buildmode}"
153 # 4-state! Make sure we get it right, per bug 210879
154 # Valid options are: none, cman, gulm, all
155 #
156 # 2009/02:
157 # gulm is removed now, now dual-state:
158 # cman, none
159 # all still exists, but is not needed
160 #
161 # 2009/07:
162 # TODO: add corosync and re-enable ALL
163 local clvmd=""
164 use cman && clvmd="cman"
165 #clvmd="${clvmd/cmangulm/all}"
166 [ -z "${clvmd}" ] && clvmd="none"
167 myconf="${myconf} --with-clvmd=${clvmd}"
168 myconf="${myconf} --with-pool=${buildmode}"
169 else
170 myconf="${myconf} --with-clvmd=none --with-cluster=none"
171 fi
172
173 econf \
174 $(use_enable readline) \
175 $(use_enable selinux) \
176 --enable-pkgconfig \
177 --with-confdir="${EPREFIX}"/etc \
178 --exec-prefix="${EPREFIX}" \
179 --sbindir="${EPREFIX}/sbin" \
180 --with-staticdir="${EPREFIX}"/sbin \
181 --libdir="${EPREFIX}/$(get_libdir)" \
182 --with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
183 --with-default-dm-run-dir=/run \
184 --with-default-run-dir=/run/lvm \
185 --with-default-locking-dir=/run/lock/lvm \
186 --with-default-pid-dir=/run \
187 $(use_enable udev udev_rules) \
188 $(use_enable udev udev_sync) \
189 $(use_with udev udevdir "$(get_udevdir)"/rules.d) \
190 $(use_enable systemd udev-systemd-background-jobs) \
191 "$(systemd_with_unitdir)" \
192 ${myconf} \
193 CLDFLAGS="${LDFLAGS}"
194 }
195
196 src_compile() {
197 pushd include >/dev/null
198 emake
199 popd >/dev/null
200
201 if use device-mapper-only ; then
202 emake device-mapper
203 else
204 emake
205 emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
206 fi
207 }
208
209 src_install() {
210 local inst
211 INSTALL_TARGETS="install install_systemd_units install_systemd_generators install_tmpfiles_configuration"
212 use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
213 for inst in ${INSTALL_TARGETS}; do
214 emake DESTDIR="${D}" ${inst}
215 done
216
217 newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
218 newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
219
220 if use !device-mapper-only ; then
221 newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
222 newinitd "${FILESDIR}"/lvm.rc-2.02.105-r2 lvm
223 newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
224
225 newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
226 newinitd "${FILESDIR}"/lvmetad.initd-2.02.105-r2 lvmetad
227 fi
228
229 if use clvm; then
230 newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
231 newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
232 fi
233
234 if use static-libs; then
235 dolib.a libdm/ioctl/libdevmapper.a
236 dolib.a libdaemon/client/libdaemonclient.a #462908
237 #gen_usr_ldscript libdevmapper.so
238 dolib.a daemons/dmeventd/libdevmapper-event.a
239 #gen_usr_ldscript libdevmapper-event.so
240 else
241 rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
242 fi
243
244 if use lvm2create_initrd; then
245 dosbin scripts/lvm2create_initrd/lvm2create_initrd
246 doman scripts/lvm2create_initrd/lvm2create_initrd.8
247 newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
248 fi
249
250 insinto /etc
251 doins "${FILESDIR}"/dmtab
252
253 dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
254 }
255
256 pkg_postinst() {
257 ewarn "Make sure the \"lvm\" init script is in the runlevels:"
258 ewarn "# rc-update add lvm boot"
259 ewarn
260 ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
261 ewarn "to enable lvm autoactivation and metadata caching."
262 }
263
264 src_test() {
265 einfo "Tests are disabled because of device-node mucking, if you want to"
266 einfo "run tests, compile the package and see ${S}/tests"
267 }

  ViewVC Help
Powered by ViewVC 1.1.20