Gentoo Archives: gentoo-commits

From: "Yixun Lan (dlan)" <dlan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/xen-tools: xen-tools-4.2.4-r4.ebuild ChangeLog xen-tools-4.3.2-r3.ebuild metadata.xml xen-tools-4.4.0-r5.ebuild xen-tools-4.4.0-r4.ebuild xen-tools-4.2.4-r3.ebuild
Date: Fri, 23 May 2014 11:00:34
Message-Id: 20140523110030.8FCCA2004E@flycatcher.gentoo.org
1 dlan 14/05/23 11:00:30
2
3 Modified: ChangeLog metadata.xml
4 Added: xen-tools-4.2.4-r4.ebuild xen-tools-4.3.2-r3.ebuild
5 xen-tools-4.4.0-r5.ebuild
6 Removed: xen-tools-4.4.0-r4.ebuild xen-tools-4.2.4-r3.ebuild
7 Log:
8 re-introduce bundled seabios with USE=system-seabios flag, bug #510052, #510492, #510680
9
10 (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 0xAABEFD55)
11
12 Revision Changes Path
13 1.244 app-emulation/xen-tools/ChangeLog
14
15 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/ChangeLog?rev=1.244&view=markup
16 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/ChangeLog?rev=1.244&content-type=text/plain
17 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/ChangeLog?r1=1.243&r2=1.244
18
19 Index: ChangeLog
20 ===================================================================
21 RCS file: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v
22 retrieving revision 1.243
23 retrieving revision 1.244
24 diff -u -r1.243 -r1.244
25 --- ChangeLog 22 May 2014 06:14:50 -0000 1.243
26 +++ ChangeLog 23 May 2014 11:00:30 -0000 1.244
27 @@ -1,6 +1,17 @@
28 # ChangeLog for app-emulation/xen-tools
29 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
30 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v 1.243 2014/05/22 06:14:50 dlan Exp $
31 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v 1.244 2014/05/23 11:00:30 dlan Exp $
32 +
33 +*xen-tools-4.4.0-r5 (23 May 2014)
34 +*xen-tools-4.3.2-r3 (23 May 2014)
35 +*xen-tools-4.2.4-r4 (23 May 2014)
36 +
37 + 23 May 2014; Yixun Lan <dlan@g.o> -xen-tools-4.2.4-r3.ebuild,
38 + +xen-tools-4.2.4-r4.ebuild, +xen-tools-4.3.2-r3.ebuild,
39 + -xen-tools-4.4.0-r4.ebuild, +xen-tools-4.4.0-r5.ebuild,
40 + +files/xen-tools-4-anti-seabios-download.patch:
41 + re-introduce bundled seabios with USE=system-seabios flag, bug #510052,
42 + #510492, #510680
43
44 *xen-tools-4.2.4-r3 (22 May 2014)
45
46
47
48
49 1.21 app-emulation/xen-tools/metadata.xml
50
51 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/metadata.xml?rev=1.21&view=markup
52 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/metadata.xml?rev=1.21&content-type=text/plain
53 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/metadata.xml?r1=1.20&r2=1.21
54
55 Index: metadata.xml
56 ===================================================================
57 RCS file: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/metadata.xml,v
58 retrieving revision 1.20
59 retrieving revision 1.21
60 diff -u -r1.20 -r1.21
61 --- metadata.xml 12 Apr 2014 00:37:09 -0000 1.20
62 +++ metadata.xml 23 May 2014 11:00:30 -0000 1.21
63 @@ -10,6 +10,7 @@
64 <flag name='pygrub'>Install the pygrub boot loader</flag>
65 <flag name='screen'>Enable support for running domain U console in an <pkg>app-misc/screen</pkg> session</flag>
66 <flag name='system-qemu'>Using <pkg>app-emulation/qemu</pkg> instead of the bundled one</flag>
67 + <flag name='system-seabios'>Using <pkg>sys-firmware/seabios</pkg> instead of the bundled one</flag>
68 <flag name='xend'>Enable support the xend and xm to manage xen</flag>
69 <flag name='ocaml'>Enable support for the ocaml language</flag>
70 <flag name='pam'>Enable pam support</flag>
71
72
73
74 1.1 app-emulation/xen-tools/xen-tools-4.2.4-r4.ebuild
75
76 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.4-r4.ebuild?rev=1.1&view=markup
77 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.4-r4.ebuild?rev=1.1&content-type=text/plain
78
79 Index: xen-tools-4.2.4-r4.ebuild
80 ===================================================================
81 # Copyright 1999-2014 Gentoo Foundation
82 # Distributed under the terms of the GNU General Public License v2
83 # $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.4-r4.ebuild,v 1.1 2014/05/23 11:00:30 dlan Exp $
84
85 EAPI=5
86
87 PYTHON_COMPAT=( python{2_6,2_7} )
88 PYTHON_REQ_USE='xml,threads'
89
90 if [[ $PV == *9999 ]]; then
91 KEYWORDS=""
92 REPO="xen-unstable.hg"
93 EHG_REPO_URI="http://xenbits.xensource.com/${REPO}"
94 S="${WORKDIR}/${REPO}"
95 live_eclass="mercurial"
96 else
97 KEYWORDS="~amd64 ~x86"
98 UPSTREAM_VER=1
99 GENTOO_VER=
100 SEABIOS_VER=1.6.3.2
101
102 [[ -n ${UPSTREAM_VER} ]] && \
103 UPSTREAM_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz"
104 [[ -n ${GENTOO_VER} ]] && \
105 GENTOO_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-gentoo-patches-${GENTOO_VER}.tar.xz"
106
107 SRC_URI="http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
108 http://code.coreboot.org/p/seabios/downloads/get/seabios-${SEABIOS_VER}.tar.gz
109 http://dev.gentoo.org/~dlan/distfiles/seabios-${SEABIOS_VER}.tar.gz
110 ${UPSTREAM_PATCHSET_URI}
111 ${GENTOO_PATCHSET_URI}"
112 S="${WORKDIR}/xen-${PV}"
113 fi
114
115 inherit bash-completion-r1 eutils flag-o-matic multilib python-single-r1 toolchain-funcs udev ${live_eclass}
116
117 DESCRIPTION="Xend daemon and tools"
118 HOMEPAGE="http://xen.org/"
119 DOCS=( README docs/README.xen-bugtool )
120
121 LICENSE="GPL-2"
122 SLOT="0"
123 IUSE="api custom-cflags debug doc flask hvm qemu ocaml pygrub screen static-libs xend system-seabios"
124
125 REQUIRED_USE="hvm? ( qemu )
126 ${PYTHON_REQUIRED_USE}"
127
128 DEPEND="dev-libs/lzo:2
129 dev-libs/glib:2
130 dev-libs/yajl
131 dev-libs/libgcrypt:0
132 dev-python/lxml[${PYTHON_USEDEP}]
133 dev-python/pypam[${PYTHON_USEDEP}]
134 sys-libs/zlib
135 sys-power/iasl
136 system-seabios? ( sys-firmware/seabios )
137 sys-firmware/ipxe
138 dev-ml/findlib
139 hvm? ( media-libs/libsdl )
140 ${PYTHON_DEPS}
141 api? ( dev-libs/libxml2
142 net-misc/curl )
143 ${PYTHON_DEPS}
144 pygrub? ( ${PYTHON_DEPS//${PYTHON_REQ_USE}/ncurses} )
145 sys-devel/bin86
146 sys-devel/dev86
147 dev-lang/perl
148 app-misc/pax-utils
149 doc? (
150 app-doc/doxygen
151 dev-tex/latex2html[png,gif]
152 media-gfx/transfig
153 media-gfx/graphviz
154 dev-tex/xcolor
155 dev-texlive/texlive-latexextra
156 virtual/latex-base
157 dev-tex/latexmk
158 dev-texlive/texlive-latex
159 dev-texlive/texlive-pictures
160 dev-texlive/texlive-latexrecommended
161 )
162 hvm? ( x11-proto/xproto
163 !net-libs/libiscsi )"
164 RDEPEND="sys-apps/iproute2
165 net-misc/bridge-utils
166 ocaml? ( >=dev-lang/ocaml-4 )
167 screen? (
168 app-misc/screen
169 app-admin/logrotate
170 )
171 virtual/udev"
172
173 # hvmloader is used to bootstrap a fully virtualized kernel
174 # Approved by QA team in bug #144032
175 QA_WX_LOAD="usr/lib/xen/boot/hvmloader"
176
177 RESTRICT="test"
178
179 pkg_setup() {
180 python-single-r1_pkg_setup
181 export "CONFIG_LOMOUNT=y"
182
183 if has_version dev-libs/libgcrypt:0; then
184 export "CONFIG_GCRYPT=y"
185 fi
186
187 if use qemu; then
188 export "CONFIG_IOEMU=y"
189 else
190 export "CONFIG_IOEMU=n"
191 fi
192
193 if ! use x86 && ! has x86 $(get_all_abis) && use hvm; then
194 eerror "HVM (VT-x and AMD-v) cannot be built on this system. An x86 or"
195 eerror "an amd64 multilib profile is required. Remove the hvm use flag"
196 eerror "to build xen-tools on your current profile."
197 die "USE=hvm is unsupported on this system."
198 fi
199
200 if [[ -z ${XEN_TARGET_ARCH} ]] ; then
201 if use x86 && use amd64; then
202 die "Confusion! Both x86 and amd64 are set in your use flags!"
203 elif use x86; then
204 export XEN_TARGET_ARCH="x86_32"
205 elif use amd64 ; then
206 export XEN_TARGET_ARCH="x86_64"
207 else
208 die "Unsupported architecture!"
209 fi
210 fi
211
212 use api && export "LIBXENAPI_BINDINGS=y"
213 use flask && export "FLASK_ENABLE=y"
214 }
215
216 src_prepare() {
217 # Upstream's patchset
218 if [[ -n ${UPSTREAM_VER} ]]; then
219 EPATCH_SUFFIX="patch" \
220 EPATCH_FORCE="yes" \
221 epatch "${WORKDIR}"/patches-upstream
222 fi
223
224 # Gentoo's patchset
225 if [[ -n ${GENTOO_VER} ]]; then
226 EPATCH_SUFFIX="patch" \
227 EPATCH_FORCE="yes" \
228 epatch "${WORKDIR}"/patches-gentoo
229 fi
230
231 # Drop .config, fixes to gcc-4.6
232 epatch "${FILESDIR}"/${PN/-tools/}-4-fix_dotconfig-gcc.patch
233
234 # Xend
235 if ! use xend; then
236 sed -e 's:xm xen-bugtool xen-python-path xend:xen-bugtool xen-python-path:' \
237 -i tools/misc/Makefile || die "Disabling xend failed"
238 sed -e 's:^XEND_INITD:#XEND_INITD:' \
239 -i tools/examples/Makefile || die "Disabling xend failed"
240 fi
241
242 # if the user *really* wants to use their own custom-cflags, let them
243 if use custom-cflags; then
244 einfo "User wants their own CFLAGS - removing defaults"
245
246 # try and remove all the default cflags
247 find "${S}" \( -name Makefile -o -name Rules.mk -o -name Config.mk \) \
248 -exec sed \
249 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
250 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
251 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
252 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
253 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
254 -i {} + || die "failed to re-set custom-cflags"
255 fi
256
257 if ! use pygrub; then
258 sed -e '/^SUBDIRS-$(PYTHON_TOOLS) += pygrub$/d' -i tools/Makefile || die
259 fi
260
261 # Disable hvm support on systems that don't support x86_32 binaries.
262 if ! use hvm; then
263 sed -e '/^CONFIG_IOEMU := y$/d' -i config/*.mk || die
264 sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die
265 fi
266
267 # Don't bother with qemu, only needed for fully virtualised guests
268 if ! use qemu; then
269 sed -e "/^CONFIG_IOEMU := y$/d" -i config/*.mk || die
270 sed -e "s:install-tools\: tools/ioemu-dir:install-tools\: :g" -i Makefile || die
271 fi
272
273 # Fix texi2html build error with new texi2html, qemu.doc.html
274 epatch "${FILESDIR}"/${PN}-4-docfix.patch \
275 "${FILESDIR}"/${PN}-4-qemu-xen-doc.patch
276
277 # Fix network broadcast on bridged networks
278 epatch "${FILESDIR}/${PN}-3.4.0-network-bridge-broadcast.patch"
279
280 # Bug 496708
281 epatch "${FILESDIR}"/${PN}-4-unbundle-ipxe.patch
282 use system-seabios && epatch "${FILESDIR}"/${PN}-4-unbundle-seabios.patch
283
284 # Fix bridge by idella4, bug #362575
285 epatch "${FILESDIR}/${PN}-4.1.1-bridge.patch"
286
287 # Don't build ipxe with pie on hardened, Bug #360805
288 if gcc-specs-pie; then
289 epatch "${FILESDIR}"/ipxe-nopie.patch
290 fi
291
292 # Prevent double stripping of files at install
293 epatch "${FILESDIR}"/${PN/-tools/}-4.2.0-nostrip.patch
294
295 # fix jobserver in Makefile
296 epatch "${FILESDIR}"/${PN/-tools/}-4.2.0-jserver.patch
297
298 # add missing header, Bug #467200
299 epatch "${FILESDIR}"/xen-4-ulong.patch \
300 "${FILESDIR}"/${PN}-4.2-xen_disk_leak.patch
301
302 # Set dom0-min-mem to kb; Bug #472982
303 epatch "${FILESDIR}"/${PN/-tools/}-4.2-configsxp.patch
304
305 # Bug 463840
306 epatch "${FILESDIR}"/${PN}-4.2.2-install.patch
307 epatch "${FILESDIR}"/${PN}-4.2.2-rt-link.patch
308
309 # Bug 379537
310 epatch "${FILESDIR}"/fix-gold-ld.patch
311
312 # Bug 510976
313 epatch "${FILESDIR}"/${P}-udev-rules.patch
314
315 # bundled seabios
316 epatch "${FILESDIR}"/${PN}-4-anti-seabios-download.patch
317 mv ../seabios-${SEABIOS_VER} tools/firmware/seabios-dir-remote || die
318 pushd tools/firmware/ > /dev/null
319 ln -s seabios-dir-remote seabios-dir || die
320 popd > /dev/null
321
322 # Bug 472438
323 sed -e 's:^BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d:BASH_COMPLETION_DIR ?= $(SHARE_DIR)/bash-completion:' \
324 -i Config.mk || die
325
326 # Bug 445986
327 sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' -i tools/firmware/Makefile || die
328
329 # fix QA warning, create /var/run/, /var/lock dynamically
330 sed -i -e "/\$(INSTALL_DIR) \$(DESTDIR)\$(XEN_RUN_DIR)/d" \
331 tools/libxl/Makefile || die
332
333 sed -i -e "/\/var\/run\//d" \
334 tools/xenstore/Makefile \
335 tools/pygrub/Makefile || die
336
337 sed -i -e "/\/var\/lock\/subsys/d" \
338 tools/Makefile || die
339
340 # xencommons, Bug #492332, sed lighter weight than patching
341 sed -e 's:\$QEMU_XEN -xen-domid:test -e "\$QEMU_XEN" \&\& &:' \
342 -i tools/hotplug/Linux/init.d/xencommons || die
343
344 epatch_user
345 }
346
347 src_compile() {
348 export VARTEXFONTS="${T}/fonts"
349 local myopt
350 use debug && myopt="${myopt} debug=y"
351
352 use custom-cflags || unset CFLAGS
353 if test-flag-CC -fno-strict-overflow; then
354 append-flags -fno-strict-overflow
355 fi
356
357 unset LDFLAGS
358 unset CFLAGS
359 emake V=1 CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" -C tools ${myopt}
360
361 use doc && emake -C docs txt html
362 emake -C docs man-pages
363 }
364
365 src_install() {
366 # Override auto-detection in the build system, bug #382573
367 export INITD_DIR=/tmp/init.d
368 export CONFIG_LEAF_DIR=../tmp/default
369
370 # Let the build system compile installed Python modules.
371 local PYTHONDONTWRITEBYTECODE
372 export PYTHONDONTWRITEBYTECODE
373
374 emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" install-tools \
375 XEN_PYTHON_NATIVE_INSTALL=y install-tools
376 # Fix the remaining Python shebangs.
377 python_fix_shebang "${ED}"
378
379 # Remove RedHat-specific stuff
380 rm -rf "${D}"tmp || die
381
382 # uncomment lines in xl.conf
383 sed -e 's:^#autoballoon=1:autoballoon=1:' \
384 -e 's:^#lockfile="/var/lock/xl":lockfile="/var/lock/xl":' \
385 -e 's:^#vifscript="vif-bridge":vifscript="vif-bridge":' \
386 -i tools/examples/xl.conf || die
387
388 # Reset bash completion dir; Bug 472438
389 mv "${D}"bash-completion "${D}"usr/share/ || die
390
391 if use doc; then
392 emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs
393
394 dohtml -r docs/
395 docinto pdf
396 dodoc ${DOCS[@]}
397 [ -d "${D}"/usr/share/doc/xen ] && mv "${D}"/usr/share/doc/xen/* "${D}"/usr/share/doc/${PF}/html
398 fi
399
400 rm -rf "${D}"/usr/share/doc/xen/
401 doman docs/man?/*
402
403 if use xend; then
404 newinitd "${FILESDIR}"/xend.initd-r2 xend || die "Couldn't install xen.initd"
405 fi
406 newconfd "${FILESDIR}"/xendomains.confd xendomains
407 newconfd "${FILESDIR}"/xenstored.confd xenstored
408 newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled
409 newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains
410 newinitd "${FILESDIR}"/xenstored.initd xenstored
411 newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
412 newinitd "${FILESDIR}"/xencommons.initd xencommons
413 newconfd "${FILESDIR}"/xencommons.confd xencommons
414
415 if use screen; then
416 cat "${FILESDIR}"/xendomains-screen.confd >> "${ED}"/etc/conf.d/xendomains || die
417 cp "${FILESDIR}"/xen-consoles.logrotate "${ED}"/etc/xen/ || die
418 keepdir /var/log/xen-consoles
419 fi
420
421 if [[ "${ARCH}" == 'amd64' ]] && use qemu; then
422 mkdir -p "${D}"usr/$(get_libdir)/xen/bin || die
423 mv "${D}"usr/lib/xen/bin/qemu* "${D}"usr/$(get_libdir)/xen/bin/ || die
424 fi
425
426 # For -static-libs wrt Bug 384355
427 if ! use static-libs; then
428 rm -f "${D}"usr/$(get_libdir)/*.a "${D}"usr/$(get_libdir)/ocaml/*/*.a
429 fi
430
431 # xend expects these to exist
432 keepdir /var/run/xenstored /var/lib/xenstored /var/xen/dump /var/lib/xen /var/log/xen
433
434 # for xendomains
435 keepdir /etc/xen/auto
436
437 # Temp QA workaround
438 dodir "$(udev_get_udevdir)"
439 mv "${D}"/etc/udev/* "${D}/$(udev_get_udevdir)"
440 rm -rf "${D}"/etc/udev
441
442 # Remove files failing QA AFTER emake installs them, avoiding seeking absent files
443 find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \
444 -o -name openbios-ppc -o -name palcode-clipper \) -delete || die
445 }
446
447 pkg_postinst() {
448 elog "Official Xen Guide and the offical wiki page:"
449 elog "http://www.gentoo.org/doc/en/xen-gu"${D}"usr/ide.xml"
450 elog "http://wiki.xen.org/wiki/Main_Page"
451 elog ""
452 elog "Recommended to utilise the xencommons script to config sytem at boot."
453 elog "Add by use of rc-update on completion of the install"
454
455 if [[ "$(scanelf -s __guard -q "${PYTHON}")" ]] ; then
456 echo
457 ewarn "xend may not work when python is built with stack smashing protection (ssp)."
458 ewarn "If 'xm create' fails with '<ProtocolError for /RPC2: -1 >', see bug #141866"
459 ewarn "This problem may be resolved as of Xen 3.0.4, if not post in the bug."
460 fi
461
462 # TODO: we need to have the current Python slot here.
463 if ! has_version "dev-lang/python[ncurses]"; then
464 echo
465 ewarn "NB: Your dev-lang/python is built without USE=ncurses."
466 ewarn "Please rebuild python with USE=ncurses to make use of xenmon.py."
467 fi
468
469 if has_version "sys-apps/iproute2[minimal]"; then
470 echo
471 ewarn "Your sys-apps/iproute2 is built with USE=minimal. Networking"
472 ewarn "will not work until you rebuild iproute2 without USE=minimal."
473 fi
474
475 if ! use hvm; then
476 echo
477 elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
478 elog "support enable the hvm use flag."
479 elog "An x86 or amd64 multilib system is required to build HVM support."
480 fi
481
482 if use xend; then
483 echo
484 elog "xend capability has been enabled and installed"
485 fi
486
487 if grep -qsF XENSV= "${ROOT}/etc/conf.d/xend"; then
488 echo
489 elog "xensv is broken upstream (Gentoo bug #142011)."
490 elog "Please remove '${ROOT%/}/etc/conf.d/xend', as it is no longer needed."
491 fi
492 }
493
494
495
496 1.1 app-emulation/xen-tools/xen-tools-4.3.2-r3.ebuild
497
498 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.3.2-r3.ebuild?rev=1.1&view=markup
499 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.3.2-r3.ebuild?rev=1.1&content-type=text/plain
500
501 Index: xen-tools-4.3.2-r3.ebuild
502 ===================================================================
503 # Copyright 1999-2014 Gentoo Foundation
504 # Distributed under the terms of the GNU General Public License v2
505 # $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.3.2-r3.ebuild,v 1.1 2014/05/23 11:00:30 dlan Exp $
506
507 EAPI=5
508
509 PYTHON_COMPAT=( python{2_6,2_7} )
510 PYTHON_REQ_USE='xml,threads'
511
512 if [[ $PV == *9999 ]]; then
513 KEYWORDS=""
514 REPO="xen-unstable.hg"
515 EHG_REPO_URI="http://xenbits.xensource.com/${REPO}"
516 S="${WORKDIR}/${REPO}"
517 live_eclass="mercurial"
518 else
519 KEYWORDS="~amd64 -x86"
520 UPSTREAM_VER=1
521 GENTOO_VER=
522 SEABIOS_VER=1.7.1-stable-xen
523
524 [[ -n ${UPSTREAM_VER} ]] && \
525 UPSTREAM_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz"
526 [[ -n ${GENTOO_VER} ]] && \
527 GENTOO_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-gentoo-patches-${GENTOO_VER}.tar.xz"
528
529 SRC_URI="http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
530 http://code.coreboot.org/p/seabios/downloads/get/seabios-${SEABIOS_VER}.tar.gz
531 http://dev.gentoo.org/~dlan/distfiles/seabios-${SEABIOS_VER}.tar.gz
532 ${UPSTREAM_PATCHSET_URI}
533 ${GENTOO_PATCHSET_URI}"
534 S="${WORKDIR}/xen-${PV}"
535 fi
536
537 inherit bash-completion-r1 eutils flag-o-matic multilib python-single-r1 toolchain-funcs udev ${live_eclass}
538
539 DESCRIPTION="Xend daemon and tools"
540 HOMEPAGE="http://xen.org/"
541 DOCS=( README docs/README.xen-bugtool )
542
543 LICENSE="GPL-2"
544 SLOT="0"
545 # Inclusion of IUSE ocaml on stabalizing requires maintainer of ocaml to (get off his hands and) make
546 # >=dev-lang/ocaml-4 stable
547 # Masked in profiles/eapi-5-files instead
548 IUSE="api custom-cflags debug doc flask hvm qemu ocaml +pam python pygrub screen static-libs xend system-seabios"
549
550 REQUIRED_USE="hvm? ( qemu )
551 ${PYTHON_REQUIRED_USE}
552 pygrub? ( python )"
553
554 DEPEND="dev-libs/lzo:2
555 dev-libs/glib:2
556 dev-libs/yajl
557 dev-libs/libgcrypt:0
558 dev-python/lxml[${PYTHON_USEDEP}]
559 pam? ( dev-python/pypam[${PYTHON_USEDEP}] )
560 sys-libs/zlib
561 sys-power/iasl
562 system-seabios? ( sys-firmware/seabios )
563 sys-firmware/ipxe
564 hvm? ( media-libs/libsdl )
565 ${PYTHON_DEPS}
566 api? ( dev-libs/libxml2
567 net-misc/curl )
568 pygrub? ( ${PYTHON_DEPS//${PYTHON_REQ_USE}/ncurses} )
569 sys-devel/bin86
570 sys-devel/dev86
571 dev-lang/perl
572 app-misc/pax-utils
573 dev-python/markdown
574 doc? (
575 app-doc/doxygen
576 dev-tex/latex2html[png,gif]
577 media-gfx/graphviz
578 dev-tex/xcolor
579 media-gfx/transfig
580 dev-texlive/texlive-latexextra
581 virtual/latex-base
582 dev-tex/latexmk
583 dev-texlive/texlive-latex
584 dev-texlive/texlive-pictures
585 dev-texlive/texlive-latexrecommended
586 )
587 hvm? ( x11-proto/xproto
588 !net-libs/libiscsi )
589 qemu? ( x11-libs/pixman )
590 ocaml? ( dev-ml/findlib
591 >=dev-lang/ocaml-4 )"
592 RDEPEND="sys-apps/iproute2
593 net-misc/bridge-utils
594 screen? (
595 app-misc/screen
596 app-admin/logrotate
597 )
598 virtual/udev"
599
600 # hvmloader is used to bootstrap a fully virtualized kernel
601 # Approved by QA team in bug #144032
602 QA_WX_LOAD="usr/lib/xen/boot/hvmloader"
603
604 RESTRICT="test"
605
606 pkg_setup() {
607 python-single-r1_pkg_setup
608 export "CONFIG_LOMOUNT=y"
609
610 if has_version dev-libs/libgcrypt:0; then
611 export "CONFIG_GCRYPT=y"
612 fi
613
614 if use qemu; then
615 export "CONFIG_IOEMU=y"
616 else
617 export "CONFIG_IOEMU=n"
618 fi
619
620 if ! use x86 && ! has x86 $(get_all_abis) && use hvm; then
621 eerror "HVM (VT-x and AMD-v) cannot be built on this system. An x86 or"
622 eerror "an amd64 multilib profile is required. Remove the hvm use flag"
623 eerror "to build xen-tools on your current profile."
624 die "USE=hvm is unsupported on this system."
625 fi
626
627 if [[ -z ${XEN_TARGET_ARCH} ]] ; then
628 if use x86 && use amd64; then
629 die "Confusion! Both x86 and amd64 are set in your use flags!"
630 elif use x86; then
631 export XEN_TARGET_ARCH="x86_32"
632 elif use amd64 ; then
633 export XEN_TARGET_ARCH="x86_64"
634 else
635 die "Unsupported architecture!"
636 fi
637 fi
638 }
639
640 src_prepare() {
641 # Upstream's patchset
642 if [[ -n ${UPSTREAM_VER} ]]; then
643 EPATCH_SUFFIX="patch" \
644 EPATCH_FORCE="yes" \
645 epatch "${WORKDIR}"/patches-upstream
646 fi
647
648 # Gentoo's patchset
649 if [[ -n ${GENTOO_VER} ]]; then
650 EPATCH_SUFFIX="patch" \
651 EPATCH_FORCE="yes" \
652 epatch "${WORKDIR}"/patches-gentoo
653 fi
654
655 # Drop .config, fixes to gcc-4.6
656 epatch "${FILESDIR}"/${PN/-tools/}-4.3-fix_dotconfig-gcc.patch
657
658 # Fix texi2html build error with new texi2html, qemu.doc.html
659 epatch "${FILESDIR}"/${PN}-4-docfix.patch \
660 "${FILESDIR}"/${PN}-4-qemu-xen-doc.patch
661
662 # Fix network broadcast on bridged networks
663 epatch "${FILESDIR}/${PN}-3.4.0-network-bridge-broadcast.patch"
664
665 # Bug 496708
666 epatch "${FILESDIR}"/${PN}-4-unbundle-ipxe.patch
667 use system-seabios && epatch "${FILESDIR}"/${PN}-4-unbundle-seabios.patch
668
669 # Fix bridge by idella4, bug #362575
670 epatch "${FILESDIR}/${PN}-4.1.1-bridge.patch"
671
672 # Prevent double stripping of files at install
673 epatch "${FILESDIR}"/${PN/-tools/}-4.2.0-nostrip.patch
674
675 # fix jobserver in Makefile
676 epatch "${FILESDIR}"/${PN/-tools/}-4.3-jserver.patch
677
678 # add missing header
679 epatch "${FILESDIR}"/xen-4-ulong.patch
680
681 # Set dom0-min-mem to kb; Bug #472982
682 epatch "${FILESDIR}"/${PN/-tools/}-4.2-configsxp.patch
683
684 # Bug 477676
685 epatch "${FILESDIR}"/${PN}-4.3-ar-cc.patch
686
687 # Bug 379537
688 epatch "${FILESDIR}"/fix-gold-ld.patch
689
690 # Prevent file collision with qemu package Bug 478064
691 epatch "${FILESDIR}"/qemu-bridge.patch
692 mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die
693
694 # bundled seabios
695 epatch "${FILESDIR}"/${PN}-4-anti-seabios-download.patch
696 mv ../seabios-${SEABIOS_VER} tools/firmware/seabios-dir-remote || die
697 pushd tools/firmware/ > /dev/null
698 ln -s seabios-dir-remote seabios-dir || die
699 popd > /dev/null
700
701 # Xend
702 if ! use xend; then
703 sed -e 's:xm xen-bugtool xen-python-path xend:xen-bugtool xen-python-path:' \
704 -i tools/misc/Makefile || die "Disabling xend failed"
705 sed -e 's:^XEND_INITD:#XEND_INITD:' \
706 -i tools/examples/Makefile || die "Disabling xend failed"
707 fi
708
709 # if the user *really* wants to use their own custom-cflags, let them
710 if use custom-cflags; then
711 einfo "User wants their own CFLAGS - removing defaults"
712
713 # try and remove all the default cflags
714 find "${S}" \( -name Makefile -o -name Rules.mk -o -name Config.mk \) \
715 -exec sed \
716 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
717 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
718 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
719 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
720 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
721 -i {} + || die "failed to re-set custom-cflags"
722 fi
723
724 if ! use pygrub; then
725 sed -e '/^SUBDIRS-y += pygrub/d' -i tools/Makefile || die
726 fi
727
728 if ! use python; then
729 sed -e '/^SUBDIRS-y += python$/d' -i tools/Makefile || die
730 fi
731
732 # Disable hvm support on systems that don't support x86_32 binaries.
733 if ! use hvm; then
734 sed -e '/^CONFIG_IOEMU := y$/d' -i config/*.mk || die
735 sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die
736 fi
737
738 # Don't bother with qemu, only needed for fully virtualised guests
739 if ! use qemu; then
740 sed -e "/^CONFIG_IOEMU := y$/d" -i config/*.mk || die
741 sed -e "s:install-tools\: tools/ioemu-dir:install-tools\: :g" -i Makefile || die
742 fi
743
744 # Bug 472438
745 sed -e 's:^BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d:BASH_COMPLETION_DIR ?= $(SHARE_DIR)/bash-completion:' \
746 -i Config.mk || die
747
748 use flask || sed -e "/SUBDIRS-y += flask/d" -i tools/Makefile || die
749 use api || sed -e "/SUBDIRS-\$(LIBXENAPI_BINDINGS) += libxen/d" -i tools/Makefile || die
750 sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' \
751 -i tools/firmware/Makefile || die
752
753 # xencommons, Bug #492332, sed lighter weight than patching
754 sed -e 's:\$QEMU_XEN -xen-domid:test -e "\$QEMU_XEN" \&\& &:' \
755 -i tools/hotplug/Linux/init.d/xencommons || die
756
757 # Bug 493232 fix from http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1844
758 sed -e 's:bl->argsspace = 7 + :bl->argsspace = 9 + :' \
759 -i tools/libxl/libxl_bootloader.c || die
760
761 # fix QA warning, create /var/run/, /var/lock dynamically
762 sed -i -e "/\$(INSTALL_DIR) \$(DESTDIR)\$(XEN_RUN_DIR)/d" \
763 tools/libxl/Makefile || die
764
765 sed -i -e "/\/var\/run\//d" \
766 tools/xenstore/Makefile \
767 tools/pygrub/Makefile || die
768
769 sed -i -e "/\/var\/lock\/subsys/d" \
770 tools/Makefile || die
771
772 epatch_user
773 }
774
775 src_configure() {
776 local myconf="--prefix=/usr --disable-werror"
777
778 if use ocaml
779 then
780 myconf="${myconf} $(use_enable ocaml ocamltools)"
781 else
782 myconf="${myconf} --disable-ocamltools"
783 fi
784
785 if ! use pam
786 then
787 myconf="${myconf} --disable-pam"
788 fi
789
790 econf ${myconf}
791 }
792
793 src_compile() {
794 export VARTEXFONTS="${T}/fonts"
795 local myopt
796 use debug && myopt="${myopt} debug=y"
797
798 use custom-cflags || unset CFLAGS
799 if test-flag-CC -fno-strict-overflow; then
800 append-flags -fno-strict-overflow
801 fi
802
803 unset LDFLAGS
804 unset CFLAGS
805 emake V=1 CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" -C tools ${myopt}
806
807 use doc && emake -C docs txt html
808 emake -C docs man-pages
809 }
810
811 src_install() {
812 # Override auto-detection in the build system, bug #382573
813 export INITD_DIR=/tmp/init.d
814 export CONFIG_LEAF_DIR=../tmp/default
815
816 # Let the build system compile installed Python modules.
817 local PYTHONDONTWRITEBYTECODE
818 export PYTHONDONTWRITEBYTECODE
819
820 emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" \
821 XEN_PYTHON_NATIVE_INSTALL=y install-tools
822
823 # Fix the remaining Python shebangs.
824 python_fix_shebang "${D}"
825
826 # Remove RedHat-specific stuff
827 rm -rf "${D}"tmp || die
828
829 # uncomment lines in xl.conf
830 sed -e 's:^#autoballoon=1:autoballoon=1:' \
831 -e 's:^#lockfile="/var/lock/xl":lockfile="/var/lock/xl":' \
832 -e 's:^#vifscript="vif-bridge":vifscript="vif-bridge":' \
833 -i tools/examples/xl.conf || die
834
835 # Reset bash completion dir; Bug 472438
836 mv "${D}"bash-completion "${D}"usr/share/ || die
837
838 if use doc; then
839 emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs
840
841 dohtml -r docs/
842 docinto pdf
843 dodoc ${DOCS[@]}
844 [ -d "${D}"/usr/share/doc/xen ] && mv "${D}"/usr/share/doc/xen/* "${D}"/usr/share/doc/${PF}/html
845 fi
846
847 rm -rf "${D}"/usr/share/doc/xen/
848 doman docs/man?/*
849
850 if use xend; then
851 newinitd "${FILESDIR}"/xend.initd-r2 xend || die "Couldn't install xen.initd"
852 fi
853 newconfd "${FILESDIR}"/xendomains.confd xendomains
854 newconfd "${FILESDIR}"/xenstored.confd xenstored
855 newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled
856 newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains
857 newinitd "${FILESDIR}"/xenstored.initd xenstored
858 newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
859 newinitd "${FILESDIR}"/xencommons.initd xencommons
860 newconfd "${FILESDIR}"/xencommons.confd xencommons
861 newinitd "${FILESDIR}"/xenqemudev.initd xenqemudev
862 newconfd "${FILESDIR}"/xenqemudev.confd xenqemudev
863
864 if use screen; then
865 cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains || die
866 cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/ || die
867 keepdir /var/log/xen-consoles
868 fi
869
870 # Move files built with use qemu, Bug #477884
871 if [[ "${ARCH}" == 'amd64' ]] && use qemu; then
872 mkdir -p "${D}"usr/$(get_libdir)/xen/bin || die
873 mv "${D}"usr/lib/xen/bin/* "${D}"usr/$(get_libdir)/xen/bin/ || die
874 fi
875
876 # For -static-libs wrt Bug 384355
877 if ! use static-libs; then
878 rm -f "${D}"usr/$(get_libdir)/*.a "${D}"usr/$(get_libdir)/ocaml/*/*.a
879 fi
880
881 # xend expects these to exist
882 keepdir /var/lib/xenstored /var/xen/dump /var/lib/xen /var/log/xen
883
884 # for xendomains
885 keepdir /etc/xen/auto
886
887 # Temp QA workaround
888 dodir "$(udev_get_udevdir)"
889 mv "${D}"/etc/udev/* "${D}/$(udev_get_udevdir)"
890 rm -rf "${D}"/etc/udev
891
892 # Remove files failing QA AFTER emake installs them, avoiding seeking absent files
893 find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \
894 -o -name openbios-ppc -o -name palcode-clipper \) -delete || die
895 }
896
897 pkg_postinst() {
898 elog "Official Xen Guide and the offical wiki page:"
899 elog "https://wiki.gentoo.org/wiki/Xen"
900 elog "http://wiki.xen.org/wiki/Main_Page"
901 elog ""
902 elog "Recommended to utilise the xencommons script to config sytem At boot"
903 elog "Add by use of rc-update on completion of the install"
904
905 if [[ "$(scanelf -s __guard -q "${PYTHON}")" ]] ; then
906 echo
907 ewarn "xend may not work when python is built with stack smashing protection (ssp)."
908 ewarn "If 'xm create' fails with '<ProtocolError for /RPC2: -1 >', see bug #141866"
909 ewarn "This problem may be resolved as of Xen 3.0.4, if not post in the bug."
910 fi
911
912 # TODO: we need to have the current Python slot here.
913 if ! has_version "dev-lang/python[ncurses]"; then
914 echo
915 ewarn "NB: Your dev-lang/python is built without USE=ncurses."
916 ewarn "Please rebuild python with USE=ncurses to make use of xenmon.py."
917 fi
918
919 if has_version "sys-apps/iproute2[minimal]"; then
920 echo
921 ewarn "Your sys-apps/iproute2 is built with USE=minimal. Networking"
922 ewarn "will not work until you rebuild iproute2 without USE=minimal."
923 fi
924
925 if ! use hvm; then
926 echo
927 elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
928 elog "support enable the hvm use flag."
929 elog "An x86 or amd64 multilib system is required to build HVM support."
930 fi
931
932 if use xend; then
933 elog"";elog "xend capability has been enabled and installed"
934 fi
935
936 if use qemu; then
937 elog "The qemu-bridge-helper is renamed to the xen-bridge-helper in the in source"
938 elog "build of qemu. This allows for app-emulation/qemu to be emerged concurrently"
939 elog "with the qemu capable xen. It is up to the user to distinguish between and utilise"
940 elog "the qemu-bridge-helper and the xen-bridge-helper. File bugs of any issues that arise"
941 fi
942
943 if grep -qsF XENSV= "${ROOT}/etc/conf.d/xend"; then
944 echo
945 elog "xensv is broken upstream (Gentoo bug #142011)."
946 elog "Please remove '${ROOT%/}/etc/conf.d/xend', as it is no longer needed."
947 fi
948 }
949
950
951
952 1.1 app-emulation/xen-tools/xen-tools-4.4.0-r5.ebuild
953
954 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.4.0-r5.ebuild?rev=1.1&view=markup
955 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.4.0-r5.ebuild?rev=1.1&content-type=text/plain
956
957 Index: xen-tools-4.4.0-r5.ebuild
958 ===================================================================
959 # Copyright 1999-2014 Gentoo Foundation
960 # Distributed under the terms of the GNU General Public License v2
961 # $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.4.0-r5.ebuild,v 1.1 2014/05/23 11:00:30 dlan Exp $
962
963 EAPI=5
964
965 MY_PV=${PV/_/-}
966
967 PYTHON_COMPAT=( python2_7 )
968 PYTHON_REQ_USE='xml,threads'
969
970 if [[ $PV == *9999 ]]; then
971 KEYWORDS=""
972 REPO="xen-unstable.hg"
973 EHG_REPO_URI="http://xenbits.xensource.com/${REPO}"
974 S="${WORKDIR}/${REPO}"
975 live_eclass="mercurial"
976 else
977 KEYWORDS="~amd64 ~arm -x86"
978 UPSTREAM_VER=2
979 GENTOO_VER=
980 SEABIOS_VER=1.7.3.1
981
982 [[ -n ${UPSTREAM_VER} ]] && \
983 UPSTRAM_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz"
984 [[ -n ${GENTOO_VER} ]] && \
985 GENTOO_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-gentoo-patches-${GENTOO_VER}.tar.xz"
986
987 SRC_URI="http://bits.xensource.com/oss-xen/release/${MY_PV}/xen-${MY_PV}.tar.gz
988 http://code.coreboot.org/p/seabios/downloads/get/seabios-${SEABIOS_VER}.tar.gz
989 http://dev.gentoo.org/~dlan/distfiles/seabios-${SEABIOS_VER}.tar.gz
990 ${UPSTRAM_PATCHSET_URI}
991 ${GENTOO_PATCHSET_URI}"
992 S="${WORKDIR}/xen-${MY_PV}"
993 fi
994
995 inherit bash-completion-r1 eutils flag-o-matic multilib python-single-r1 toolchain-funcs udev ${live_eclass}
996
997 DESCRIPTION="Xend daemon and tools"
998 HOMEPAGE="http://xen.org/"
999 DOCS=( README docs/README.xen-bugtool )
1000
1001 LICENSE="GPL-2"
1002 SLOT="0"
1003 # Inclusion of IUSE ocaml on stabalizing requires maintainer of ocaml to (get off his hands and) make
1004 # >=dev-lang/ocaml-4 stable
1005 # Masked in profiles/eapi-5-files instead
1006 IUSE="api custom-cflags debug doc flask hvm qemu ocaml +pam python pygrub screen static-libs system-qemu system-seabios"
1007
1008 REQUIRED_USE="hvm? ( || ( qemu system-qemu ) )
1009 ${PYTHON_REQUIRED_USE}
1010 pygrub? ( python )
1011 qemu? ( !system-qemu )"
1012
1013 COMMON_DEPEND="
1014 dev-libs/lzo:2
1015 dev-libs/glib:2
1016 dev-libs/yajl
1017 dev-libs/libaio
1018 dev-libs/libgcrypt:0
1019 sys-libs/zlib
1020 "
1021
1022 DEPEND="${COMMON_DEPEND}
1023 dev-python/lxml[${PYTHON_USEDEP}]
1024 pam? ( dev-python/pypam[${PYTHON_USEDEP}] )
1025 hvm? ( media-libs/libsdl )
1026 ${PYTHON_DEPS}
1027 api? ( dev-libs/libxml2
1028 net-misc/curl )
1029 pygrub? ( ${PYTHON_DEPS//${PYTHON_REQ_USE}/ncurses} )
1030 arm? ( >=sys-apps/dtc-1.4.0 )
1031 !arm? ( sys-devel/bin86
1032 system-seabios? ( sys-firmware/seabios )
1033 sys-firmware/ipxe
1034 sys-devel/dev86
1035 sys-power/iasl )
1036 dev-lang/perl
1037 app-misc/pax-utils
1038 dev-python/markdown
1039 doc? (
1040 app-doc/doxygen
1041 dev-tex/latex2html[png,gif]
1042 media-gfx/graphviz
1043 dev-tex/xcolor
1044 media-gfx/transfig
1045 dev-texlive/texlive-latexextra
1046 virtual/latex-base
1047 dev-tex/latexmk
1048 dev-texlive/texlive-latex
1049 dev-texlive/texlive-pictures
1050 dev-texlive/texlive-latexrecommended
1051 )
1052 hvm? ( x11-proto/xproto
1053 !net-libs/libiscsi )
1054 qemu? ( x11-libs/pixman )
1055 system-qemu? ( app-emulation/qemu[xen] )
1056 ocaml? ( dev-ml/findlib
1057 >=dev-lang/ocaml-4 )"
1058
1059 RDEPEND="${COMMON_DEPEND}
1060 sys-apps/iproute2
1061 net-misc/bridge-utils
1062 screen? (
1063 app-misc/screen
1064 app-admin/logrotate
1065 )
1066 virtual/udev"
1067
1068 # hvmloader is used to bootstrap a fully virtualized kernel
1069 # Approved by QA team in bug #144032
1070 QA_WX_LOAD="usr/lib/xen/boot/hvmloader
1071 usr/share/qemu-xen/qemu/s390-ccw.img"
1072
1073 RESTRICT="test"
1074
1075 pkg_setup() {
1076 python-single-r1_pkg_setup
1077 export "CONFIG_LOMOUNT=y"
1078
1079 if has_version dev-libs/libgcrypt:0; then
1080 export "CONFIG_GCRYPT=y"
1081 fi
1082
1083 if ! use x86 && ! has x86 $(get_all_abis) && use hvm; then
1084 eerror "HVM (VT-x and AMD-v) cannot be built on this system. An x86 or"
1085 eerror "an amd64 multilib profile is required. Remove the hvm use flag"
1086 eerror "to build xen-tools on your current profile."
1087 die "USE=hvm is unsupported on this system."
1088 fi
1089
1090 if [[ -z ${XEN_TARGET_ARCH} ]] ; then
1091 if use x86 && use amd64; then
1092 die "Confusion! Both x86 and amd64 are set in your use flags!"
1093 elif use x86; then
1094 export XEN_TARGET_ARCH="x86_32"
1095 elif use amd64 ; then
1096 export XEN_TARGET_ARCH="x86_64"
1097 elif use arm; then
1098 export XEN_TARGET_ARCH="arm32"
1099 else
1100 die "Unsupported architecture!"
1101 fi
1102 fi
1103 #bug 472438
1104 export BASH_COMPLETION_DIR=/usr/share/bash-completion
1105 }
1106
1107 src_prepare() {
1108 # Upstream's patchset
1109 if [[ -n ${UPSTREAM_VER} ]]; then
1110 EPATCH_SUFFIX="patch" \
1111 EPATCH_FORCE="yes" \
1112 epatch "${WORKDIR}"/patches-upstream
1113 fi
1114
1115 # Gentoo's patchset
1116 if [[ -n ${GENTOO_VER} ]]; then
1117 EPATCH_SUFFIX="patch" \
1118 EPATCH_FORCE="yes" \
1119 epatch "${WORKDIR}"/patches-gentoo
1120 fi
1121
1122 # Fix texi2html build error with new texi2html, qemu.doc.html
1123 epatch "${FILESDIR}"/${PN}-4-docfix.patch
1124
1125 # Fix network broadcast on bridged networks
1126 epatch "${FILESDIR}/${PN}-3.4.0-network-bridge-broadcast.patch"
1127
1128 # Bug 496708
1129 epatch "${FILESDIR}"/${PN}-4-unbundle-ipxe.patch
1130
1131 # Fix bridge by idella4, bug #362575
1132 epatch "${FILESDIR}/${PN}-4.1.1-bridge.patch"
1133
1134 # Prevent double stripping of files at install
1135 epatch "${FILESDIR}"/${PN/-tools/}-4.4-nostrip.patch
1136
1137 # fix jobserver in Makefile
1138 epatch "${FILESDIR}"/${PN/-tools/}-4.3-jserver.patch
1139
1140 # Set dom0-min-mem to kb; Bug #472982
1141 epatch "${FILESDIR}"/${PN/-tools/}-4.2-configsxp.patch
1142
1143 # Bug 477676
1144 epatch "${FILESDIR}"/${PN}-4.3-ar-cc.patch
1145
1146 # Bug 379537
1147 epatch "${FILESDIR}"/fix-gold-ld.patch
1148
1149 # Prevent file collision with qemu package Bug 478064
1150 epatch "${FILESDIR}"/xen-4.4-qemu-bridge.patch
1151 mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die
1152
1153 epatch "${FILESDIR}"/${PN}-4.4-api-fix.patch
1154
1155 # Fix po file collision with app-emulation/qemu, while USE=qemu is enabled, Bug 508302
1156 epatch "${FILESDIR}"/${PN}-4-qemu-fix-po-collision.patch
1157
1158 # bundled seabios
1159 epatch "${FILESDIR}"/${PN}-4-anti-seabios-download.patch
1160 mv ../seabios-${SEABIOS_VER} tools/firmware/seabios-dir-remote || die
1161 pushd tools/firmware/ > /dev/null
1162 ln -s seabios-dir-remote seabios-dir || die
1163 popd > /dev/null
1164
1165 use api || sed -e "/SUBDIRS-\$(LIBXENAPI_BINDINGS) += libxen/d" -i tools/Makefile || die
1166 sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' \
1167 -i tools/firmware/Makefile || die
1168
1169 # Drop .config, fixes to gcc-4.6
1170 sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
1171
1172 # if the user *really* wants to use their own custom-cflags, let them
1173 if use custom-cflags; then
1174 einfo "User wants their own CFLAGS - removing defaults"
1175
1176 # try and remove all the default cflags
1177 find "${S}" \( -name Makefile -o -name Rules.mk -o -name Config.mk \) \
1178 -exec sed \
1179 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
1180 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
1181 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
1182 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
1183 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
1184 -i {} + || die "failed to re-set custom-cflags"
1185 fi
1186
1187 if ! use pygrub; then
1188 sed -e '/^SUBDIRS-y += pygrub/d' -i tools/Makefile || die
1189 fi
1190
1191 if ! use python; then
1192 sed -e '/^SUBDIRS-y += python$/d' -i tools/Makefile || die
1193 fi
1194
1195 # Disable hvm support on systems that don't support x86_32 binaries.
1196 if ! use hvm; then
1197 sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die
1198 fi
1199
1200 # Don't bother with qemu, only needed for fully virtualised guests
1201 if ! use qemu; then
1202 sed -e "s:install-tools\: tools/qemu-xen-traditional-dir:install-tools\: :g" -i Makefile || die
1203 fi
1204
1205 # Bug 472438
1206 sed -e 's:^BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d:BASH_COMPLETION_DIR ?= $(SHARE_DIR)/bash-completion:' \
1207 -i Config.mk || die
1208
1209 # xencommons, Bug #492332, sed lighter weight than patching
1210 sed -e 's:\$QEMU_XEN -xen-domid:test -e "\$QEMU_XEN" \&\& &:' \
1211 -i tools/hotplug/Linux/init.d/xencommons || die
1212
1213 # respect multilib, usr/lib/libcacard.so.0.0.0
1214 sed -e "/^libdir=/s/\/lib/\/$(get_libdir)/" \
1215 -i tools/qemu-xen/configure || die
1216
1217 # fix QA warning, create /var/run/, /var/lock dynamically
1218 sed -i -e "/\$(INSTALL_DIR) \$(DESTDIR)\$(XEN_RUN_DIR)/d" \
1219 tools/libxl/Makefile || die
1220
1221 sed -i -e "/\/var\/run\//d" \
1222 tools/xenstore/Makefile \
1223 tools/pygrub/Makefile || die
1224
1225 sed -i -e "/\/var\/lock\/subsys/d" \
1226 tools/Makefile || die
1227
1228 epatch_user
1229 }
1230
1231 src_configure() {
1232 local myconf="--prefix=/usr \
1233 --libdir=/usr/$(get_libdir) \
1234 --disable-werror \
1235 --disable-xen \
1236 --enable-tools \
1237 --enable-docs \
1238 --disable-qemu-traditional \
1239 $(use_with system-qemu) \
1240 $(use_enable pam) \
1241 $(use_enable api xenapi) \
1242 $(use_enable ocaml ocamltools) \
1243 "
1244 use system-seabios && myconf+=" --with-system-seabios=/usr/share/seabios/bios.bin"
1245 use qemu || myconf+=" --with-system-qemu"
1246 econf ${myconf}
1247 }
1248
1249 src_compile() {
1250 export VARTEXFONTS="${T}/fonts"
1251 local myopt
1252 use debug && myopt="${myopt} debug=y"
1253
1254 use custom-cflags || unset CFLAGS
1255 if test-flag-CC -fno-strict-overflow; then
1256 append-flags -fno-strict-overflow
1257 fi
1258
1259 unset LDFLAGS
1260 unset CFLAGS
1261 emake V=1 CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" -C tools ${myopt}
1262
1263 use doc && emake -C docs txt html
1264 emake -C docs man-pages
1265 }
1266
1267 src_install() {
1268 # Override auto-detection in the build system, bug #382573
1269 export INITD_DIR=/tmp/init.d
1270 export CONFIG_LEAF_DIR=../tmp/default
1271
1272 # Let the build system compile installed Python modules.
1273 local PYTHONDONTWRITEBYTECODE
1274 export PYTHONDONTWRITEBYTECODE
1275
1276 emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" \
1277 XEN_PYTHON_NATIVE_INSTALL=y install-tools
1278
1279 # Fix the remaining Python shebangs.
1280 python_fix_shebang "${D}"
1281
1282 # Remove RedHat-specific stuff
1283 rm -rf "${D}"tmp || die
1284
1285 # uncomment lines in xl.conf
1286 sed -e 's:^#autoballoon=1:autoballoon=1:' \
1287 -e 's:^#lockfile="/var/lock/xl":lockfile="/var/lock/xl":' \
1288 -e 's:^#vifscript="vif-bridge":vifscript="vif-bridge":' \
1289 -i tools/examples/xl.conf || die
1290
1291 # Reset bash completion dir; Bug 472438
1292 mv "${D}"bash-completion "${D}"usr/share/ || die
1293
1294 if use doc; then
1295 emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs
1296
1297 dohtml -r docs/
1298 docinto pdf
1299 dodoc ${DOCS[@]}
1300 [ -d "${D}"/usr/share/doc/xen ] && mv "${D}"/usr/share/doc/xen/* "${D}"/usr/share/doc/${PF}/html
1301 fi
1302
1303 rm -rf "${D}"/usr/share/doc/xen/
1304 doman docs/man?/*
1305
1306 newconfd "${FILESDIR}"/xendomains.confd xendomains
1307 newconfd "${FILESDIR}"/xenstored.confd xenstored
1308 newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled
1309 newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains
1310 newinitd "${FILESDIR}"/xenstored.initd xenstored
1311 newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
1312 newinitd "${FILESDIR}"/xencommons.initd xencommons
1313 newconfd "${FILESDIR}"/xencommons.confd xencommons
1314 newinitd "${FILESDIR}"/xenqemudev.initd xenqemudev
1315 newconfd "${FILESDIR}"/xenqemudev.confd xenqemudev
1316
1317 if use screen; then
1318 cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains || die
1319 cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/ || die
1320 keepdir /var/log/xen-consoles
1321 fi
1322
1323 # Move files built with use qemu, Bug #477884
1324 if [[ "${ARCH}" == 'amd64' ]] && use qemu; then
1325 mkdir -p "${D}"usr/$(get_libdir)/xen/bin || die
1326 mv "${D}"usr/lib/xen/bin/* "${D}"usr/$(get_libdir)/xen/bin/ || die
1327 fi
1328
1329 # For -static-libs wrt Bug 384355
1330 if ! use static-libs; then
1331 rm -f "${D}"usr/$(get_libdir)/*.a "${D}"usr/$(get_libdir)/ocaml/*/*.a
1332 fi
1333
1334 # xend expects these to exist
1335 keepdir /var/lib/xenstored /var/xen/dump /var/lib/xen /var/log/xen
1336
1337 # for xendomains
1338 keepdir /etc/xen/auto
1339
1340 # Temp QA workaround
1341 dodir "$(udev_get_udevdir)"
1342 mv "${D}"/etc/udev/* "${D}/$(udev_get_udevdir)"
1343 rm -rf "${D}"/etc/udev
1344
1345 # Remove files failing QA AFTER emake installs them, avoiding seeking absent files
1346 find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \
1347 -o -name openbios-ppc -o -name palcode-clipper \) -delete || die
1348 }
1349
1350 pkg_postinst() {
1351 elog "Official Xen Guide and the offical wiki page:"
1352 elog "https://wiki.gentoo.org/wiki/Xen"
1353 elog "http://wiki.xen.org/wiki/Main_Page"
1354 elog ""
1355 elog "Recommended to utilise the xencommons script to config sytem At boot"
1356 elog "Add by use of rc-update on completion of the install"
1357
1358 if [[ "$(scanelf -s __guard -q "${PYTHON}")" ]] ; then
1359 echo
1360 ewarn "xend may not work when python is built with stack smashing protection (ssp)."
1361 ewarn "If 'xm create' fails with '<ProtocolError for /RPC2: -1 >', see bug #141866"
1362 ewarn "This problem may be resolved as of Xen 3.0.4, if not post in the bug."
1363 fi
1364
1365 # TODO: we need to have the current Python slot here.
1366 if ! has_version "dev-lang/python[ncurses]"; then
1367 echo
1368 ewarn "NB: Your dev-lang/python is built without USE=ncurses."
1369 ewarn "Please rebuild python with USE=ncurses to make use of xenmon.py."
1370 fi
1371
1372 if has_version "sys-apps/iproute2[minimal]"; then
1373 echo
1374 ewarn "Your sys-apps/iproute2 is built with USE=minimal. Networking"
1375 ewarn "will not work until you rebuild iproute2 without USE=minimal."
1376 fi
1377
1378 if ! use hvm; then
1379 echo
1380 elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
1381 elog "support enable the hvm use flag."
1382 elog "An x86 or amd64 multilib system is required to build HVM support."
1383 fi
1384
1385 if use qemu; then
1386 elog "The qemu-bridge-helper is renamed to the xen-bridge-helper in the in source"
1387 elog "build of qemu. This allows for app-emulation/qemu to be emerged concurrently"
1388 elog "with the qemu capable xen. It is up to the user to distinguish between and utilise"
1389 elog "the qemu-bridge-helper and the xen-bridge-helper. File bugs of any issues that arise"
1390 fi
1391
1392 if grep -qsF XENSV= "${ROOT}/etc/conf.d/xend"; then
1393 echo
1394 elog "xensv is broken upstream (Gentoo bug #142011)."
1395 elog "Please remove '${ROOT%/}/etc/conf.d/xend', as it is no longer needed."
1396 fi
1397 }