Gentoo Archives: gentoo-commits

From: "Ian Delaney (idella4)" <idella4@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/xen-tools: xen-tools-4.2.0-r2.ebuild xen-tools-4.2.1-r1.ebuild xen-tools-4.2.0-r3.ebuild ChangeLog
Date: Wed, 30 Jan 2013 09:09:05
Message-Id: 20130130090901.E083E2171D@flycatcher.gentoo.org
1 idella4 13/01/30 09:09:01
2
3 Modified: xen-tools-4.2.0-r2.ebuild ChangeLog
4 Added: xen-tools-4.2.1-r1.ebuild xen-tools-4.2.0-r3.ebuild
5 Log:
6 revbump;-4.2.0-r3; adjustments to DEPS, implementation of ocaml flag courtesy of user known as 'a.m' wrt Bug #447716, reconstitution of ipxe-nopie with subsequent add of -4-add-nopie.patch, new use ocaml added and implemented (possible to rename), sed statements reduced to patches, 2 sec. patches applied, build & install of docs corrected/upgrade. 4.2.1-r1; changes mirrored those to 4.2.0-r3, add of 1 valid sec. patch. Drop un-needed -3.4.2-as-needed.patch
7
8 (Portage version: 2.1.11.40/cvs/Linux x86_64, signed Manifest commit with key 0xB8072B0D)
9
10 Revision Changes Path
11 1.7 app-emulation/xen-tools/xen-tools-4.2.0-r2.ebuild
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.0-r2.ebuild?rev=1.7&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.0-r2.ebuild?rev=1.7&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.0-r2.ebuild?r1=1.6&r2=1.7
16
17 Index: xen-tools-4.2.0-r2.ebuild
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.0-r2.ebuild,v
20 retrieving revision 1.6
21 retrieving revision 1.7
22 diff -u -r1.6 -r1.7
23 --- xen-tools-4.2.0-r2.ebuild 24 Jan 2013 08:53:49 -0000 1.6
24 +++ xen-tools-4.2.0-r2.ebuild 30 Jan 2013 09:09:01 -0000 1.7
25 @@ -1,6 +1,6 @@
26 # Copyright 1999-2013 Gentoo Foundation
27 # Distributed under the terms of the GNU General Public License v2
28 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.0-r2.ebuild,v 1.6 2013/01/24 08:53:49 idella4 Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.0-r2.ebuild,v 1.7 2013/01/30 09:09:01 idella4 Exp $
30
31 EAPI=5
32
33 @@ -23,6 +23,7 @@
34 $XEN_SEABIOS_URL"
35 S="${WORKDIR}/xen-${PV}"
36 fi
37 +
38 inherit flag-o-matic eutils multilib python-single-r1 toolchain-funcs udev ${live_eclass}
39
40 DESCRIPTION="Xend daemon and tools"
41 @@ -131,6 +132,7 @@
42 # Drop .config
43 sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
44
45 +
46 # Xend
47 if ! use xend; then
48 sed -e 's:xm xen-bugtool xen-python-path xend:xen-bugtool xen-python-path:' \
49 @@ -138,6 +140,7 @@
50 sed -e 's:^XEND_INITD:#XEND_INITD:' \
51 -i tools/examples/Makefile || die "Disabling xend failed"
52 fi
53 +
54 # if the user *really* wants to use their own custom-cflags, let them
55 if use custom-cflags; then
56 einfo "User wants their own CFLAGS - removing defaults"
57
58
59
60 1.129 app-emulation/xen-tools/ChangeLog
61
62 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/ChangeLog?rev=1.129&view=markup
63 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/ChangeLog?rev=1.129&content-type=text/plain
64 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/ChangeLog?r1=1.128&r2=1.129
65
66 Index: ChangeLog
67 ===================================================================
68 RCS file: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v
69 retrieving revision 1.128
70 retrieving revision 1.129
71 diff -u -r1.128 -r1.129
72 --- ChangeLog 24 Jan 2013 08:53:49 -0000 1.128
73 +++ ChangeLog 30 Jan 2013 09:09:01 -0000 1.129
74 @@ -1,6 +1,24 @@
75 # ChangeLog for app-emulation/xen-tools
76 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
77 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v 1.128 2013/01/24 08:53:49 idella4 Exp $
78 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v 1.129 2013/01/30 09:09:01 idella4 Exp $
79 +
80 +*xen-tools-4.2.0-r3 (30 Jan 2013)
81 +*xen-tools-4.2.1-r1 (30 Jan 2013)
82 +
83 + 30 Jan 2013; Ian Delaney <idella4@g.o>
84 + +files/xen-4-CVE-2012-4544-XSA-25.patch,
85 + +files/xen-4-CVE-2012-6075-XSA-41.patch, +files/xen-4-fix_dotconfig-gcc.patch,
86 + +files/xen-tools-4-add-nopie.patch, +files/xen-tools-4-docfix.patch,
87 + +xen-tools-4.2.0-r3.ebuild, +xen-tools-4.2.1-r1.ebuild,
88 + -files/xen-tools-3.4.2-as-needed.patch, files/ipxe-nopie.patch,
89 + xen-tools-4.2.0-r2.ebuild:
90 + revbump;-4.2.0-r3; adjustments to DEPS, implementation of ocaml flag courtesy
91 + of user known as 'a.m' wrt Bug #447716, reconstitution of ipxe-nopie with
92 + subsequent add of -4-add-nopie.patch, new use ocaml added and implemented
93 + (possible to rename), sed statements reduced to patches, 2 sec. patches
94 + applied, build & install of docs corrected/upgrade. 4.2.1-r1; changes mirrored
95 + those to 4.2.0-r3, add of 1 valid sec. patch. Drop un-needed -3.4.2-as-
96 + needed.patch
97
98 24 Jan 2013; Ian Delaney <idella4@g.o> -xen-tools-4.1.2-r2.ebuild,
99 -xen-tools-4.2.0-r1.ebuild, xen-tools-4.2.0-r2.ebuild, xen-tools-4.2.1.ebuild:
100
101
102
103 1.1 app-emulation/xen-tools/xen-tools-4.2.1-r1.ebuild
104
105 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.1-r1.ebuild?rev=1.1&view=markup
106 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.1-r1.ebuild?rev=1.1&content-type=text/plain
107
108 Index: xen-tools-4.2.1-r1.ebuild
109 ===================================================================
110 # Copyright 1999-2013 Gentoo Foundation
111 # Distributed under the terms of the GNU General Public License v2
112 # $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.1-r1.ebuild,v 1.1 2013/01/30 09:09:01 idella4 Exp $
113
114 EAPI=5
115
116 PYTHON_COMPAT=( python{2_6,2_7} )
117 PYTHON_REQ_USE='xml,threads'
118
119 IPXE_TARBALL_URL="http://dev.gentoo.org/~idella4/tarballs/ipxe.tar.gz"
120 XEN_SEABIOS_URL="http://dev.gentoo.org/~idella4/tarballs/seabios-0-20121121.tar.bz2"
121
122 if [[ $PV == *9999 ]]; then
123 KEYWORDS=""
124 REPO="xen-unstable.hg"
125 EHG_REPO_URI="http://xenbits.xensource.com/${REPO}"
126 S="${WORKDIR}/${REPO}"
127 live_eclass="mercurial"
128 else
129 KEYWORDS="~amd64 ~x86"
130 SRC_URI="http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
131 $IPXE_TARBALL_URL
132 $XEN_SEABIOS_URL"
133 S="${WORKDIR}/xen-${PV}"
134 fi
135
136 inherit flag-o-matic eutils multilib python-single-r1 toolchain-funcs udev ${live_eclass}
137
138 DESCRIPTION="Xend daemon and tools"
139 HOMEPAGE="http://xen.org/"
140 DOCS=( README docs/README.xen-bugtool )
141
142 LICENSE="GPL-2"
143 SLOT="0"
144 # TODO soon; ocaml up for a potential name change
145 IUSE="api custom-cflags debug doc flask hvm qemu ocaml pygrub screen static-libs xend"
146
147 REQUIRED_USE="hvm? ( qemu )"
148
149 CDEPEND="<dev-libs/yajl-2
150 dev-python/lxml[${PYTHON_USEDEP}]
151 dev-python/pypam[${PYTHON_USEDEP}]
152 dev-python/pyxml[${PYTHON_USEDEP}]
153 sys-libs/zlib
154 sys-power/iasl
155 ocaml? ( dev-ml/findlib )
156 hvm? ( media-libs/libsdl )
157 ${PYTHON_DEPS}
158 api? ( dev-libs/libxml2
159 net-misc/curl )
160 ${PYTHON_DEPS}
161 pygrub? ( ${PYTHON_DEPS//${PYTHON_REQ_USE}/ncurses} )"
162 DEPEND="${CDEPEND}
163 dev-lang/perl
164 app-misc/pax-utils
165 doc? (
166 app-doc/doxygen
167 dev-tex/latex2html[png,gif]
168 media-gfx/transfig
169 media-gfx/graphviz
170 dev-tex/xcolor
171 dev-texlive/texlive-latexextra
172 virtual/latex-base
173 dev-tex/latexmk
174 dev-texlive/texlive-latex
175 dev-texlive/texlive-pictures
176 dev-texlive/texlive-latexrecommended
177 )
178 hvm? ( x11-proto/xproto
179 sys-devel/bin86
180 sys-devel/dev86
181 )"
182 RDEPEND="${CDEPEND}
183 sys-apps/iproute2
184 net-misc/bridge-utils
185 ocaml? ( >=dev-lang/ocaml-3.12.0 )
186 screen? (
187 app-misc/screen
188 app-admin/logrotate
189 )
190 virtual/udev"
191
192 # hvmloader is used to bootstrap a fully virtualized kernel
193 # Approved by QA team in bug #144032
194 QA_WX_LOAD="usr/lib/xen/boot/hvmloader"
195
196 RESTRICT="test"
197
198 pkg_setup() {
199 python-single-r1_pkg_setup
200 export "CONFIG_LOMOUNT=y"
201
202 if has_version dev-libs/libgcrypt; then
203 export "CONFIG_GCRYPT=y"
204 fi
205
206 if use qemu; then
207 export "CONFIG_IOEMU=y"
208 else
209 export "CONFIG_IOEMU=n"
210 fi
211
212 if ! use x86 && ! has x86 $(get_all_abis) && use hvm; then
213 eerror "HVM (VT-x and AMD-v) cannot be built on this system. An x86 or"
214 eerror "an amd64 multilib profile is required. Remove the hvm use flag"
215 eerror "to build xen-tools on your current profile."
216 die "USE=hvm is unsupported on this system."
217 fi
218
219 if [[ -z ${XEN_TARGET_ARCH} ]] ; then
220 if use x86 && use amd64; then
221 die "Confusion! Both x86 and amd64 are set in your use flags!"
222 elif use x86; then
223 export XEN_TARGET_ARCH="x86_32"
224 elif use amd64 ; then
225 export XEN_TARGET_ARCH="x86_64"
226 else
227 die "Unsupported architecture!"
228 fi
229 fi
230
231 use api && export "LIBXENAPI_BINDINGS=y"
232 use flask && export "FLASK_ENABLE=y"
233 }
234
235 src_prepare() {
236 # Drop .config, fixes to gcc-4.6
237 epatch "${FILESDIR}"/${PN/-tools/}-4-fix_dotconfig-gcc.patch
238
239 # Xend
240 if ! use xend; then
241 sed -e 's:xm xen-bugtool xen-python-path xend:xen-bugtool xen-python-path:' \
242 -i tools/misc/Makefile || die "Disabling xend failed"
243 sed -e 's:^XEND_INITD:#XEND_INITD:' \
244 -i tools/examples/Makefile || die "Disabling xend failed"
245 fi
246
247 # if the user *really* wants to use their own custom-cflags, let them
248 if use custom-cflags; then
249 einfo "User wants their own CFLAGS - removing defaults"
250
251 # try and remove all the default cflags
252 find "${S}" \( -name Makefile -o -name Rules.mk -o -name Config.mk \) \
253 -exec sed \
254 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
255 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
256 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
257 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
258 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
259 -i {} + || die "failed to re-set custom-cflags"
260 fi
261
262 if ! use pygrub; then
263 sed -e '/^SUBDIRS-$(PYTHON_TOOLS) += pygrub$/d' -i tools/Makefile || die
264 fi
265
266 # Disable hvm support on systems that don't support x86_32 binaries.
267 if ! use hvm; then
268 sed -e '/^CONFIG_IOEMU := y$/d' -i config/*.mk || die
269 sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die
270 fi
271
272 # Don't bother with qemu, only needed for fully virtualised guests
273 if ! use qemu; then
274 sed -e "/^CONFIG_IOEMU := y$/d" -i config/*.mk || die
275 sed -e "s:install-tools\: tools/ioemu-dir:install-tools\: :g" -i Makefile || die
276 fi
277
278 # Fix texi2html build error with new texi2html
279 epatch "${FILESDIR}"/${PN}-4-docfix.patch
280
281 # Fix network broadcast on bridged networks
282 epatch "${FILESDIR}/${PN}-3.4.0-network-bridge-broadcast.patch"
283
284 # Prevent the downloading of ipxe, seabios
285 epatch "${FILESDIR}"/${PN/-tools/}-4.2.0-anti-download.patch
286 cp "${DISTDIR}"/ipxe.tar.gz tools/firmware/etherboot/ || die
287 mv ../seabios-dir-remote tools/firmware/ || die
288 pushd tools/firmware/ > /dev/null
289 ln -s seabios-dir-remote seabios-dir || die
290 popd > /dev/null
291
292 # Fix bridge by idella4, bug #362575
293 epatch "${FILESDIR}/${PN}-4.1.1-bridge.patch"
294
295 # Don't build ipxe with pie on hardened, Bug #360805
296 if gcc-specs-pie; then
297 cp -f "${FILESDIR}"/ipxe-nopie.patch tools/firmware/etherboot/patches/ || die
298 epatch "${FILESDIR}"/${PN}-4-add-nopie.patch
299 fi
300
301 # Prevent double stripping of files at install
302 epatch "${FILESDIR}"/${PN/-tools/}-4.2.0-nostrip.patch
303
304 # fix jobserver in Makefile
305 epatch "${FILESDIR}"/${PN/-tools/}-4.2.0-jserver.patch
306
307 #Sec patch, currently valid
308 epatch "${FILESDIR}"/xen-4-CVE-2012-6075-XSA-41.patch
309 }
310
311 src_compile() {
312 export VARTEXFONTS="${T}/fonts"
313 local myopt
314 use debug && myopt="${myopt} debug=y"
315
316 use custom-cflags || unset CFLAGS
317 if test-flag-CC -fno-strict-overflow; then
318 append-flags -fno-strict-overflow
319 fi
320
321 unset LDFLAGS
322 unset CFLAGS
323 emake CC="$(tc-getCC)" LD="$(tc-getLD)" -C tools ${myopt}
324
325 use doc && emake -C docs txt html
326 emake -C docs man-pages
327 }
328
329 src_install() {
330 # Override auto-detection in the build system, bug #382573
331 export INITD_DIR=/tmp/init.d
332 export CONFIG_LEAF_DIR=../tmp/default
333
334 # Let the build system compile installed Python modules.
335 local PYTHONDONTWRITEBYTECODE
336 export PYTHONDONTWRITEBYTECODE
337
338 emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" \
339 XEN_PYTHON_NATIVE_INSTALL=y install-tools
340
341 # Fix the remaining Python shebangs.
342 python_fix_shebang "${ED}"
343
344 # Remove RedHat-specific stuff
345 rm -rf "${ED}"tmp || die
346
347 # uncomment lines in xl.conf
348 sed -e 's:^#autoballoon=1:autoballoon=1:' \
349 -e 's:^#lockfile="/var/lock/xl":lockfile="/var/lock/xl":' \
350 -e 's:^#vifscript="vif-bridge":vifscript="vif-bridge":' \
351 -i tools/examples/xl.conf || die
352
353 if use doc; then
354 emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" install-docs
355
356 dohtml -r docs/
357 docinto pdf
358 dodoc ${DOCS[@]}
359 [ -d "${ED}"/usr/share/doc/xen ] && mv "${ED}"/usr/share/doc/xen/* "${ED}"/usr/share/doc/${PF}/html
360 fi
361
362 rm -rf "${ED}"/usr/share/doc/xen/
363 doman docs/man?/*
364
365 if use xend; then
366 newinitd "${FILESDIR}"/xend.initd-r2 xend || die "Couldn't install xen.initd"
367 fi
368 newconfd "${FILESDIR}"/xendomains.confd xendomains
369 newconfd "${FILESDIR}"/xenstored.confd xenstored
370 newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled
371 newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains
372 newinitd "${FILESDIR}"/xenstored.initd xenstored
373 newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
374
375 if use screen; then
376 cat "${FILESDIR}"/xendomains-screen.confd >> "${ED}"/etc/conf.d/xendomains || die
377 cp "${FILESDIR}"/xen-consoles.logrotate "${ED}"/etc/xen/ || die
378 keepdir /var/log/xen-consoles
379 fi
380
381 # For -static-libs wrt Bug 384355
382 if ! use static-libs; then
383 rm -f "${ED}"usr/$(get_libdir)/*.a "${ED}"usr/$(get_libdir)/ocaml/*/*.a
384 fi
385
386 # xend expects these to exist
387 keepdir /var/run/xenstored /var/lib/xenstored /var/xen/dump /var/lib/xen /var/log/xen
388
389 # for xendomains
390 keepdir /etc/xen/auto
391
392 # Temp QA workaround
393 dodir "$(udev_get_udevdir)"
394 mv "${ED}"/etc/udev/* "${ED}/$(udev_get_udevdir)"
395 rm -rf "${ED}"/etc/udev
396
397 # Remove files failing QA AFTER emake installs them, avoiding seeking absent files
398 find "${ED}" \( -name openbios-sparc32 -o -name openbios-sparc64 \
399 -o -name openbios-ppc -o -name palcode-clipper \) -delete || die
400 }
401
402 pkg_postinst() {
403 elog "Official Xen Guide and the unoffical wiki page:"
404 elog " http://www.gentoo.org/doc/en/xen-guide.xml"
405 elog " http://gentoo-wiki.com/HOWTO_Xen_and_Gentoo"
406
407 if [[ "$(scanelf -s __guard -q "${PYTHON}")" ]] ; then
408 echo
409 ewarn "xend may not work when python is built with stack smashing protection (ssp)."
410 ewarn "If 'xm create' fails with '<ProtocolError for /RPC2: -1 >', see bug #141866"
411 ewarn "This problem may be resolved as of Xen 3.0.4, if not post in the bug."
412 fi
413
414 # TODO: we need to have the current Python slot here.
415 if ! has_version "dev-lang/python[ncurses]"; then
416 echo
417 ewarn "NB: Your dev-lang/python is built without USE=ncurses."
418 ewarn "Please rebuild python with USE=ncurses to make use of xenmon.py."
419 fi
420
421 if has_version "sys-apps/iproute2[minimal]"; then
422 echo
423 ewarn "Your sys-apps/iproute2 is built with USE=minimal. Networking"
424 ewarn "will not work until you rebuild iproute2 without USE=minimal."
425 fi
426
427 if ! use hvm; then
428 echo
429 elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
430 elog "support enable the hvm use flag."
431 elog "An x86 or amd64 multilib system is required to build HVM support."
432 echo
433 elog "The qemu use flag has been removed and replaced with hvm."
434 fi
435
436 if use xend; then
437 echo
438 elog "xend capability has been enabled and installed"
439 fi
440
441 if grep -qsF XENSV= "${ROOT}/etc/conf.d/xend"; then
442 echo
443 elog "xensv is broken upstream (Gentoo bug #142011)."
444 elog "Please remove '${ROOT%/}/etc/conf.d/xend', as it is no longer needed."
445 fi
446 }
447
448
449
450 1.1 app-emulation/xen-tools/xen-tools-4.2.0-r3.ebuild
451
452 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.0-r3.ebuild?rev=1.1&view=markup
453 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.0-r3.ebuild?rev=1.1&content-type=text/plain
454
455 Index: xen-tools-4.2.0-r3.ebuild
456 ===================================================================
457 # Copyright 1999-2013 Gentoo Foundation
458 # Distributed under the terms of the GNU General Public License v2
459 # $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.0-r3.ebuild,v 1.1 2013/01/30 09:09:01 idella4 Exp $
460
461 EAPI=5
462
463 PYTHON_COMPAT=( python{2_6,2_7} )
464 PYTHON_REQ_USE='xml,threads'
465
466 IPXE_TARBALL_URL="http://dev.gentoo.org/~idella4/tarballs/ipxe.tar.gz"
467 XEN_SEABIOS_URL="http://dev.gentoo.org/~idella4/tarballs/seabios-0-20121121.tar.bz2"
468
469 if [[ $PV == *9999 ]]; then
470 KEYWORDS=""
471 REPO="xen-unstable.hg"
472 EHG_REPO_URI="http://xenbits.xensource.com/${REPO}"
473 S="${WORKDIR}/${REPO}"
474 live_eclass="mercurial"
475 else
476 KEYWORDS="~amd64 ~x86"
477 SRC_URI="http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
478 $IPXE_TARBALL_URL
479 $XEN_SEABIOS_URL"
480 S="${WORKDIR}/xen-${PV}"
481 fi
482
483 inherit flag-o-matic eutils multilib python-single-r1 toolchain-funcs udev ${live_eclass}
484
485 DESCRIPTION="Xend daemon and tools"
486 HOMEPAGE="http://xen.org/"
487 DOCS=( README docs/README.xen-bugtool )
488
489 LICENSE="GPL-2"
490 SLOT="0"
491 # TODO soon; ocaml up for a potential name change
492 IUSE="api custom-cflags debug doc flask hvm ocaml qemu pygrub screen static-libs xend"
493
494 REQUIRD_USE="hvm? ( qemu )"
495
496 CDEPEND="<dev-libs/yajl-2
497 dev-python/lxml[${PYTHON_USEDEP}]
498 dev-python/pypam[${PYTHON_USEDEP}]
499 dev-python/pyxml[${PYTHON_USEDEP}]
500 sys-libs/zlib
501 sys-power/iasl
502 ocaml? ( dev-ml/findlib )
503 hvm? ( media-libs/libsdl )
504 ${PYTHON_DEPS}
505 api? ( dev-libs/libxml2
506 net-misc/curl )
507 ${PYTHON_DEPS}
508 pygrub? ( ${PYTHON_DEPS//${PYTHON_REQ_USE}/ncurses} )"
509 DEPEND="${CDEPEND}
510 dev-lang/perl
511 app-misc/pax-utils
512 doc? (
513 app-doc/doxygen
514 dev-tex/latex2html[png,gif]
515 media-gfx/transfig
516 media-gfx/graphviz
517 dev-tex/xcolor
518 dev-texlive/texlive-latexextra
519 virtual/latex-base
520 dev-tex/latexmk
521 dev-texlive/texlive-latex
522 dev-texlive/texlive-pictures
523 dev-texlive/texlive-latexrecommended
524 )
525 hvm? ( x11-proto/xproto
526 sys-devel/bin86
527 sys-devel/dev86
528 )"
529 RDEPEND="${CDEPEND}
530 sys-apps/iproute2
531 net-misc/bridge-utils
532 ocaml? ( >=dev-lang/ocaml-3.12.0 )
533 screen? (
534 app-misc/screen
535 app-admin/logrotate
536 )
537 virtual/udev"
538
539 # hvmloader is used to bootstrap a fully virtualized kernel
540 # Approved by QA team in bug #144032
541 QA_WX_LOAD="usr/lib/xen/boot/hvmloader"
542
543 RESTRICT="test"
544
545 pkg_setup() {
546 python-single-r1_pkg_setup
547 export "CONFIG_LOMOUNT=y"
548
549 if has_version dev-libs/libgcrypt; then
550 export "CONFIG_GCRYPT=y"
551 fi
552
553 if use qemu; then
554 export "CONFIG_IOEMU=y"
555 else
556 export "CONFIG_IOEMU=n"
557 fi
558
559 if ! use x86 && ! has x86 $(get_all_abis) && use hvm; then
560 eerror "HVM (VT-x and AMD-v) cannot be built on this system. An x86 or"
561 eerror "an amd64 multilib profile is required. Remove the hvm use flag"
562 eerror "to build xen-tools on your current profile."
563 die "USE=hvm is unsupported on this system."
564 fi
565
566 if [[ -z ${XEN_TARGET_ARCH} ]] ; then
567 if use x86 && use amd64; then
568 die "Confusion! Both x86 and amd64 are set in your use flags!"
569 elif use x86; then
570 export XEN_TARGET_ARCH="x86_32"
571 elif use amd64 ; then
572 export XEN_TARGET_ARCH="x86_64"
573 else
574 die "Unsupported architecture!"
575 fi
576 fi
577
578 use api && export "LIBXENAPI_BINDINGS=y"
579 use flask && export "FLASK_ENABLE=y"
580 }
581
582 src_prepare() {
583 # Drop .config, fixes to gcc-4.6
584 epatch "${FILESDIR}"/${PN/-tools/}-4-fix_dotconfig-gcc.patch
585
586 # Xend
587 if ! use xend; then
588 sed -e 's:xm xen-bugtool xen-python-path xend:xen-bugtool xen-python-path:' \
589 -i tools/misc/Makefile || die "Disabling xend failed"
590 sed -e 's:^XEND_INITD:#XEND_INITD:' \
591 -i tools/examples/Makefile || die "Disabling xend failed"
592 fi
593
594 # if the user *really* wants to use their own custom-cflags, let them
595 if use custom-cflags; then
596 einfo "User wants their own CFLAGS - removing defaults"
597
598 # try and remove all the default cflags
599 find "${S}" \( -name Makefile -o -name Rules.mk -o -name Config.mk \) \
600 -exec sed \
601 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
602 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
603 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
604 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
605 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
606 -i {} + || die "failed to re-set custom-cflags"
607 fi
608
609 if ! use pygrub; then
610 sed -e '/^SUBDIRS-$(PYTHON_TOOLS) += pygrub$/d' -i tools/Makefile || die
611 fi
612
613 # Disable hvm support on systems that don't support x86_32 binaries.
614 if ! use hvm; then
615 sed -e '/^CONFIG_IOEMU := y$/d' -i config/*.mk || die
616 sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die
617 fi
618
619 # Don't bother with qemu, only needed for fully virtualised guests
620 if ! use qemu; then
621 sed -e "/^CONFIG_IOEMU := y$/d" -i config/*.mk || die
622 sed -e "s:install-tools\: tools/ioemu-dir:install-tools\: :g" -i Makefile || die
623 fi
624
625 # Fix texi2html build error with new texi2html
626 epatch "${FILESDIR}"/${PN}-4-docfix.patch
627
628 # Fix network broadcast on bridged networks
629 epatch "${FILESDIR}/${PN}-3.4.0-network-bridge-broadcast.patch"
630
631 # Prevent the downloading of ipxe, seabios
632 epatch "${FILESDIR}"/${P/-tools/}-anti-download.patch
633 cp "${DISTDIR}"/ipxe.tar.gz tools/firmware/etherboot/ || die
634 mv ../seabios-dir-remote tools/firmware/ || die
635 pushd tools/firmware/ > /dev/null
636 ln -s seabios-dir-remote seabios-dir || die
637 popd > /dev/null
638
639 # Fix bridge by idella4, bug #362575
640 epatch "${FILESDIR}/${PN}-4.1.1-bridge.patch"
641
642 # Don't build ipxe with pie on hardened, Bug #360805
643 if gcc-specs-pie; then
644 cp -f "${FILESDIR}"/ipxe-nopie.patch tools/firmware/etherboot/patches/ || die
645 epatch "${FILESDIR}"/${PN}-4-add-nopie.patch
646 fi
647
648 # Prevent double stripping of files at install
649 epatch "${FILESDIR}"/${P/-tools/}-nostrip.patch
650
651 # fix jobserver in Makefile
652 epatch "${FILESDIR}"/${P/-tools/}-jserver.patch
653
654 #Sec patches
655 epatch "${FILESDIR}"/xen-4-CVE-2012-4544-XSA-25.patch \
656 "${FILESDIR}"/xen-4-CVE-2012-6075-XSA-41.patch
657 }
658
659 src_compile() {
660 export VARTEXFONTS="${T}/fonts"
661 local myopt
662 use debug && myopt="${myopt} debug=y"
663
664 use custom-cflags || unset CFLAGS
665 if test-flag-CC -fno-strict-overflow; then
666 append-flags -fno-strict-overflow
667 fi
668
669 unset LDFLAGS
670 unset CFLAGS
671 emake CC="$(tc-getCC)" LD="$(tc-getLD)" -C tools ${myopt}
672
673 use doc && emake -C docs txt html
674 emake -C docs man-pages
675 }
676
677 src_install() {
678 # Override auto-detection in the build system, bug #382573
679 export INITD_DIR=/tmp/init.d
680 export CONFIG_LEAF_DIR=../tmp/default
681
682 # Let the build system compile installed Python modules.
683 local PYTHONDONTWRITEBYTECODE
684 export PYTHONDONTWRITEBYTECODE
685
686 emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" \
687 install-tools
688
689 # Fix the remaining Python shebangs.
690 python_fix_shebang "${D}"
691
692 # Remove RedHat-specific stuff
693 rm -rf "${D}"tmp || die
694
695 # uncomment lines in xl.conf
696 sed -e 's:^#autoballoon=1:autoballoon=1:' \
697 -e 's:^#lockfile="/var/lock/xl":lockfile="/var/lock/xl":' \
698 -e 's:^#vifscript="vif-bridge":vifscript="vif-bridge":' \
699 -i tools/examples/xl.conf || die
700
701 if use doc; then
702 emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs
703
704 dohtml -r docs/html/
705 docinto pdf
706 dodoc ${DOCS[@]}
707 [ -d "${D}"/usr/share/doc/xen ] && mv "${ED}"/usr/share/doc/xen/* "${ED}"/usr/share/doc/${PF}/html
708 fi
709
710 rm -rf "${D}"/usr/share/doc/xen/
711 doman docs/man?/*
712
713 if use xend; then
714 newinitd "${FILESDIR}"/xend.initd-r2 xend || die "Couldn't install xen.initd"
715 fi
716 newconfd "${FILESDIR}"/xendomains.confd xendomains
717 newconfd "${FILESDIR}"/xenstored.confd xenstored
718 newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled
719 newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains
720 newinitd "${FILESDIR}"/xenstored.initd xenstored
721 newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
722
723 if use screen; then
724 cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains || die
725 cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/ || die
726 keepdir /var/log/xen-consoles
727 fi
728
729 # For -static-libs wrt Bug 384355
730 if ! use static-libs; then
731 rm -f "${D}"usr/$(get_libdir)/*.a "${ED}"usr/$(get_libdir)/ocaml/*/*.a
732 fi
733
734 # xend expects these to exist
735 keepdir /var/run/xenstored /var/lib/xenstored /var/xen/dump /var/lib/xen /var/log/xen
736
737 # for xendomains
738 keepdir /etc/xen/auto
739
740 # Temp QA workaround
741 dodir "$(udev_get_udevdir)"
742 mv "${D}"/etc/udev/* "${ED}/$(udev_get_udevdir)"
743 rm -rf "${D}"/etc/udev
744
745 # Remove files failing QA AFTER emake installs them, avoiding seeking absent files
746 find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \
747 -o -name openbios-ppc -o -name palcode-clipper \) -delete || die
748 }
749
750 pkg_postinst() {
751 elog "Official Xen Guide and the unoffical wiki page:"
752 elog " http://www.gentoo.org/doc/en/xen-guide.xml"
753 elog " http://gentoo-wiki.com/HOWTO_Xen_and_Gentoo"
754
755 if [[ "$(scanelf -s __guard -q "${PYTHON}")" ]] ; then
756 echo
757 ewarn "xend may not work when python is built with stack smashing protection (ssp)."
758 ewarn "If 'xm create' fails with '<ProtocolError for /RPC2: -1 >', see bug #141866"
759 ewarn "This problem may be resolved as of Xen 3.0.4, if not post in the bug."
760 fi
761
762 # TODO: we need to have the current Python slot here.
763 if ! has_version "dev-lang/python[ncurses]"; then
764 echo
765 ewarn "NB: Your dev-lang/python is built without USE=ncurses."
766 ewarn "Please rebuild python with USE=ncurses to make use of xenmon.py."
767 fi
768
769 if has_version "sys-apps/iproute2[minimal]"; then
770 echo
771 ewarn "Your sys-apps/iproute2 is built with USE=minimal. Networking"
772 ewarn "will not work until you rebuild iproute2 without USE=minimal."
773 fi
774
775 if ! use hvm; then
776 echo
777 elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
778 elog "support enable the hvm use flag."
779 elog "An x86 or amd64 multilib system is required to build HVM support."
780 echo
781 elog "The qemu use flag has been removed and replaced with hvm."
782 fi
783
784 if use xend; then
785 echo
786 elog "xend capability has been enabled and installed"
787 fi
788
789 if grep -qsF XENSV= "${ROOT}/etc/conf.d/xend"; then
790 echo
791 elog "xensv is broken upstream (Gentoo bug #142011)."
792 elog "Please remove '${ROOT%/}/etc/conf.d/xend', as it is no longer needed."
793 fi
794 }