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.5-r9.ebuild ChangeLog xen-tools-4.5.1-r2.ebuild
Date: Thu, 30 Jul 2015 01:27:48
Message-Id: 20150730012742.B19DC110@oystercatcher.gentoo.org
1 dlan 15/07/30 01:27:42
2
3 Modified: ChangeLog
4 Added: xen-tools-4.2.5-r9.ebuild xen-tools-4.5.1-r2.ebuild
5 Log:
6 security bump, bug 555532; bump ovmf to 2015/06/29, commit cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
7
8 (Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 0xAABEFD55)
9
10 Revision Changes Path
11 1.304 app-emulation/xen-tools/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/ChangeLog?rev=1.304&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/ChangeLog?rev=1.304&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/ChangeLog?r1=1.303&r2=1.304
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v
20 retrieving revision 1.303
21 retrieving revision 1.304
22 diff -u -r1.303 -r1.304
23 --- ChangeLog 12 Jul 2015 14:31:28 -0000 1.303
24 +++ ChangeLog 30 Jul 2015 01:27:42 -0000 1.304
25 @@ -1,6 +1,14 @@
26 # ChangeLog for app-emulation/xen-tools
27 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v 1.303 2015/07/12 14:31:28 dlan Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v 1.304 2015/07/30 01:27:42 dlan Exp $
30 +
31 +*xen-tools-4.5.1-r2 (30 Jul 2015)
32 +*xen-tools-4.2.5-r9 (30 Jul 2015)
33 +
34 + 30 Jul 2015; Yixun Lan <dlan@g.o> +xen-tools-4.2.5-r9.ebuild,
35 + +xen-tools-4.5.1-r2.ebuild:
36 + security bump, bug 555532; bump ovmf to 2015/06/29, commit
37 + cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
38
39 12 Jul 2015; Yixun Lan <dlan@g.o> -xen-tools-4.2.5-r7.ebuild,
40 -xen-tools-4.5.0-r6.ebuild, -xen-tools-4.5.1.ebuild:
41
42
43
44 1.1 app-emulation/xen-tools/xen-tools-4.2.5-r9.ebuild
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.5-r9.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.5-r9.ebuild?rev=1.1&content-type=text/plain
48
49 Index: xen-tools-4.2.5-r9.ebuild
50 ===================================================================
51 # Copyright 1999-2015 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 # $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.2.5-r9.ebuild,v 1.1 2015/07/30 01:27:42 dlan Exp $
54
55 EAPI=5
56
57 PYTHON_COMPAT=( python2_7 )
58 PYTHON_REQ_USE='xml,threads'
59
60 if [[ $PV == *9999 ]]; then
61 KEYWORDS=""
62 REPO="xen-unstable.hg"
63 EHG_REPO_URI="http://xenbits.xensource.com/${REPO}"
64 S="${WORKDIR}/${REPO}"
65 live_eclass="mercurial"
66 else
67 KEYWORDS="~amd64 ~x86"
68 UPSTREAM_VER=9
69 SECURITY_VER=5
70 # xen-tools's gentoo patches tarball
71 GENTOO_VER=1
72 # xen-tools's gentoo patches version which apply to this specific ebuild
73 GENTOO_GPV=0
74 SEABIOS_VER=1.6.3.2
75
76 [[ -n ${UPSTREAM_VER} ]] && \
77 UPSTREAM_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz"
78 [[ -n ${SECURITY_VER} ]] && \
79 SECURITY_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-security-patches-${SECURITY_VER}.tar.xz"
80 [[ -n ${GENTOO_VER} ]] && \
81 GENTOO_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${PN/-tools/}-gentoo-patches-${GENTOO_VER}.tar.xz"
82
83 SRC_URI="http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
84 http://code.coreboot.org/p/seabios/downloads/get/seabios-${SEABIOS_VER}.tar.gz
85 http://dev.gentoo.org/~dlan/distfiles/seabios-${SEABIOS_VER}.tar.gz
86 ${UPSTREAM_PATCHSET_URI}
87 ${SECURITY_PATCHSET_URI}
88 ${GENTOO_PATCHSET_URI}"
89 S="${WORKDIR}/xen-${PV}"
90 fi
91
92 inherit bash-completion-r1 eutils flag-o-matic multilib python-single-r1 toolchain-funcs udev ${live_eclass}
93
94 DESCRIPTION="Xend daemon and tools"
95 HOMEPAGE="http://xen.org/"
96 DOCS=( README docs/README.xen-bugtool )
97
98 LICENSE="GPL-2"
99 SLOT="0"
100 IUSE="api custom-cflags debug doc flask hvm qemu ocaml pygrub screen static-libs system-seabios"
101
102 REQUIRED_USE="hvm? ( qemu )
103 ${PYTHON_REQUIRED_USE}"
104
105 DEPEND="dev-libs/lzo:2
106 dev-libs/glib:2
107 dev-libs/yajl
108 dev-libs/libgcrypt:0
109 dev-python/lxml[${PYTHON_USEDEP}]
110 dev-python/pypam[${PYTHON_USEDEP}]
111 sys-libs/zlib
112 sys-power/iasl
113 system-seabios? ( sys-firmware/seabios )
114 sys-firmware/ipxe
115 dev-ml/findlib
116 hvm? ( media-libs/libsdl )
117 ${PYTHON_DEPS}
118 api? ( dev-libs/libxml2
119 net-misc/curl )
120 ${PYTHON_DEPS}
121 pygrub? ( ${PYTHON_DEPS//${PYTHON_REQ_USE}/ncurses} )
122 sys-devel/bin86
123 sys-devel/dev86
124 dev-lang/perl
125 app-misc/pax-utils
126 doc? (
127 app-doc/doxygen
128 dev-tex/latex2html[png,gif]
129 media-gfx/transfig
130 media-gfx/graphviz
131 dev-tex/xcolor
132 dev-texlive/texlive-latexextra
133 virtual/latex-base
134 dev-tex/latexmk
135 dev-texlive/texlive-latex
136 dev-texlive/texlive-pictures
137 dev-texlive/texlive-latexrecommended
138 )
139 hvm? ( x11-proto/xproto
140 !net-libs/libiscsi )"
141 RDEPEND="sys-apps/iproute2
142 net-misc/bridge-utils
143 ocaml? ( >=dev-lang/ocaml-4 )
144 screen? (
145 app-misc/screen
146 app-admin/logrotate
147 )
148 virtual/udev"
149
150 # hvmloader is used to bootstrap a fully virtualized kernel
151 # Approved by QA team in bug #144032
152 QA_WX_LOAD="usr/lib/xen/boot/hvmloader"
153
154 RESTRICT="test"
155
156 pkg_setup() {
157 python-single-r1_pkg_setup
158 export "CONFIG_LOMOUNT=y"
159
160 #bug 522642, disable compile tools/tests
161 export "CONFIG_TESTS=n"
162
163 if has_version dev-libs/libgcrypt:0; then
164 export "CONFIG_GCRYPT=y"
165 fi
166
167 if use qemu; then
168 export "CONFIG_IOEMU=y"
169 else
170 export "CONFIG_IOEMU=n"
171 fi
172
173 if [[ -z ${XEN_TARGET_ARCH} ]] ; then
174 if use x86 && use amd64; then
175 die "Confusion! Both x86 and amd64 are set in your use flags!"
176 elif use x86; then
177 export XEN_TARGET_ARCH="x86_32"
178 elif use amd64 ; then
179 export XEN_TARGET_ARCH="x86_64"
180 else
181 die "Unsupported architecture!"
182 fi
183 fi
184
185 use api && export "LIBXENAPI_BINDINGS=y"
186 use flask && export "FLASK_ENABLE=y"
187 }
188
189 src_prepare() {
190 # Upstream's patchset
191 if [[ -n ${UPSTREAM_VER} ]]; then
192 einfo "Try to apply Xen Upstream patcheset"
193 EPATCH_SUFFIX="patch" \
194 EPATCH_FORCE="yes" \
195 EPATCH_OPTS="-p1" \
196 epatch "${WORKDIR}"/patches-upstream
197 fi
198
199 # Security patchset
200 if [[ -n ${SECURITY_VER} ]]; then
201 einfo "Try to apply Xen Security patcheset"
202 EPATCH_SUFFIX="patch" \
203 EPATCH_FORCE="yes" \
204 EPATCH_OPTS="-p1" \
205 epatch "${WORKDIR}/patches-security/${PV}"
206 fi
207
208 # Gentoo's patchset
209 if [[ -n ${GENTOO_VER} && -n ${GENTOO_GPV} ]]; then
210 einfo "Try to apply Gentoo specific patcheset"
211 source "${FILESDIR}"/gentoo-patches.conf
212 _gpv=_gpv_${PN/-/_}_${PV//./}_${GENTOO_GPV}
213 for i in ${!_gpv}; do
214 EPATCH_SUFFIX="patch" \
215 EPATCH_FORCE="yes" \
216 epatch "${WORKDIR}"/patches-gentoo/$i
217 done
218 fi
219
220 use system-seabios && epatch "${WORKDIR}"/patches-gentoo/${PN}-4-unbundle-seabios.patch
221
222 if gcc-specs-pie; then
223 epatch "${WORKDIR}"/patches-gentoo/ipxe-nopie.patch
224 fi
225
226 # if the user *really* wants to use their own custom-cflags, let them
227 if use custom-cflags; then
228 einfo "User wants their own CFLAGS - removing defaults"
229
230 # try and remove all the default cflags
231 find "${S}" \( -name Makefile -o -name Rules.mk -o -name Config.mk \) \
232 -exec sed \
233 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
234 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
235 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
236 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
237 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
238 -i {} + || die "failed to re-set custom-cflags"
239 fi
240
241 if ! use pygrub; then
242 sed -e '/^SUBDIRS-$(PYTHON_TOOLS) += pygrub$/d' -i tools/Makefile || die
243 fi
244
245 # Disable hvm support on systems that don't support x86_32 binaries.
246 if ! use hvm; then
247 sed -e '/^CONFIG_IOEMU := y$/d' -i config/*.mk || die
248 sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die
249 # Bug 351648
250 elif ! use x86 && ! has x86 $(get_all_abis); then
251 mkdir -p "${WORKDIR}"/extra-headers/gnu || die
252 touch "${WORKDIR}"/extra-headers/gnu/stubs-32.h || die
253 export CPATH="${WORKDIR}"/extra-headers
254 fi
255
256 # Don't bother with qemu, only needed for fully virtualised guests
257 if ! use qemu; then
258 sed -e "/^CONFIG_IOEMU := y$/d" -i config/*.mk || die
259 sed -e "s:install-tools\: tools/ioemu-dir:install-tools\: :g" -i Makefile || die
260 fi
261
262 mv ../seabios-${SEABIOS_VER} tools/firmware/seabios-dir-remote || die
263 pushd tools/firmware/ > /dev/null
264 ln -s seabios-dir-remote seabios-dir || die
265 popd > /dev/null
266
267 # Reset bash completion dir; Bug 472438
268 sed -e "s:^BASH_COMPLETION_DIR ?= \$(CONFIG_DIR)/bash_completion.d:BASH_COMPLETION_DIR ?= $(get_bashcompdir):" \
269 -i Config.mk || die
270 sed -i -e "/bash-completion/s/xl\.sh/xl/g" tools/libxl/Makefile || die
271
272 # Bug 445986
273 sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' -i tools/firmware/Makefile || die
274
275 # fix QA warning, create /var/run/, /var/lock dynamically
276 sed -i -e "/\$(INSTALL_DIR) \$(DESTDIR)\$(XEN_RUN_DIR)/d" \
277 tools/libxl/Makefile || die
278
279 sed -i -e "/\/var\/run\//d" \
280 tools/xenstore/Makefile \
281 tools/pygrub/Makefile || die
282
283 sed -i -e "/\/var\/lock\/subsys/d" \
284 tools/Makefile || die
285
286 # xencommons, Bug #492332, sed lighter weight than patching
287 sed -e 's:\$QEMU_XEN -xen-domid:test -e "\$QEMU_XEN" \&\& &:' \
288 -i tools/hotplug/Linux/init.d/xencommons || die
289
290 epatch_user
291 }
292
293 src_compile() {
294 export VARTEXFONTS="${T}/fonts"
295 local myopt
296 use debug && myopt="${myopt} debug=y"
297
298 use custom-cflags || unset CFLAGS
299 if test-flag-CC -fno-strict-overflow; then
300 append-flags -fno-strict-overflow
301 fi
302
303 unset LDFLAGS
304 unset CFLAGS
305 emake V=1 CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" -C tools ${myopt}
306
307 use doc && emake -C docs txt html
308 emake -C docs man-pages
309 }
310
311 src_install() {
312 # Override auto-detection in the build system, bug #382573
313 export INITD_DIR=/tmp/init.d
314 export CONFIG_LEAF_DIR=../tmp/default
315
316 # Let the build system compile installed Python modules.
317 local PYTHONDONTWRITEBYTECODE
318 export PYTHONDONTWRITEBYTECODE
319
320 emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" install-tools \
321 XEN_PYTHON_NATIVE_INSTALL=y install-tools
322 # Fix the remaining Python shebangs.
323 python_fix_shebang "${ED}"
324
325 # Remove RedHat-specific stuff
326 rm -rf "${D}"tmp || die
327
328 # uncomment lines in xl.conf
329 sed -e 's:^#autoballoon=1:autoballoon=1:' \
330 -e 's:^#lockfile="/var/lock/xl":lockfile="/var/lock/xl":' \
331 -e 's:^#vifscript="vif-bridge":vifscript="vif-bridge":' \
332 -i tools/examples/xl.conf || die
333
334 if use doc; then
335 emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs
336
337 dohtml -r docs/
338 docinto pdf
339 dodoc ${DOCS[@]}
340 [ -d "${D}"/usr/share/doc/xen ] && mv "${D}"/usr/share/doc/xen/* "${D}"/usr/share/doc/${PF}/html
341 fi
342
343 rm -rf "${D}"/usr/share/doc/xen/
344 doman docs/man?/*
345
346 newconfd "${FILESDIR}"/xendomains.confd xendomains
347 newconfd "${FILESDIR}"/xenstored.confd xenstored
348 newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled
349 newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains
350 newinitd "${FILESDIR}"/xenstored.initd xenstored
351 newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
352 newinitd "${FILESDIR}"/xencommons.initd xencommons
353 newconfd "${FILESDIR}"/xencommons.confd xencommons
354
355 if use screen; then
356 cat "${FILESDIR}"/xendomains-screen.confd >> "${ED}"/etc/conf.d/xendomains || die
357 cp "${FILESDIR}"/xen-consoles.logrotate "${ED}"/etc/xen/ || die
358 keepdir /var/log/xen-consoles
359 fi
360
361 if [[ "${ARCH}" == 'amd64' ]] && use qemu; then
362 mkdir -p "${D}"usr/$(get_libdir)/xen/bin || die
363 mv "${D}"usr/lib/xen/bin/qemu* "${D}"usr/$(get_libdir)/xen/bin/ || die
364 fi
365
366 # For -static-libs wrt Bug 384355
367 if ! use static-libs; then
368 rm -f "${D}"usr/$(get_libdir)/*.a "${D}"usr/$(get_libdir)/ocaml/*/*.a
369 fi
370
371 # xend expects these to exist
372 keepdir /var/lib/xenstored /var/xen/dump /var/lib/xen /var/log/xen
373
374 # for xendomains
375 keepdir /etc/xen/auto
376
377 # Temp QA workaround
378 dodir "$(get_udevdir)"
379 mv "${D}"/etc/udev/* "${D}/$(get_udevdir)"
380 rm -rf "${D}"/etc/udev
381
382 # Remove files failing QA AFTER emake installs them, avoiding seeking absent files
383 find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \
384 -o -name openbios-ppc -o -name palcode-clipper \) -delete || die
385 }
386
387 pkg_postinst() {
388 elog "Official Xen Guide and the offical wiki page:"
389 elog "http://www.gentoo.org/doc/en/xen-gu"${D}"usr/ide.xml"
390 elog "http://wiki.xen.org/wiki/Main_Page"
391 elog ""
392 elog "Recommended to utilise the xencommons script to config sytem at boot."
393 elog "Add by use of rc-update on completion of the install"
394
395 # TODO: we need to have the current Python slot here.
396 if ! has_version "dev-lang/python[ncurses]"; then
397 echo
398 ewarn "NB: Your dev-lang/python is built without USE=ncurses."
399 ewarn "Please rebuild python with USE=ncurses to make use of xenmon.py."
400 fi
401
402 if has_version "sys-apps/iproute2[minimal]"; then
403 echo
404 ewarn "Your sys-apps/iproute2 is built with USE=minimal. Networking"
405 ewarn "will not work until you rebuild iproute2 without USE=minimal."
406 fi
407
408 if ! use hvm; then
409 echo
410 elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
411 elog "support enable the hvm use flag."
412 elog "An x86 or amd64 system is required to build HVM support."
413 fi
414
415 if grep -qsF XENSV= "${ROOT}/etc/conf.d/xend"; then
416 echo
417 elog "xensv is broken upstream (Gentoo bug #142011)."
418 elog "Please remove '${ROOT%/}/etc/conf.d/xend', as it is no longer needed."
419 fi
420 }
421
422
423
424 1.1 app-emulation/xen-tools/xen-tools-4.5.1-r2.ebuild
425
426 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.5.1-r2.ebuild?rev=1.1&view=markup
427 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/xen-tools-4.5.1-r2.ebuild?rev=1.1&content-type=text/plain
428
429 Index: xen-tools-4.5.1-r2.ebuild
430 ===================================================================
431 # Copyright 1999-2015 Gentoo Foundation
432 # Distributed under the terms of the GNU General Public License v2
433 # $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.5.1-r2.ebuild,v 1.1 2015/07/30 01:27:42 dlan Exp $
434
435 EAPI=5
436
437 MY_PV=${PV/_/-}
438
439 PYTHON_COMPAT=( python2_7 )
440 PYTHON_REQ_USE='xml,threads'
441
442 if [[ $PV == *9999 ]]; then
443 KEYWORDS=""
444 REPO="xen-unstable.hg"
445 EHG_REPO_URI="http://xenbits.xensource.com/${REPO}"
446 S="${WORKDIR}/${REPO}"
447 live_eclass="mercurial"
448 else
449 KEYWORDS="~amd64 ~arm ~arm64 -x86"
450 UPSTREAM_VER=0
451 SECURITY_VER=5
452 # xen-tools's gentoo patches tarball
453 GENTOO_VER=4
454 # xen-tools's gentoo patches version which apply to this specific ebuild
455 GENTOO_GPV=0
456 # xen-tools ovmf's patches
457 OVMF_VER=1
458
459 SEABIOS_VER=1.7.5
460 OVMF_PV=20150629
461
462 [[ -n ${UPSTREAM_VER} ]] && \
463 UPSTREAM_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz"
464 [[ -n ${SECURITY_VER} ]] && \
465 SECURITY_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-security-patches-${SECURITY_VER}.tar.xz"
466 [[ -n ${GENTOO_VER} ]] && \
467 GENTOO_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-gentoo-patches-${GENTOO_VER}.tar.xz"
468 [[ -n ${OVMF_VER} ]] && \
469 OVMF_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-ovmf-patches-${OVMF_VER}.tar.xz"
470
471 SRC_URI="http://bits.xensource.com/oss-xen/release/${MY_PV}/xen-${MY_PV}.tar.gz
472 http://code.coreboot.org/p/seabios/downloads/get/seabios-${SEABIOS_VER}.tar.gz
473 http://dev.gentoo.org/~dlan/distfiles/seabios-${SEABIOS_VER}.tar.gz
474 ovmf? ( http://dev.gentoo.org/~dlan/distfiles/ovmf-${OVMF_PV}.tar.bz2
475 ${OVMF_PATCHSET_URI} )
476 ${UPSTREAM_PATCHSET_URI}
477 ${SECURITY_PATCHSET_URI}
478 ${GENTOO_PATCHSET_URI}"
479 S="${WORKDIR}/xen-${MY_PV}"
480 fi
481
482 inherit bash-completion-r1 eutils flag-o-matic multilib python-single-r1 toolchain-funcs udev ${live_eclass}
483
484 DESCRIPTION="Xend daemon and tools"
485 HOMEPAGE="http://xen.org/"
486 DOCS=( README docs/README.xen-bugtool )
487
488 LICENSE="GPL-2"
489 SLOT="0"
490 # Inclusion of IUSE ocaml on stabalizing requires maintainer of ocaml to (get off his hands and) make
491 # >=dev-lang/ocaml-4 stable
492 # Masked in profiles/eapi-5-files instead
493 IUSE="api custom-cflags debug doc flask hvm qemu ocaml ovmf +pam python pygrub screen static-libs system-qemu system-seabios"
494
495 REQUIRED_USE="hvm? ( || ( qemu system-qemu ) )
496 ${PYTHON_REQUIRED_USE}
497 pygrub? ( python )
498 ovmf? ( hvm )
499 qemu? ( !system-qemu )"
500
501 COMMON_DEPEND="
502 dev-libs/lzo:2
503 dev-libs/glib:2
504 dev-libs/yajl
505 dev-libs/libaio
506 dev-libs/libgcrypt:0
507 sys-libs/zlib
508 "
509
510 DEPEND="${COMMON_DEPEND}
511 dev-python/lxml[${PYTHON_USEDEP}]
512 pam? ( dev-python/pypam[${PYTHON_USEDEP}] )
513 hvm? ( media-libs/libsdl )
514 ${PYTHON_DEPS}
515 api? ( dev-libs/libxml2
516 net-misc/curl )
517 pygrub? ( ${PYTHON_DEPS//${PYTHON_REQ_USE}/ncurses} )
518 ovmf? ( ${PYTHON_DEPS//${PYTHON_REQ_USE}/sqlite} )
519 !amd64? ( >=sys-apps/dtc-1.4.0 )
520 amd64? ( sys-devel/bin86
521 system-seabios? ( sys-firmware/seabios )
522 sys-firmware/ipxe
523 sys-devel/dev86
524 sys-power/iasl )
525 dev-lang/perl
526 app-misc/pax-utils
527 dev-python/markdown[${PYTHON_USEDEP}]
528 doc? (
529 app-doc/doxygen
530 dev-tex/latex2html[png,gif]
531 media-gfx/graphviz
532 dev-tex/xcolor
533 media-gfx/transfig
534 dev-texlive/texlive-latexextra
535 virtual/latex-base
536 dev-tex/latexmk
537 dev-texlive/texlive-latex
538 dev-texlive/texlive-pictures
539 dev-texlive/texlive-latexrecommended
540 )
541 hvm? ( x11-proto/xproto
542 !net-libs/libiscsi )
543 qemu? ( x11-libs/pixman )
544 system-qemu? ( app-emulation/qemu[xen] )
545 ocaml? ( dev-ml/findlib
546 >=dev-lang/ocaml-4 )"
547
548 RDEPEND="${COMMON_DEPEND}
549 sys-apps/iproute2
550 net-misc/bridge-utils
551 screen? (
552 app-misc/screen
553 app-admin/logrotate
554 )
555 virtual/udev"
556
557 # hvmloader is used to bootstrap a fully virtualized kernel
558 # Approved by QA team in bug #144032
559 QA_WX_LOAD="usr/lib/xen/boot/hvmloader
560 usr/share/qemu-xen/qemu/s390-ccw.img"
561
562 RESTRICT="test"
563
564 pkg_setup() {
565 python-single-r1_pkg_setup
566 export "CONFIG_LOMOUNT=y"
567
568 #bug 522642, disable compile tools/tests
569 export "CONFIG_TESTS=n"
570
571 if has_version dev-libs/libgcrypt:0; then
572 export "CONFIG_GCRYPT=y"
573 fi
574
575 if [[ -z ${XEN_TARGET_ARCH} ]] ; then
576 if use x86 && use amd64; then
577 die "Confusion! Both x86 and amd64 are set in your use flags!"
578 elif use x86; then
579 export XEN_TARGET_ARCH="x86_32"
580 elif use amd64 ; then
581 export XEN_TARGET_ARCH="x86_64"
582 elif use arm; then
583 export XEN_TARGET_ARCH="arm32"
584 elif use arm64; then
585 export XEN_TARGET_ARCH="arm64"
586 else
587 die "Unsupported architecture!"
588 fi
589 fi
590 }
591
592 src_prepare() {
593 # Upstream's patchset
594 if [[ -n ${UPSTREAM_VER} ]]; then
595 einfo "Try to apply Xen Upstream patcheset"
596 EPATCH_SUFFIX="patch" \
597 EPATCH_FORCE="yes" \
598 EPATCH_OPTS="-p1" \
599 epatch "${WORKDIR}"/patches-upstream
600 fi
601
602 # Security patchset
603 if [[ -n ${SECURITY_VER} ]]; then
604 einfo "Try to apply Xen Security patcheset"
605 EPATCH_SUFFIX="patch" \
606 EPATCH_FORCE="yes" \
607 EPATCH_OPTS="-p1" \
608 epatch "${WORKDIR}/patches-security/${PV}"
609 fi
610
611 # move before Gentoo patch, one patch should apply to seabios, to fix gcc-4.5.x build err
612 mv ../seabios-${SEABIOS_VER} tools/firmware/seabios-dir-remote || die
613 pushd tools/firmware/ > /dev/null
614 ln -s seabios-dir-remote seabios-dir || die
615 popd > /dev/null
616
617 # Gentoo's patchset
618 if [[ -n ${GENTOO_VER} && -n ${GENTOO_GPV} ]]; then
619 einfo "Try to apply Gentoo specific patcheset"
620 source "${FILESDIR}"/gentoo-patches.conf
621 _gpv=_gpv_${PN/-/_}_${PV//./}_${GENTOO_GPV}
622 for i in ${!_gpv}; do
623 EPATCH_SUFFIX="patch" \
624 EPATCH_FORCE="yes" \
625 epatch "${WORKDIR}"/patches-gentoo/$i
626 done
627 fi
628
629 # Ovmf's patchset
630 if [[ -n ${OVMF_VER} ]] && use ovmf; then
631 einfo "Try to apply Ovmf patcheset"
632 pushd "${WORKDIR}"/ovmf-*/ > /dev/null
633 EPATCH_SUFFIX="patch" \
634 EPATCH_FORCE="yes" \
635 EPATCH_OPTS="-p1" \
636 epatch "${WORKDIR}"/patches-ovmf
637 popd > /dev/null
638 mv ../ovmf-${OVMF_PV} tools/firmware/ovmf-dir-remote || die
639 fi
640
641 mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die
642
643 # Fix texi2html build error with new texi2html, qemu.doc.html
644 sed -i -e "/texi2html -monolithic/s/-number//" tools/qemu-xen-traditional/Makefile || die
645
646 use api || sed -e "/SUBDIRS-\$(LIBXENAPI_BINDINGS) += libxen/d" -i tools/Makefile || die
647 sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' \
648 -i tools/firmware/Makefile || die
649
650 # Drop .config, fixes to gcc-4.6
651 sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
652
653 # if the user *really* wants to use their own custom-cflags, let them
654 if use custom-cflags; then
655 einfo "User wants their own CFLAGS - removing defaults"
656
657 # try and remove all the default cflags
658 find "${S}" \( -name Makefile -o -name Rules.mk -o -name Config.mk \) \
659 -exec sed \
660 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
661 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
662 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
663 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
664 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
665 -i {} + || die "failed to re-set custom-cflags"
666 fi
667
668 if ! use pygrub; then
669 sed -e '/^SUBDIRS-y += pygrub/d' -i tools/Makefile || die
670 fi
671
672 if ! use python; then
673 sed -e '/^SUBDIRS-y += python$/d' -i tools/Makefile || die
674 fi
675
676 if ! use hvm; then
677 sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die
678 # Bug 351648
679 elif ! use x86 && ! has x86 $(get_all_abis); then
680 mkdir -p "${WORKDIR}"/extra-headers/gnu || die
681 touch "${WORKDIR}"/extra-headers/gnu/stubs-32.h || die
682 export CPATH="${WORKDIR}"/extra-headers
683 fi
684
685 # Don't bother with qemu, only needed for fully virtualised guests
686 if ! use qemu; then
687 sed -e "s:install-tools\: tools/qemu-xen-traditional-dir:install-tools\: :g" -i Makefile || die
688 fi
689
690 # Reset bash completion dir; Bug 472438
691 sed -e "s:^BASH_COMPLETION_DIR ?= \$(CONFIG_DIR)/bash_completion.d:BASH_COMPLETION_DIR ?= $(get_bashcompdir):" \
692 -i Config.mk || die
693 sed -i -e "/bash-completion/s/xl\.sh/xl/g" tools/libxl/Makefile || die
694
695 # xencommons, Bug #492332, sed lighter weight than patching
696 sed -e 's:\$QEMU_XEN -xen-domid:test -e "\$QEMU_XEN" \&\& &:' \
697 -i tools/hotplug/Linux/init.d/xencommons.in || die
698
699 # respect multilib, usr/lib/libcacard.so.0.0.0
700 sed -e "/^libdir=/s/\/lib/\/$(get_libdir)/" \
701 -i tools/qemu-xen/configure || die
702
703 #bug 518136, don't build 32bit exactuable for nomultilib profile
704 if [[ "${ARCH}" == 'amd64' ]] && ! has_multilib_profile; then
705 sed -i -e "/x86_emulator/d" tools/tests/Makefile || die
706 fi
707
708 # use /var instead of /var/lib, consistat with previous ebuild
709 sed -i -e "/XEN_LOCK_DIR=/s/\$localstatedir/\/var/g" \
710 m4/paths.m4 configure tools/configure || die
711 # use /run instead of /var/run
712 sed -i -e "/XEN_RUN_DIR=/s/\$localstatedir//g" \
713 m4/paths.m4 configure tools/configure || die
714
715 # uncomment lines in xl.conf
716 sed -e 's:^#autoballoon=:autoballoon=:' \
717 -e 's:^#lockfile=:lockfile=:' \
718 -e 's:^#vif.default.script=:vif.default.script=:' \
719 -i tools/examples/xl.conf || die
720
721 epatch_user
722 }
723
724 src_configure() {
725 local myconf="--prefix=${PREFIX}/usr \
726 --libdir=${PREFIX}/usr/$(get_libdir) \
727 --libexecdir=${PREFIX}/usr/libexec \
728 --disable-werror \
729 --disable-xen \
730 --enable-tools \
731 --enable-docs \
732 $(use_with system-qemu) \
733 $(use_enable pam) \
734 $(use_enable api xenapi) \
735 $(use_enable ovmf) \
736 $(use_enable ocaml ocamltools) \
737 "
738 use system-seabios && myconf+=" --with-system-seabios=/usr/share/seabios/bios.bin"
739 use qemu || myconf+=" --with-system-qemu"
740 use amd64 && myconf+=" --enable-qemu-traditional"
741 econf ${myconf}
742 }
743
744 src_compile() {
745 export VARTEXFONTS="${T}/fonts"
746 local myopt
747 use debug && myopt="${myopt} debug=y"
748
749 use custom-cflags || unset CFLAGS
750 if test-flag-CC -fno-strict-overflow; then
751 append-flags -fno-strict-overflow
752 fi
753
754 unset LDFLAGS
755 unset CFLAGS
756 emake V=1 CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" -C tools ${myopt}
757
758 use doc && emake -C docs txt html
759 emake -C docs man-pages
760 }
761
762 src_install() {
763 # Override auto-detection in the build system, bug #382573
764 export INITD_DIR=/tmp/init.d
765 export CONFIG_LEAF_DIR=../tmp/default
766
767 # Let the build system compile installed Python modules.
768 local PYTHONDONTWRITEBYTECODE
769 export PYTHONDONTWRITEBYTECODE
770
771 emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" \
772 XEN_PYTHON_NATIVE_INSTALL=y install-tools
773
774 # Fix the remaining Python shebangs.
775 python_fix_shebang "${D}"
776
777 # Remove RedHat-specific stuff
778 rm -rf "${D}"tmp || die
779
780 if use doc; then
781 emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs
782
783 dohtml -r docs/
784 docinto pdf
785 dodoc ${DOCS[@]}
786 [ -d "${D}"/usr/share/doc/xen ] && mv "${D}"/usr/share/doc/xen/* "${D}"/usr/share/doc/${PF}/html
787 fi
788
789 rm -rf "${D}"/usr/share/doc/xen/
790 doman docs/man?/*
791
792 newconfd "${FILESDIR}"/xendomains.confd xendomains
793 newconfd "${FILESDIR}"/xenstored.confd xenstored
794 newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled
795 newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains
796 newinitd "${FILESDIR}"/xenstored.initd xenstored
797 newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
798 newinitd "${FILESDIR}"/xencommons.initd xencommons
799 newconfd "${FILESDIR}"/xencommons.confd xencommons
800 newinitd "${FILESDIR}"/xenqemudev.initd xenqemudev
801 newconfd "${FILESDIR}"/xenqemudev.confd xenqemudev
802
803 if use screen; then
804 cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains || die
805 cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/ || die
806 keepdir /var/log/xen-consoles
807 fi
808
809 # For -static-libs wrt Bug 384355
810 if ! use static-libs; then
811 rm -f "${D}"usr/$(get_libdir)/*.a "${D}"usr/$(get_libdir)/ocaml/*/*.a
812 fi
813
814 # for xendomains
815 keepdir /etc/xen/auto
816
817 # Temp QA workaround
818 dodir "$(get_udevdir)"
819 mv "${D}"/etc/udev/* "${D}/$(get_udevdir)"
820 rm -rf "${D}"/etc/udev
821
822 # Remove files failing QA AFTER emake installs them, avoiding seeking absent files
823 find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \
824 -o -name openbios-ppc -o -name palcode-clipper \) -delete || die
825 }
826
827 pkg_postinst() {
828 elog "Official Xen Guide and the offical wiki page:"
829 elog "https://wiki.gentoo.org/wiki/Xen"
830 elog "http://wiki.xen.org/wiki/Main_Page"
831 elog ""
832 elog "Recommended to utilise the xencommons script to config sytem At boot"
833 elog "Add by use of rc-update on completion of the install"
834
835 # TODO: we need to have the current Python slot here.
836 if ! has_version "dev-lang/python[ncurses]"; then
837 echo
838 ewarn "NB: Your dev-lang/python is built without USE=ncurses."
839 ewarn "Please rebuild python with USE=ncurses to make use of xenmon.py."
840 fi
841
842 if has_version "sys-apps/iproute2[minimal]"; then
843 echo
844 ewarn "Your sys-apps/iproute2 is built with USE=minimal. Networking"
845 ewarn "will not work until you rebuild iproute2 without USE=minimal."
846 fi
847
848 if ! use hvm; then
849 echo
850 elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
851 elog "support enable the hvm use flag."
852 elog "An x86 or amd64 system is required to build HVM support."
853 fi
854
855 if use qemu; then
856 elog "The qemu-bridge-helper is renamed to the xen-bridge-helper in the in source"
857 elog "build of qemu. This allows for app-emulation/qemu to be emerged concurrently"
858 elog "with the qemu capable xen. It is up to the user to distinguish between and utilise"
859 elog "the qemu-bridge-helper and the xen-bridge-helper. File bugs of any issues that arise"
860 fi
861
862 if grep -qsF XENSV= "${ROOT}/etc/conf.d/xend"; then
863 echo
864 elog "xensv is broken upstream (Gentoo bug #142011)."
865 elog "Please remove '${ROOT%/}/etc/conf.d/xend', as it is no longer needed."
866 fi
867 }