Gentoo Archives: gentoo-commits

From: Ian Delaney <della5@×××××××××.au>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/virtualization:master commit in: app-emulation/xen-tools/
Date: Fri, 02 Mar 2012 13:08:26
Message-Id: 1330693362.ada5dba6934ec09a766353446ca0830d6016ed5d.ian_delaney@gentoo
1 commit: ada5dba6934ec09a766353446ca0830d6016ed5d
2 Author: Ian Delaney <idell5 <AT> iinet <DOT> com <DOT> au>
3 AuthorDate: Fri Mar 2 13:02:42 2012 +0000
4 Commit: Ian Delaney <della5 <AT> iinet <DOT> com <DOT> au>
5 CommitDate: Fri Mar 2 13:02:42 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/virtualization.git;a=commit;h=ada5dba6
7
8 Adding xen-tools-4.1.2-r3.ebuild, fix static-libs
9
10 (Portage version: 2.2.0_alpha84/git/Linux x86_64, unsigned Manifest commit)
11
12 ---
13 app-emulation/xen-tools/Manifest | 2 +-
14 app-emulation/xen-tools/xen-tools-4.1.2-r3.ebuild | 329 +++++++++++++++++++++
15 2 files changed, 330 insertions(+), 1 deletions(-)
16
17 diff --git a/app-emulation/xen-tools/Manifest b/app-emulation/xen-tools/Manifest
18 index 5e67615..d4f52aa 100644
19 --- a/app-emulation/xen-tools/Manifest
20 +++ b/app-emulation/xen-tools/Manifest
21 @@ -1,3 +1,3 @@
22 DIST ipxe-git-9a93db3f0947484e30e753bbd61a10b17336e20e.tar.gz 2888480 SHA256 ea2a52a999afab7fefa6300e0f1b38409c170a7503a51d8b572d790e71f2d0f0 SHA512 02314727af850bdf51c1963e8da258a65868f3ef116e9833918c770b8737cd1501891d4dc90d787702a1f34e35198e57373d730b7e2e6671e5fa93ece7c2f073 WHIRLPOOL 9a232852c3dee266dcbd27fae6814497814a0f65123484c37196a99c6cc746a348cf38c77ba084e62e052c64e950b34aa2f152a154e99c0366746f97941b23d7
23 DIST ipxe-git-v1.0.0.tar.gz 1996881 SHA256 d3128bfda9a1542049c278755f85bbcbb8441da7bfd702d511ce237fcf86a723 SHA512 6921fb857ca615899a5912d5590ca36b6f46daf828b85edc75461c08a189d9fed71ee74a82e42724da7a1355e45070d28a0a61694b3a4872c3554390e4bb4147 WHIRLPOOL 160e24eea479c9d67a8a5c7c5182864904ee594167f061adc40a3e74974197b6befe2ecdb76af1c101ff1a5697b060dae71dd3f9f969c8e18054526584d57031
24 -DIST xen-4.1.2.tar.gz 1084824 SHA256 e0b082fde62e0ca4d7f61eca96c221be92c51e1a6161eb4e7eaa4ccfee3420e8 SHA512 670a5dbbfccecd4c100d30c61037acb24e7039e5b7f641b1508b1300d056f55ce75a6bf9c062344a2940ebca08197a1956d453acdb1754034e2f5280adf41649 WHIRLPOOL 3ac2d6cc5ec35ed9e063e4468b03437e209bbae8f70dc02deba23fc62fe8d12703e8cde81e0eee2cd51b7b2f1bed9838f75044720baeb6b93f017d09e2edcc50
25 +DIST xen-4.1.2.tar.gz 10365786 SHA256 7d9c93057cf480d3f1efa792b19285a84fa3c06060ea5c5c453be00887389b0d SHA512 8f50f238b0b474ec5556279cbd51d704b4365033f2541a5d0376f287b26b7e8f0193172041109d97bb76d35ace3adf71e12f89f5766ff79a8ea861e7282f00d7 WHIRLPOOL 93a4bdd05125ef722464ef682798191c8b3db7228cbc0a27bcbe7932a7776491f90e727e1fcc4a9e7ec3eada7f56c567c07ad61cdda2f514109f702800fe5566
26
27 diff --git a/app-emulation/xen-tools/xen-tools-4.1.2-r3.ebuild b/app-emulation/xen-tools/xen-tools-4.1.2-r3.ebuild
28 new file mode 100644
29 index 0000000..4d22347
30 --- /dev/null
31 +++ b/app-emulation/xen-tools/xen-tools-4.1.2-r3.ebuild
32 @@ -0,0 +1,329 @@
33 +# Copyright 1999-2012 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.1.2-r2.ebuild,v 1.3 2012/01/12 13:40:01 alexxy Exp $
36 +
37 +EAPI="4"
38 +PYTHON_DEPEND="2"
39 +PYTHON_USE_WITH="xml threads"
40 +
41 +if [[ $PV == *9999 ]]; then
42 + KEYWORDS=""
43 + REPO="xen-unstable.hg"
44 + EHG_REPO_URI="http://xenbits.xensource.com/${REPO}"
45 + S="${WORKDIR}/${REPO}"
46 + live_eclass="mercurial"
47 +else
48 + KEYWORDS="~amd64 ~x86"
49 + XEN_EXTFILES_URL="http://xenbits.xensource.com/xen-extfiles"
50 + SRC_URI="http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz \
51 + $XEN_EXTFILES_URL/ipxe-git-v1.0.0.tar.gz"
52 + S="${WORKDIR}/xen-${PV}"
53 +fi
54 +
55 +inherit flag-o-matic eutils multilib python toolchain-funcs ${live_eclass}
56 +
57 +DESCRIPTION="Xend daemon and tools"
58 +HOMEPAGE="http://xen.org/"
59 +DOCS=( README docs/README.xen-bugtool docs/ChangeLog )
60 +
61 +LICENSE="GPL-2"
62 +SLOT="0"
63 +IUSE="api custom-cflags debug doc flask hvm qemu pygrub screen static-libs xend"
64 +
65 +REQUIRED_USE="hvm? ( qemu )"
66 +
67 +QA_PRESTRIPPED="/usr/share/xen/qemu/openbios-ppc \
68 + /usr/share/xen/qemu/openbios-sparc64 \
69 + /usr/share/xen/qemu/openbios-sparc32"
70 +QA_WX_LOAD=${QA_PRESTRIPPED}
71 +
72 +CDEPEND="<dev-libs/yajl-2
73 + dev-python/lxml
74 + dev-python/pypam
75 + dev-python/pyxml
76 + sys-libs/zlib
77 + hvm? ( media-libs/libsdl
78 + sys-power/iasl )
79 + api? ( dev-libs/libxml2 net-misc/curl )"
80 +
81 +DEPEND="${CDEPEND}
82 + sys-devel/gcc
83 + dev-lang/perl
84 + app-misc/pax-utils
85 + dev-ml/findlib
86 + doc? (
87 + app-doc/doxygen
88 + dev-tex/latex2html[png,gif]
89 + media-gfx/transfig
90 + media-gfx/graphviz
91 + dev-tex/xcolor
92 + dev-texlive/texlive-latexextra
93 + virtual/latex-base
94 + dev-tex/latexmk
95 + dev-texlive/texlive-latex
96 + dev-texlive/texlive-pictures
97 + dev-texlive/texlive-latexrecommended
98 + )
99 + hvm? (
100 + x11-proto/xproto
101 + sys-devel/dev86
102 + ) pygrub? ( dev-lang/python[ncurses] )
103 + "
104 +
105 +RDEPEND="${CDEPEND}
106 + sys-apps/iproute2
107 + net-misc/bridge-utils
108 + >=dev-lang/ocaml-3.12.0
109 + screen? (
110 + app-misc/screen
111 + app-admin/logrotate
112 + )
113 + || ( sys-fs/udev sys-apps/hotplug )"
114 +
115 +# hvmloader is used to bootstrap a fully virtualized kernel
116 +# Approved by QA team in bug #144032
117 +QA_WX_LOAD="usr/lib/xen/boot/hvmloader"
118 +QA_EXECSTACK="usr/share/xen/qemu/openbios-sparc32
119 + usr/share/xen/qemu/openbios-sparc64"
120 +RESTRICT="test"
121 +
122 +pkg_setup() {
123 + python_set_active_version 2
124 + python_pkg_setup
125 + export "CONFIG_LOMOUNT=y"
126 +
127 + if use qemu; then
128 + export "CONFIG_IOEMU=y"
129 + else
130 + export "CONFIG_IOEMU=n"
131 + fi
132 +
133 + if ! use x86 && ! has x86 $(get_all_abis) && use hvm; then
134 + eerror "HVM (VT-x and AMD-v) cannot be built on this system. An x86 or"
135 + eerror "an amd64 multilib profile is required. Remove the hvm use flag"
136 + eerror "to build xen-tools on your current profile."
137 + die "USE=hvm is unsupported on this system."
138 + fi
139 +
140 + if [[ -z ${XEN_TARGET_ARCH} ]] ; then
141 + if use x86 && use amd64; then
142 + die "Confusion! Both x86 and amd64 are set in your use flags!"
143 + elif use x86; then
144 + export XEN_TARGET_ARCH="x86_32"
145 + elif use amd64 ; then
146 + export XEN_TARGET_ARCH="x86_64"
147 + else
148 + die "Unsupported architecture!"
149 + fi
150 + fi
151 +
152 + use api && export "LIBXENAPI_BINDINGS=y"
153 + use flask && export "FLASK_ENABLE=y"
154 +}
155 +
156 +src_prepare() {
157 + cp "$DISTDIR/ipxe-git-v1.0.0.tar.gz" tools/firmware/etherboot/ipxe.tar.gz
158 + sed -e 's/-Wall//' -i Config.mk || die "Couldn't sanitize CFLAGS"
159 +
160 + # Drop .config
161 + sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
162 + # Xend
163 + if ! use xend; then
164 + sed -e 's:xm xen-bugtool xen-python-path xend:xen-bugtool xen-python-path:' \
165 + -i tools/misc/Makefile || die "Disabling xend failed" || die
166 + sed -e 's:^XEND_INITD:#XEND_INITD:' \
167 + -i tools/examples/Makefile || "Disabling xend failed" || die
168 + fi
169 + # if the user *really* wants to use their own custom-cflags, let them
170 + if use custom-cflags; then
171 + einfo "User wants their own CFLAGS - removing defaults"
172 +
173 + # try and remove all the default custom-cflags
174 + find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
175 + -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
176 + -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
177 + -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
178 + -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
179 + -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
180 + -i {} \; || die "failed to re-set custom-cflags"
181 + fi
182 +
183 + if ! use pygrub; then
184 + sed -e '/^SUBDIRS-$(PYTHON_TOOLS) += pygrub$/d' -i tools/Makefile || die
185 + fi
186 +
187 + # Disable hvm support on systems that don't support x86_32 binaries.
188 + if ! use hvm; then
189 + chmod 644 tools/check/check_x11_devel
190 + sed -e '/^CONFIG_IOEMU := y$/d' -i config/*.mk || die
191 + sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die
192 + fi
193 +
194 + # Don't bother with qemu, only needed for fully virtualised guests
195 + if ! use qemu; then
196 + sed -e "/^CONFIG_IOEMU := y$/d" -i config/*.mk || die
197 + sed -e "s:install-tools\: tools/ioemu-dir:install-tools\: :g" -i Makefile || die
198 + fi
199 +
200 + # Fix build for gcc-4.6
201 + sed -e "s:-Werror::g" -i tools/xenstat/xentop/Makefile || die
202 +
203 + # Fix network broadcast on bridged networks
204 + epatch "${FILESDIR}/${PN}-3.4.0-network-bridge-broadcast.patch"
205 +
206 + # Do not strip binaries
207 + epatch "${FILESDIR}/${PN}-3.3.0-nostrip.patch"
208 +
209 + # Prevent the downloading of ipxe
210 + sed -e 's:^\tif ! wget -O _$T:#\tif ! wget -O _$T:' \
211 + -e 's:^\tfi:#\tfi:' -i \
212 + -e 's:^\tmv _$T $T:#\tmv _$T $T:' \
213 + -i tools/firmware/etherboot/Makefile || die
214 +
215 + # Fix bridge by idella4, bug #362575
216 + epatch "${FILESDIR}/${PN}-4.1.1-bridge.patch"
217 +
218 + # Remove check_curl, new fix to Bug #386487
219 + epatch "${FILESDIR}/${PN}-4.1.1-curl.patch"
220 + sed -i -e 's|has_or_fail curl-config|has_or_fail curl-config\nset -ux|' \
221 + tools/check/check_curl || die
222 +
223 + # Don't build ipxe with pie on hardened, Bug #360805
224 + if gcc-specs-pie; then
225 + epatch "${FILESDIR}/ipxe-nopie.patch"
226 + fi
227 +
228 + # Fix create.py for pyxml Bug 367735
229 + epatch "${FILESDIR}/xen-tools-4.1.2-pyxml.patch"
230 +}
231 +
232 +src_compile() {
233 + export VARTEXFONTS="${T}/fonts"
234 + local myopt
235 + use debug && myopt="${myopt} debug=y"
236 +
237 + use custom-cflags || unset CFLAGS
238 + if test-flag-CC -fno-strict-overflow; then
239 + append-flags -fno-strict-overflow
240 + fi
241 +
242 + unset LDFLAGS
243 + emake CC=$(tc-getCC) LD=$(tc-getLD) -C tools ${myopt}
244 +
245 + if use doc; then
246 + sh ./docs/check_pkgs || die "package check failed"
247 + emake docs
248 + emake dev-docs
249 + fi
250 +
251 + emake -C docs man-pages
252 +}
253 +
254 +src_install() {
255 + # Override auto-detection in the build system, bug #382573
256 + export INITD_DIR=/etc/init.d
257 + export CONFIG_LEAF_DIR=default
258 +
259 + emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" XEN_PYTHON_NATIVE_INSTALL=y install-tools
260 + python_convert_shebangs -r 2 "${ED}"
261 +
262 + # Remove RedHat-specific stuff
263 + rm -rf "${ED}"/etc/init.d/xen* "${ED}"/etc/default || die
264 +
265 + # uncomment lines in xl.conf
266 + sed -e 's:^#autoballoon=1:autoballoon=1:' \
267 + -e 's:^#lockfile="/var/lock/xl":lockfile="/var/lock/xl":' \
268 + -e 's:^#vifscript="vif-bridge":vifscript="vif-bridge":' \
269 + -i tools/examples/xl.conf || die
270 +
271 +# dodoc README docs/README.xen-bugtool docs/ChangeLog
272 + if use doc; then
273 + emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" install-docs
274 +
275 + dohtml -r docs/api/
276 + docinto pdf
277 + dodoc ${DOCS[@]}
278 + #docs/api/tools/python/latex/refman.pdf
279 + [ -d "${ED}"/usr/share/doc/xen ] && mv "${ED}"/usr/share/doc/xen/* "${ED}"/usr/share/doc/${PF}/html
280 + fi
281 + rm -rf "${ED}"/usr/share/doc/xen/
282 + doman docs/man?/*
283 +
284 + if use xend; then
285 + newinitd "${FILESDIR}"/xend.initd-r2 xend || die "Couldn't install xen.initd"
286 + fi
287 + newconfd "${FILESDIR}"/xendomains.confd xendomains
288 + newconfd "${FILESDIR}"/xenstored.confd xenstored
289 + newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled
290 + newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains
291 + newinitd "${FILESDIR}"/xenstored.initd xenstored
292 + newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
293 +
294 + if use screen; then
295 + cat "${FILESDIR}"/xendomains-screen.confd >> "${ED}"/etc/conf.d/xendomains || die
296 + cp "${FILESDIR}"/xen-consoles.logrotate "${ED}"/etc/xen/ || die
297 + keepdir /var/log/xen-consoles
298 + fi
299 +
300 + # For -static-libs wrt Bug 384355
301 + if ! use static-libs; then
302 + rm -f ${ED}usr/$(get_libdir)/*.a ${ED}usr/$(get_libdir)/ocaml/*/*.a
303 + fi
304 +
305 + python_convert_shebangs -r 2 "${ED}"
306 + # xend expects these to exist
307 + keepdir /var/run/xenstored /var/lib/xenstored /var/xen/dump /var/lib/xen /var/log/xen
308 +
309 + # for xendomains
310 + keepdir /etc/xen/auto
311 +}
312 +
313 +pkg_postinst() {
314 + elog "Official Xen Guide and the unoffical wiki page:"
315 + elog " http://www.gentoo.org/doc/en/xen-guide.xml"
316 + elog " http://gentoo-wiki.com/HOWTO_Xen_and_Gentoo"
317 +
318 + if [[ "$(scanelf -s __guard -q $(type -P python))" ]] ; then
319 + echo
320 + ewarn "xend may not work when python is built with stack smashing protection (ssp)."
321 + ewarn "If 'xm create' fails with '<ProtocolError for /RPC2: -1 >', see bug #141866"
322 + ewarn "This probablem may be resolved as of Xen 3.0.4, if not post in the bug."
323 + fi
324 +
325 + if ! has_version "dev-lang/python[ncurses]"; then
326 + echo
327 + ewarn "NB: Your dev-lang/python is built without USE=ncurses."
328 + ewarn "Please rebuild python with USE=ncurses to make use of xenmon.py."
329 + fi
330 +
331 + if has_version "sys-apps/iproute2[minimal]"; then
332 + echo
333 + ewarn "Your sys-apps/iproute2 is built with USE=minimal. Networking"
334 + ewarn "will not work until you rebuild iproute2 without USE=minimal."
335 + fi
336 +
337 + if ! use hvm; then
338 + echo
339 + elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
340 + elog "support enable the hvm use flag."
341 + elog "An x86 or amd64 multilib system is required to build HVM support."
342 + echo
343 + elog "The qemu use flag has been removed and replaced with hvm."
344 + fi
345 +
346 + if use xend; then
347 + echo
348 + elog "xend capability has been enabled and installed"
349 + fi
350 +
351 + if grep -qsF XENSV= "${ROOT}/etc/conf.d/xend"; then
352 + echo
353 + elog "xensv is broken upstream (Gentoo bug #142011)."
354 + elog "Please remove '${ROOT%/}/etc/conf.d/xend', as it is no longer needed."
355 + fi
356 + python_mod_optimize $(use pygrub && echo grub) xen
357 +}
358 +
359 +pkg_postrm() {
360 + python_mod_cleanup $(use pygrub && echo grub) xen
361 +}