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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Tue Dec 11 22:24:40 2012 UTC (2 years ago) by robbat2
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +1 -1 lines
FILE REMOVED
Trim lots of old versions. Trim of files/ to come later.

(Portage version: 2.2.0_alpha144/cvs/Linux x86_64, unsigned Manifest commit)

1 # Copyright 1999-2012 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.84.ebuild,v 1.8 2012/12/11 21:48:10 ssuominen Exp $
4
5 EAPI=2
6 inherit eutils multilib toolchain-funcs autotools linux-info
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 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
16
17 IUSE="readline +static clvm cman +lvm1 selinux"
18
19 DEPEND_COMMON="!!sys-fs/device-mapper
20 readline? ( sys-libs/readline )
21 clvm? ( =sys-cluster/dlm-2*
22 cman? ( =sys-cluster/cman-2* ) )
23 <virtual/udev-196"
24
25 RDEPEND="${DEPEND_COMMON}
26 !<sys-apps/openrc-0.4
27 !!sys-fs/lvm-user
28 !!sys-fs/clvm
29 >=sys-apps/util-linux-2.16"
30
31 # Upgrading to this LVM will break older cryptsetup
32 RDEPEND="${RDEPEND}
33 !<sys-fs/cryptsetup-1.1.2"
34
35 DEPEND="${DEPEND_COMMON}
36 virtual/pkgconfig
37 >=sys-devel/binutils-2.20.1-r1"
38
39 S="${WORKDIR}/${PN/lvm/LVM}.${PV}"
40
41 pkg_setup() {
42 local CONFIG_CHECK="~SYSVIPC"
43 local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
44 check_extra_config
45 # 1. Genkernel no longer copies /sbin/lvm blindly.
46 # 2. There are no longer any linking deps in /usr.
47 if use static; then
48 elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
49 elog "their static versions. If you need the static binaries,"
50 elog "you must append .static the filename!"
51 fi
52 }
53
54 src_unpack() {
55 unpack ${A}
56 }
57
58 src_prepare() {
59 epatch "${FILESDIR}"/lvm.conf-2.02.67.patch
60
61 # Should not be needed due to upstream re-arrangement of build
62 #epatch "${FILESDIR}"/${PN}-2.02.56-dmeventd.patch
63 # Should not be need with new upstream udev rules
64 #epatch "${FILESDIR}"/${PN}-2.02.56-device-mapper-export-format.patch
65
66 # Merged upstream:
67 #epatch "${FILESDIR}"/${PN}-2.02.51-as-needed.patch
68 # Merged upstream:
69 #epatch "${FILESDIR}"/${PN}-2.02.48-fix-pkgconfig.patch
70 # Merged upstream:
71 #epatch "${FILESDIR}"/${PN}-2.02.51-fix-pvcreate.patch
72 # Fixed differently upstream:
73 #epatch "${FILESDIR}"/${PN}-2.02.51-dmsetup-selinux-linking-fix-r3.patch
74
75 epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
76 epatch "${FILESDIR}"/lvm2-2.02.56-lvm2create_initrd.patch
77 # bug 318513
78 epatch "${FILESDIR}"/${PN}-2.02.64-dmeventd-libs.patch
79 # bug 301331
80 epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch
81 # bug 330373
82 epatch "${FILESDIR}"/${PN}-2.02.73-locale-muck.patch
83 # --as-needed
84 epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch
85 # bug 332905
86 epatch "${FILESDIR}"/${PN}-2.02.72-dynamic-static-ldflags.patch
87 # bug 361429
88 epatch "${FILESDIR}"/${PN}-2.02.84-udev-pkgconfig.patch
89
90 # Merged upstream
91 #epatch "${FILESDIR}"/${PN}-2.02.73-asneeded.patch
92
93 eautoreconf
94 }
95
96 src_configure() {
97 local myconf
98 local buildmode
99
100 myconf="${myconf} --enable-dmeventd"
101 myconf="${myconf} --enable-cmdlib"
102 myconf="${myconf} --enable-applib"
103 myconf="${myconf} --enable-fsadm"
104
105 # Most of this package does weird stuff.
106 # The build options are tristate, and --without is NOT supported
107 # options: 'none', 'internal', 'shared'
108 if use static ; then
109 einfo "Building static LVM, for usage inside genkernel"
110 buildmode="internal"
111 # This only causes the .static versions to become available
112 # For recent systems, there are no linkages against anything in /usr anyway.
113 # We explicitly provide the .static versions so that they can be included in
114 # initramfs environments.
115 myconf="${myconf} --enable-static_link"
116 else
117 ewarn "Building shared LVM, it will not work inside genkernel!"
118 buildmode="shared"
119 fi
120
121 # dmeventd requires mirrors to be internal, and snapshot available
122 # so we cannot disable them
123 myconf="${myconf} --with-mirrors=internal"
124 myconf="${myconf} --with-snapshots=internal"
125
126 if use lvm1 ; then
127 myconf="${myconf} --with-lvm1=${buildmode}"
128 else
129 myconf="${myconf} --with-lvm1=none"
130 fi
131
132 # disable O_DIRECT support on hppa, breaks pv detection (#99532)
133 use hppa && myconf="${myconf} --disable-o_direct"
134
135 if use clvm; then
136 myconf="${myconf} --with-cluster=${buildmode}"
137 # 4-state! Make sure we get it right, per bug 210879
138 # Valid options are: none, cman, gulm, all
139 #
140 # 2009/02:
141 # gulm is removed now, now dual-state:
142 # cman, none
143 # all still exists, but is not needed
144 #
145 # 2009/07:
146 # TODO: add corosync and re-enable ALL
147 local clvmd=""
148 use cman && clvmd="cman"
149 #clvmd="${clvmd/cmangulm/all}"
150 [ -z "${clvmd}" ] && clvmd="none"
151 myconf="${myconf} --with-clvmd=${clvmd}"
152 myconf="${myconf} --with-pool=${buildmode}"
153 else
154 myconf="${myconf} --with-clvmd=none --with-cluster=none"
155 fi
156
157 myconf="${myconf}
158 --sbindir=/sbin
159 --with-staticdir=/sbin
160 --with-dmeventd-path=/sbin/dmeventd"
161 econf $(use_enable readline) \
162 $(use_enable selinux) \
163 --enable-pkgconfig \
164 --libdir=/$(get_libdir) \
165 --with-usrlibdir=/usr/$(get_libdir) \
166 --enable-udev_rules \
167 --enable-udev_sync \
168 --with-udevdir=/lib/udev/rules.d/ \
169 ${myconf} \
170 CLDFLAGS="${LDFLAGS}" || die
171 }
172
173 src_compile() {
174 einfo "Doing symlinks"
175 pushd include
176 emake || die "Failed to prepare symlinks"
177 popd
178
179 einfo "Starting main build"
180 emake || die "compile fail"
181 }
182
183 src_install() {
184 emake DESTDIR="${D}" install || die "Failed to emake install"
185
186 # All of this was change by upstream, and if we don't get any problems, we
187 # can probably drop it in .65
188 #X## Revamp all of our library handling for bug #316571
189 #X## Upstream build script puts a lot of this stuff into /usr/lib regardless of
190 #X## libdir variable.
191 #X#dodir /$(get_libdir)
192 #X## .so -> /$(get_libdir)
193 #X#mv -f "${D}"/usr/lib/lib*.so* "${D}"/$(get_libdir)
194 #X#[[ "$(get_libdir)" != "lib" ]] && \
195 #X# mv "${D}"/usr/$(get_libdir)/lib*.so* "${D}"/$(get_libdir)
196 #X## .a -> /usr/$(get_libdir)
197 #X#[[ "$(get_libdir)" != "lib" ]] && \
198 #X# mv -f "${D}"/usr/lib/lib*.a "${D}"/usr/$(get_libdir)
199 #X## The upstream symlinks are borked. lets rebuild them instead.
200 #X#find "${D}"/{usr,}/{lib,$(get_libdir)} -type l \
201 #X# | xargs rm -f 2>/dev/null
202 #X#for i in "${D}"/$(get_libdir)/*.so.* ; do
203 #X# b="${i//*\/}" o="${b/.so.*/.so}"
204 #X# ln -s "${b}" "${D}/$(get_libdir)/${o}"
205 #X#done
206 #X## Now enable building properly
207 #X#for i in \
208 #X# libdevmapper-event{,-lvm2{,mirror,snapshot}} \
209 #X# libdevmapper \
210 #X# liblvm2{format1,snapshot,cmd,app} \
211 #X# ; do
212 #X# gen_usr_ldscript ${i}.so || die
213 #X#done
214
215 dodoc README VERSION WHATS_NEW doc/*.{conf,c,txt}
216 insinto /$(get_libdir)/rcscripts/addons
217 newins "${FILESDIR}"/lvm2-start.sh-2.02.67-r1 lvm-start.sh || die
218 newins "${FILESDIR}"/lvm2-stop.sh-2.02.67-r1 lvm-stop.sh || die
219 newinitd "${FILESDIR}"/lvm.rc-2.02.67-r1 lvm || die
220 newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.67-r2 lvm-monitoring || die
221 newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm || die
222 if use clvm; then
223 newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd || die
224 newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd || die
225 fi
226
227 # move shared libs to /lib(64)
228 dolib.a libdm/ioctl/libdevmapper.a || die "dolib.a libdevmapper.a"
229 #gen_usr_ldscript libdevmapper.so
230
231 dosbin "${S}"/scripts/lvm2create_initrd/lvm2create_initrd
232 doman "${S}"/scripts/lvm2create_initrd/lvm2create_initrd.8
233 newdoc "${S}"/scripts/lvm2create_initrd/README README.lvm2create_initrd
234
235 insinto /etc
236 doins "${FILESDIR}"/dmtab
237 insinto /$(get_libdir)/rcscripts/addons
238 doins "${FILESDIR}"/dm-start.sh
239
240 # Device mapper stuff
241 newinitd "${FILESDIR}"/device-mapper.rc-2.02.67-r1 device-mapper || die
242 newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper || die
243
244 newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd || die
245 dolib.a daemons/dmeventd/libdevmapper-event.a \
246 || die "dolib.a libdevmapper-event.a"
247 #gen_usr_ldscript libdevmapper-event.so
248
249 #insinto /etc/udev/rules.d/
250 #newins "${FILESDIR}"/64-device-mapper.rules-2.02.56-r3 64-device-mapper.rules || die
251
252 # do not rely on /lib -> /libXX link
253 sed -e "s-/lib/rcscripts/-/$(get_libdir)/rcscripts/-" -i "${D}"/etc/init.d/*
254
255 elog "USE flag nocman is deprecated and replaced"
256 elog "with the cman USE flag."
257 elog ""
258 elog "USE flags clvm and cman are masked"
259 elog "by default and need to be unmasked to use them"
260 elog ""
261 elog "If you are using genkernel and root-on-LVM, rebuild the initramfs."
262 }
263
264 pkg_postinst() {
265 elog "lvm volumes are no longer automatically created for"
266 elog "baselayout-2 users. If you are using baselayout-2, be sure to"
267 elog "run: # rc-update add lvm boot"
268 elog "Do NOT add it if you are using baselayout-1 still."
269 }
270
271 src_test() {
272 einfo "Testcases disabled because of device-node mucking"
273 einfo "If you want them, compile the package and see ${S}/tests"
274 }

  ViewVC Help
Powered by ViewVC 1.1.20