Gentoo Archives: gentoo-commits

From: Yixun Lan <dlan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/xen-tools/, app-emulation/xen-tools/files/
Date: Mon, 26 Dec 2016 06:09:08
Message-Id: 1482732541.ea2b45715c75943192933e14b58a348027927f2a.dlan@gentoo
1 commit: ea2b45715c75943192933e14b58a348027927f2a
2 Author: Yixun Lan <dlan <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 26 05:39:15 2016 +0000
4 Commit: Yixun Lan <dlan <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 26 06:09:01 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea2b4571
7
8 app-emulaton/xen-tools: Fix issues with zero-length records in migration v2
9
10 per @cardoe request
11
12 Package-Manager: Portage-2.3.3, Repoman-2.3.1
13
14 app-emulation/xen-tools/Manifest | 1 +
15 app-emulation/xen-tools/files/gentoo-patches.conf | 22 ++
16 app-emulation/xen-tools/xen-tools-4.7.1-r5.ebuild | 460 ++++++++++++++++++++++
17 app-emulation/xen-tools/xen-tools-4.8.0-r1.ebuild | 456 +++++++++++++++++++++
18 4 files changed, 939 insertions(+)
19
20 diff --git a/app-emulation/xen-tools/Manifest b/app-emulation/xen-tools/Manifest
21 index 487e417..9d74946 100644
22 --- a/app-emulation/xen-tools/Manifest
23 +++ b/app-emulation/xen-tools/Manifest
24 @@ -8,5 +8,6 @@ DIST xen-4.7.1.tar.gz 20706864 SHA256 e87f4b0575e78657ee23d31470a15ecf1ce8c3a92a
25 DIST xen-4.8.0.tar.gz 22499917 SHA256 1e15c713ab7ba3bfda8b4a285ed973529364fd1100e6dd5a61f29583dc667b04 SHA512 70b95553f9813573b12e52999a4df8701dec430f23c36a8dc70d25a46bb4bc9234e5b7feb74a04062af4c8d6b6bcfe947d90b2b172416206812e54bac9797454 WHIRLPOOL 1296c25a05e3ab81730a2587ea1c07c7c022f05cfefc580224185c8d5fc9853531031c1292f69eff944ae2752492c4b95f13e160be3c449a7626aeadf1a21102
26 DIST xen-gentoo-patches-7.tar.xz 24148 SHA256 859fb6b69125c0a1079b35a74bb004dce1b04827b05f056a746cc42c1b187557 SHA512 faf2b0ecd67d545366e2af7e7ecab5f808d02354d07f23cbffe1c3cb80dbb5f88cc4aa140d928ad269612e55c41740ff5bf2af3f0a1f16e375d404c3ffa712b1 WHIRLPOOL d75c35fa10dd1f1567a82c5d5cd7ddabc72def6d74ef7095b7bca9ce9adad2b6ff9c88b55bad7cdefe88da027e5c742f9b9dcafce457cf15f408ea35652546f6
27 DIST xen-gentoo-patches-8.tar.xz 24732 SHA256 6e114f3d3bde31f8595a51bd67fafdbb56cbd60793bafad7061fcaaef67f36fb SHA512 05da32f8fca0a9a43d419c2edd01d0c4abe233c0a8cc02e18caf6490ae9938c4302e8e61f7c67339f5fddab412be69504e1f05de895b73ac8b540914745fefd9 WHIRLPOOL 43d5114f455d2465995e9a1bffe5fff1e722540994348d05a3bac5504a970ad6af447f783ddf271a183207c21e75a0b77b6aed0a8ec8c89446e99ec1b377bcbe
28 +DIST xen-gentoo-patches-9.tar.xz 27456 SHA256 67c410d12ef4628a8c0a931e5868b425f2eb4b2f0e307304a75384cbe509734b SHA512 9a797be9dd2392c34b3f6561c2274e116b4f5b114f4520dbbd0b51818c774479ceabb45aa916f93c1a2bc49787f4ca6e6c83bc743baa6bdeef91d77276b20f36 WHIRLPOOL c41cde532726bb55acd05d558b35d575b229d2ee64eba7438f7b196df313f0e44154148c1e47bf6e8c810667b3b237bcfa410371b4bb6f097b981f6b2637ead3
29 DIST xen-ovmf-patches-2.tar.xz 4344 SHA256 495d61d718440057f8b0b54fb57061450dd764c6e87fe5f8bda1785bcddba770 SHA512 0bdc83029a01b613f5c1ca029bd45aebe211c332f09db91a0cc7d6b6f85a81dbbfdc20c62f0d20e973ee41b155a6551a4fad518cb792e1d508bf070e23d6a1d3 WHIRLPOOL 8346d68fa5d2a8e8a5c007b55e2b85cf48df045cc8c4818f09c756d28a52dd856671f37b4a53478e9b96ca9d2eca0c67fd15f009a94d1d2dfed8e83e596d9633
30 DIST xen-security-patches-19.tar.xz 3336 SHA256 497a01fbd20fa45df19b41d337be0a87f4808101ac33cc9649461726abf43720 SHA512 d8a4a8ceeab9e2efedf880e7a2007b312a7f528cdb8fb1f748096621bbdc447ff8ee09b8fbe1aae657ccd7b2557e436cf60f6e70dcaef65e8959204e91f3ec57 WHIRLPOOL 26473bc9d7c2648f78f1fbf722e1ebcf42983d9d0e04d40f66eaad73c5a7ec232a397392dd5f66adb1258c571238a8faf0497ceb468674b93f7f86b91539f9b9
31
32 diff --git a/app-emulation/xen-tools/files/gentoo-patches.conf b/app-emulation/xen-tools/files/gentoo-patches.conf
33 index f3120f4..8c7d58e 100644
34 --- a/app-emulation/xen-tools/files/gentoo-patches.conf
35 +++ b/app-emulation/xen-tools/files/gentoo-patches.conf
36 @@ -89,6 +89,14 @@ _gx036=" xen-tools-4.6-no-stackcheck.patch"
37 # https://lists.gnu.org/archive/html/qemu-devel/2016-09/msg03961.html
38 _gx037=" xen-tools-4.6-increase-stack-size.patch"
39
40 +
41 +#Fix issues with zero-length records in migration v2"
42 +#https://xenbits.xen.org/gitweb/?p=people/andrewcoop/xen.git;a=shortlog;h=refs/heads/tools-fix-zero-length-records
43 +_gx040=" 0001-docs-Clarify-the-expected-behaviour-of-zero-length-r.patch
44 + 0003-tools-libxc-Avoid-generating-inappropriate-zero-leng.patch
45 + 0002-tools-libxc-Tolerate-zero-length-records-in-migratio.patch
46 + 0004-tools-python-Adjust-migration-v2-library-to-warn-abo.patch"
47 +
48 # xen-tools-4.6.4 patches set
49 _gpv_xen_tools_464_0="
50 ${_gx008} ${_gx021}
51 @@ -120,6 +128,13 @@ ${_gx028} ${_gx029} ${_gx036}
52 ${_gx037}
53 "
54
55 +_gpv_xen_tools_471_2="
56 +${_gx008} ${_gx021}
57 +${_gx022} ${_gx017} ${_gx031}
58 +${_gx027} ${_gx032}
59 +${_gx028} ${_gx029} ${_gx036}
60 +${_gx037} ${_gx040}
61 +"
62 # xen-tools-4.8.0 patches set
63 _gpv_xen_tools_480_0="
64 ${_gx008}
65 @@ -128,3 +143,10 @@ ${_gx027} ${_gx032}
66 ${_gx028} ${_gx029}
67 ${_gx037}
68 "
69 +_gpv_xen_tools_480_1="
70 +${_gx008}
71 +${_gx038} ${_gx017} ${_gx039}
72 +${_gx027} ${_gx032}
73 +${_gx028} ${_gx029}
74 +${_gx037} ${_gx040}
75 +"
76
77 diff --git a/app-emulation/xen-tools/xen-tools-4.7.1-r5.ebuild b/app-emulation/xen-tools/xen-tools-4.7.1-r5.ebuild
78 new file mode 100644
79 index 00000000..38d0816
80 --- /dev/null
81 +++ b/app-emulation/xen-tools/xen-tools-4.7.1-r5.ebuild
82 @@ -0,0 +1,460 @@
83 +# Copyright 1999-2016 Gentoo Foundation
84 +# Distributed under the terms of the GNU General Public License v2
85 +# $Id$
86 +
87 +EAPI=5
88 +
89 +PYTHON_COMPAT=( python2_7 )
90 +PYTHON_REQ_USE='ncurses,xml,threads'
91 +
92 +inherit eutils bash-completion-r1 flag-o-matic multilib python-single-r1 toolchain-funcs versionator
93 +
94 +MY_PV=${PV/_/-}
95 +MAJOR_V="$(get_version_component_range 1-2)"
96 +
97 +if [[ $PV == *9999 ]]; then
98 + inherit git-r3
99 + KEYWORDS=""
100 + REPO="xen.git"
101 + EGIT_REPO_URI="git://xenbits.xen.org/${REPO}"
102 + S="${WORKDIR}/${REPO}"
103 +else
104 + KEYWORDS="~amd64 ~arm ~arm64 ~x86"
105 + UPSTREAM_VER=0
106 + SECURITY_VER=19
107 + # xen-tools's gentoo patches tarball
108 + GENTOO_VER=9
109 + # xen-tools's gentoo patches version which apply to this specific ebuild
110 + GENTOO_GPV=2
111 + # xen-tools ovmf's patches
112 + OVMF_VER=2
113 +
114 + SEABIOS_VER=1.8.2
115 + # OVMF upstream 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
116 + OVMF_PV=20151110
117 +
118 + [[ -n ${UPSTREAM_VER} ]] && \
119 + UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz"
120 + [[ -n ${SECURITY_VER} ]] && \
121 + SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-security-patches-${SECURITY_VER}.tar.xz"
122 + [[ -n ${GENTOO_VER} ]] && \
123 + GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-gentoo-patches-${GENTOO_VER}.tar.xz"
124 + [[ -n ${OVMF_VER} ]] && \
125 + OVMF_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-ovmf-patches-${OVMF_VER}.tar.xz"
126 +
127 + SRC_URI="http://bits.xensource.com/oss-xen/release/${MY_PV}/xen-${MY_PV}.tar.gz
128 + http://code.coreboot.org/p/seabios/downloads/get/seabios-${SEABIOS_VER}.tar.gz
129 + https://dev.gentoo.org/~dlan/distfiles/seabios-${SEABIOS_VER}.tar.gz
130 + ovmf? ( https://dev.gentoo.org/~dlan/distfiles/ovmf-${OVMF_PV}.tar.bz2
131 + ${OVMF_PATCHSET_URI} )
132 + ${UPSTREAM_PATCHSET_URI}
133 + ${SECURITY_PATCHSET_URI}
134 + ${GENTOO_PATCHSET_URI}"
135 +
136 + S="${WORKDIR}/xen-${MY_PV}"
137 +fi
138 +
139 +DESCRIPTION="Xen tools including QEMU and xl"
140 +HOMEPAGE="http://xen.org/"
141 +DOCS=( README docs/README.xen-bugtool )
142 +
143 +LICENSE="GPL-2"
144 +SLOT="0/${MAJOR_V}"
145 +# Inclusion of IUSE ocaml on stabalizing requires maintainer of ocaml to (get off his hands and) make
146 +# >=dev-lang/ocaml-4 stable
147 +# Masked in profiles/eapi-5-files instead
148 +IUSE="api custom-cflags debug doc flask hvm +qemu ocaml ovmf +qemu-traditional +pam python pygrub screen sdl static-libs system-qemu system-seabios"
149 +
150 +REQUIRED_USE="
151 + ${PYTHON_REQUIRED_USE}
152 + pygrub? ( python )
153 + ovmf? ( hvm )
154 + ^^ ( qemu system-qemu )"
155 +
156 +COMMON_DEPEND="
157 + dev-libs/lzo:2
158 + dev-libs/glib:2
159 + dev-libs/yajl
160 + dev-libs/libaio
161 + dev-libs/libgcrypt:0
162 + sys-libs/zlib
163 +"
164 +
165 +DEPEND="${COMMON_DEPEND}
166 + dev-python/lxml[${PYTHON_USEDEP}]
167 + x86? ( sys-devel/dev86
168 + sys-power/iasl )
169 + pam? ( dev-python/pypam[${PYTHON_USEDEP}] )
170 + ${PYTHON_DEPS}
171 + api? ( dev-libs/libxml2
172 + net-misc/curl )
173 + ovmf? (
174 + !arm? ( dev-lang/nasm )
175 + $(python_gen_impl_dep sqlite)
176 + )
177 + !amd64? ( >=sys-apps/dtc-1.4.0 )
178 + amd64? ( sys-devel/bin86
179 + system-seabios? ( sys-firmware/seabios )
180 + sys-firmware/ipxe
181 + sys-devel/dev86
182 + sys-power/iasl )
183 + dev-lang/perl
184 + app-misc/pax-utils
185 + doc? (
186 + app-doc/doxygen
187 + dev-python/markdown[${PYTHON_USEDEP}]
188 + dev-tex/latex2html[png,gif]
189 + media-gfx/graphviz
190 + dev-tex/xcolor
191 + media-gfx/transfig
192 + dev-texlive/texlive-latexextra
193 + virtual/latex-base
194 + dev-tex/latexmk
195 + dev-texlive/texlive-latex
196 + dev-texlive/texlive-pictures
197 + dev-texlive/texlive-latexrecommended
198 + )
199 + hvm? ( x11-proto/xproto
200 + !net-libs/libiscsi )
201 + qemu? (
202 + x11-libs/pixman
203 + sdl? ( media-libs/libsdl[X] )
204 + )
205 + system-qemu? ( app-emulation/qemu[xen] )
206 + ocaml? ( dev-ml/findlib
207 + >=dev-lang/ocaml-4 )"
208 +
209 +RDEPEND="${COMMON_DEPEND}
210 + sys-apps/iproute2[-minimal]
211 + net-misc/bridge-utils
212 + screen? (
213 + app-misc/screen
214 + app-admin/logrotate
215 + )"
216 +
217 +# hvmloader is used to bootstrap a fully virtualized kernel
218 +# Approved by QA team in bug #144032
219 +QA_WX_LOAD="usr/lib/xen/boot/hvmloader
220 + usr/share/qemu-xen/qemu/s390-ccw.img"
221 +
222 +RESTRICT="test"
223 +
224 +pkg_setup() {
225 + python_setup
226 + export "CONFIG_LOMOUNT=y"
227 +
228 + #bug 522642, disable compile tools/tests
229 + export "CONFIG_TESTS=n"
230 +
231 + if has_version dev-libs/libgcrypt:0; then
232 + export "CONFIG_GCRYPT=y"
233 + fi
234 +
235 + if [[ -z ${XEN_TARGET_ARCH} ]] ; then
236 + if use x86 && use amd64; then
237 + die "Confusion! Both x86 and amd64 are set in your use flags!"
238 + elif use x86; then
239 + export XEN_TARGET_ARCH="x86_32"
240 + elif use amd64 ; then
241 + export XEN_TARGET_ARCH="x86_64"
242 + elif use arm; then
243 + export XEN_TARGET_ARCH="arm32"
244 + elif use arm64; then
245 + export XEN_TARGET_ARCH="arm64"
246 + else
247 + die "Unsupported architecture!"
248 + fi
249 + fi
250 +}
251 +
252 +src_prepare() {
253 + # Upstream's patchset
254 + if [[ -n ${UPSTREAM_VER} ]]; then
255 + einfo "Try to apply Xen Upstream patch set"
256 + EPATCH_SUFFIX="patch" \
257 + EPATCH_FORCE="yes" \
258 + EPATCH_OPTS="-p1" \
259 + epatch "${WORKDIR}"/patches-upstream
260 + fi
261 +
262 + # Security patchset
263 + if [[ -n ${SECURITY_VER} ]]; then
264 + einfo "Try to apply Xen Security patch set"
265 + # apply main xen patches
266 + # Two parallel systems, both work side by side
267 + # Over time they may concdense into one. This will suffice for now
268 + EPATCH_SUFFIX="patch"
269 + EPATCH_FORCE="yes"
270 +
271 + source "${WORKDIR}"/patches-security/${PV}.conf
272 +
273 + for i in ${XEN_SECURITY_MAIN}; do
274 + epatch "${WORKDIR}"/patches-security/xen/$i
275 + done
276 +
277 + # apply qemu-xen/upstream patches
278 + pushd "${S}"/tools/qemu-xen/ > /dev/null
279 + for i in ${XEN_SECURITY_QEMUU}; do
280 + epatch "${WORKDIR}"/patches-security/qemuu/$i
281 + done
282 + popd > /dev/null
283 +
284 + # apply qemu-traditional patches
285 + pushd "${S}"/tools/qemu-xen-traditional/ > /dev/null
286 + for i in ${XEN_SECURITY_QEMUT}; do
287 + epatch "${WORKDIR}"/patches-security/qemut/$i
288 + done
289 + popd > /dev/null
290 + fi
291 +
292 + # move before Gentoo patch, one patch should apply to seabios, to fix gcc-4.5.x build err
293 + mv ../seabios-${SEABIOS_VER} tools/firmware/seabios-dir-remote || die
294 + pushd tools/firmware/ > /dev/null
295 + ln -s seabios-dir-remote seabios-dir || die
296 + popd > /dev/null
297 +
298 + # Gentoo's patchset
299 + if [[ -n ${GENTOO_VER} && -n ${GENTOO_GPV} ]]; then
300 + einfo "Try to apply Gentoo specific patch set"
301 + source "${FILESDIR}"/gentoo-patches.conf
302 + _gpv=_gpv_${PN/-/_}_${PV//./}_${GENTOO_GPV}
303 + for i in ${!_gpv}; do
304 + EPATCH_SUFFIX="patch" \
305 + EPATCH_FORCE="yes" \
306 + epatch "${WORKDIR}"/patches-gentoo/$i
307 + done
308 + fi
309 +
310 + # Ovmf's patchset
311 + if use ovmf; then
312 + if [[ -n ${OVMF_VER} ]];then
313 + einfo "Try to apply Ovmf patch set"
314 + pushd "${WORKDIR}"/ovmf-*/ > /dev/null
315 + EPATCH_SUFFIX="patch" \
316 + EPATCH_FORCE="yes" \
317 + EPATCH_OPTS="-p1" \
318 + epatch "${WORKDIR}"/patches-ovmf
319 + popd > /dev/null
320 + fi
321 + mv ../ovmf-${OVMF_PV} tools/firmware/ovmf-dir-remote || die
322 + fi
323 +
324 + mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die
325 +
326 + # Fix texi2html build error with new texi2html, qemu.doc.html
327 + sed -i -e "/texi2html -monolithic/s/-number//" tools/qemu-xen-traditional/Makefile || die
328 +
329 + use api || sed -e "/SUBDIRS-\$(LIBXENAPI_BINDINGS) += libxen/d" -i tools/Makefile || die
330 + sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' \
331 + -i tools/firmware/Makefile || die
332 +
333 + # Drop .config, fixes to gcc-4.6
334 + sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
335 +
336 + # if the user *really* wants to use their own custom-cflags, let them
337 + if use custom-cflags; then
338 + einfo "User wants their own CFLAGS - removing defaults"
339 +
340 + # try and remove all the default cflags
341 + find "${S}" \( -name Makefile -o -name Rules.mk -o -name Config.mk \) \
342 + -exec sed \
343 + -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
344 + -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
345 + -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
346 + -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
347 + -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
348 + -i {} + || die "failed to re-set custom-cflags"
349 + else
350 + unset CFLAGS
351 + unset LDFLAGS
352 + unset ASFLAGS
353 + unset CPPFLAGS
354 + fi
355 +
356 + if ! use pygrub; then
357 + sed -e '/^SUBDIRS-y += pygrub/d' -i tools/Makefile || die
358 + fi
359 +
360 + if ! use python; then
361 + sed -e '/^SUBDIRS-y += python$/d' -i tools/Makefile || die
362 + fi
363 +
364 + if ! use hvm; then
365 + sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die
366 + # Bug 351648
367 + elif ! use x86 && ! has x86 $(get_all_abis); then
368 + mkdir -p "${WORKDIR}"/extra-headers/gnu || die
369 + touch "${WORKDIR}"/extra-headers/gnu/stubs-32.h || die
370 + export CPATH="${WORKDIR}"/extra-headers
371 + fi
372 +
373 + if use qemu; then
374 + if use sdl; then
375 + sed -i -e "s:\$\$source/configure:\0 --enable-sdl:" \
376 + tools/Makefile || die
377 + else
378 + sed -i -e "s:\${QEMU_ROOT\:\-\.}/configure:\0 --disable-sdl:" \
379 + tools/qemu-xen-traditional/xen-setup || die
380 + sed -i -e "s:\$\$source/configure:\0 --disable-sdl:" \
381 + tools/Makefile || die
382 + fi
383 + else
384 + # Don't bother with qemu, only needed for fully virtualised guests
385 + sed -e "s:install-tools\: tools/qemu-xen-traditional-dir:install-tools\: :g" -i Makefile || die
386 + fi
387 +
388 + # Reset bash completion dir; Bug 472438
389 + sed -e "s:^BASH_COMPLETION_DIR ?= \$(CONFIG_DIR)/bash_completion.d:BASH_COMPLETION_DIR ?= $(get_bashcompdir):" \
390 + -i Config.mk || die
391 + sed -i -e "/bash-completion/s/xl\.sh/xl/g" tools/libxl/Makefile || die
392 +
393 + # xencommons, Bug #492332, sed lighter weight than patching
394 + sed -e 's:\$QEMU_XEN -xen-domid:test -e "\$QEMU_XEN" \&\& &:' \
395 + -i tools/hotplug/Linux/init.d/xencommons.in || die
396 +
397 + # respect multilib, usr/lib/libcacard.so.0.0.0
398 + sed -e "/^libdir=/s/\/lib/\/$(get_libdir)/" \
399 + -i tools/qemu-xen/configure || die
400 +
401 + #bug 518136, don't build 32bit exactuable for nomultilib profile
402 + if [[ "${ARCH}" == 'amd64' ]] && ! has_multilib_profile; then
403 + sed -i -e "/x86_emulator/d" tools/tests/Makefile || die
404 + fi
405 +
406 + # use /var instead of /var/lib, consistat with previous ebuild
407 + sed -i -e "/XEN_LOCK_DIR=/s/\$localstatedir/\/var/g" \
408 + m4/paths.m4 configure tools/configure || die
409 + # use /run instead of /var/run
410 + sed -i -e "/XEN_RUN_DIR=/s/\$localstatedir//g" \
411 + m4/paths.m4 configure tools/configure || die
412 +
413 + # uncomment lines in xl.conf
414 + sed -e 's:^#autoballoon=:autoballoon=:' \
415 + -e 's:^#lockfile=:lockfile=:' \
416 + -e 's:^#vif.default.script=:vif.default.script=:' \
417 + -i tools/examples/xl.conf || die
418 +
419 + # Bug #575868 converted to a sed statement, typo of one char
420 + sed -e "s:granter’s:granter's:" -i xen/include/public/grant_table.h || die
421 +
422 + epatch_user
423 +}
424 +
425 +src_configure() {
426 + local myconf="--prefix=${PREFIX}/usr \
427 + --libdir=${PREFIX}/usr/$(get_libdir) \
428 + --libexecdir=${PREFIX}/usr/libexec \
429 + --disable-werror \
430 + --disable-xen \
431 + --enable-tools \
432 + --enable-docs \
433 + $(use_enable pam) \
434 + $(use_enable api xenapi) \
435 + $(use_enable ovmf) \
436 + $(use_enable ocaml ocamltools) \
437 + --with-xenstored=$(usex ocaml 'oxenstored' 'xenstored') \
438 + "
439 +
440 + use system-seabios && myconf+=" --with-system-seabios=/usr/share/seabios/bios.bin"
441 + use system-qemu && myconf+=" --with-system-qemu=/usr/bin/qemu-system-x86_64"
442 + use amd64 && myconf+=" $(use_enable qemu-traditional)"
443 + econf ${myconf}
444 +}
445 +
446 +src_compile() {
447 + export VARTEXFONTS="${T}/fonts"
448 + local myopt
449 + use debug && myopt="${myopt} debug=y"
450 +
451 + if test-flag-CC -fno-strict-overflow; then
452 + append-flags -fno-strict-overflow
453 + fi
454 +
455 + emake V=1 CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" -C tools ${myopt}
456 +
457 + use doc && emake -C docs txt html
458 + emake -C docs man-pages
459 +}
460 +
461 +src_install() {
462 + # Override auto-detection in the build system, bug #382573
463 + export INITD_DIR=/tmp/init.d
464 + export CONFIG_LEAF_DIR=../tmp/default
465 +
466 + # Let the build system compile installed Python modules.
467 + local PYTHONDONTWRITEBYTECODE
468 + export PYTHONDONTWRITEBYTECODE
469 +
470 + emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" \
471 + XEN_PYTHON_NATIVE_INSTALL=y install-tools
472 +
473 + # Fix the remaining Python shebangs.
474 + python_fix_shebang "${D}"
475 +
476 + # Remove RedHat-specific stuff
477 + rm -rf "${D}"tmp || die
478 +
479 + if use doc; then
480 + emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs
481 +
482 + dohtml -r docs/
483 + docinto pdf
484 + dodoc ${DOCS[@]}
485 + [ -d "${D}"/usr/share/doc/xen ] && mv "${D}"/usr/share/doc/xen/* "${D}"/usr/share/doc/${PF}/html
486 + fi
487 +
488 + rm -rf "${D}"/usr/share/doc/xen/
489 + doman docs/man?/*
490 +
491 + newconfd "${FILESDIR}"/xendomains.confd xendomains
492 + newconfd "${FILESDIR}"/xenstored.confd xenstored
493 + newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled
494 + newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains
495 + newinitd "${FILESDIR}"/xenstored.initd xenstored
496 + newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
497 + newinitd "${FILESDIR}"/xencommons.initd xencommons
498 + newconfd "${FILESDIR}"/xencommons.confd xencommons
499 + newinitd "${FILESDIR}"/xenqemudev.initd xenqemudev
500 + newconfd "${FILESDIR}"/xenqemudev.confd xenqemudev
501 +
502 + if use screen; then
503 + cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains || die
504 + cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/ || die
505 + keepdir /var/log/xen-consoles
506 + fi
507 +
508 + # For -static-libs wrt Bug 384355
509 + if ! use static-libs; then
510 + rm -f "${D}"usr/$(get_libdir)/*.a "${D}"usr/$(get_libdir)/ocaml/*/*.a
511 + fi
512 +
513 + # for xendomains
514 + keepdir /etc/xen/auto
515 +
516 + # Remove files failing QA AFTER emake installs them, avoiding seeking absent files
517 + find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \
518 + -o -name openbios-ppc -o -name palcode-clipper \) -delete || die
519 +}
520 +
521 +pkg_postinst() {
522 + elog "Official Xen Guide and the offical wiki page:"
523 + elog "https://wiki.gentoo.org/wiki/Xen"
524 + elog "http://wiki.xen.org/wiki/Main_Page"
525 + elog ""
526 + elog "Recommended to utilise the xencommons script to config sytem At boot"
527 + elog "Add by use of rc-update on completion of the install"
528 +
529 + if ! use hvm; then
530 + echo
531 + elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
532 + elog "support enable the hvm use flag."
533 + elog "An x86 or amd64 system is required to build HVM support."
534 + fi
535 +
536 + if use qemu; then
537 + elog "The qemu-bridge-helper is renamed to the xen-bridge-helper in the in source"
538 + elog "build of qemu. This allows for app-emulation/qemu to be emerged concurrently"
539 + elog "with the qemu capable xen. It is up to the user to distinguish between and utilise"
540 + elog "the qemu-bridge-helper and the xen-bridge-helper. File bugs of any issues that arise"
541 + fi
542 +}
543
544 diff --git a/app-emulation/xen-tools/xen-tools-4.8.0-r1.ebuild b/app-emulation/xen-tools/xen-tools-4.8.0-r1.ebuild
545 new file mode 100644
546 index 00000000..13be2a8
547 --- /dev/null
548 +++ b/app-emulation/xen-tools/xen-tools-4.8.0-r1.ebuild
549 @@ -0,0 +1,456 @@
550 +# Copyright 1999-2016 Gentoo Foundation
551 +# Distributed under the terms of the GNU General Public License v2
552 +# $Id$
553 +
554 +EAPI=5
555 +
556 +PYTHON_COMPAT=( python2_7 )
557 +PYTHON_REQ_USE='ncurses,xml,threads'
558 +
559 +inherit eutils bash-completion-r1 flag-o-matic multilib python-single-r1 toolchain-funcs versionator
560 +
561 +MY_PV=${PV/_/-}
562 +MAJOR_V="$(get_version_component_range 1-2)"
563 +
564 +if [[ $PV == *9999 ]]; then
565 + inherit git-r3
566 + KEYWORDS=""
567 + REPO="xen.git"
568 + EGIT_REPO_URI="git://xenbits.xen.org/${REPO}"
569 + S="${WORKDIR}/${REPO}"
570 +else
571 + KEYWORDS="~amd64 ~arm ~arm64 ~x86"
572 + UPSTREAM_VER=
573 + SECURITY_VER=
574 + # xen-tools's gentoo patches tarball
575 + GENTOO_VER=9
576 + # xen-tools's gentoo patches version which apply to this specific ebuild
577 + GENTOO_GPV=1
578 + # xen-tools ovmf's patches
579 + OVMF_VER=2
580 +
581 + SEABIOS_VER=1.10.0
582 + # OVMF upstream 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
583 + OVMF_PV=20151110
584 +
585 + [[ -n ${UPSTREAM_VER} ]] && \
586 + UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz"
587 + [[ -n ${SECURITY_VER} ]] && \
588 + SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-security-patches-${SECURITY_VER}.tar.xz"
589 + [[ -n ${GENTOO_VER} ]] && \
590 + GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-gentoo-patches-${GENTOO_VER}.tar.xz"
591 + [[ -n ${OVMF_VER} ]] && \
592 + OVMF_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-ovmf-patches-${OVMF_VER}.tar.xz"
593 +
594 + SRC_URI="http://bits.xensource.com/oss-xen/release/${MY_PV}/xen-${MY_PV}.tar.gz
595 + http://code.coreboot.org/p/seabios/downloads/get/seabios-${SEABIOS_VER}.tar.gz
596 + https://dev.gentoo.org/~dlan/distfiles/seabios-${SEABIOS_VER}.tar.gz
597 + ovmf? ( https://dev.gentoo.org/~dlan/distfiles/ovmf-${OVMF_PV}.tar.bz2
598 + ${OVMF_PATCHSET_URI} )
599 + ${UPSTREAM_PATCHSET_URI}
600 + ${SECURITY_PATCHSET_URI}
601 + ${GENTOO_PATCHSET_URI}"
602 +
603 + S="${WORKDIR}/xen-${MY_PV}"
604 +fi
605 +
606 +DESCRIPTION="Xen tools including QEMU and xl"
607 +HOMEPAGE="http://xen.org/"
608 +DOCS=( README docs/README.xen-bugtool )
609 +
610 +LICENSE="GPL-2"
611 +SLOT="0/${MAJOR_V}"
612 +# Inclusion of IUSE ocaml on stabalizing requires maintainer of ocaml to (get off his hands and) make
613 +# >=dev-lang/ocaml-4 stable
614 +# Masked in profiles/eapi-5-files instead
615 +IUSE="api custom-cflags debug doc flask hvm +qemu ocaml ovmf +qemu-traditional +pam python pygrub screen sdl static-libs system-qemu system-seabios"
616 +
617 +REQUIRED_USE="
618 + ${PYTHON_REQUIRED_USE}
619 + pygrub? ( python )
620 + ovmf? ( hvm )
621 + ^^ ( qemu system-qemu )"
622 +
623 +COMMON_DEPEND="
624 + dev-libs/lzo:2
625 + dev-libs/glib:2
626 + dev-libs/yajl
627 + dev-libs/libaio
628 + dev-libs/libgcrypt:0
629 + sys-libs/zlib
630 +"
631 +
632 +DEPEND="${COMMON_DEPEND}
633 + dev-python/lxml[${PYTHON_USEDEP}]
634 + x86? ( sys-devel/dev86
635 + sys-power/iasl )
636 + pam? ( dev-python/pypam[${PYTHON_USEDEP}] )
637 + ${PYTHON_DEPS}
638 + api? ( dev-libs/libxml2
639 + net-misc/curl )
640 + ovmf? (
641 + !arm? ( dev-lang/nasm )
642 + $(python_gen_impl_dep sqlite)
643 + )
644 + !amd64? ( >=sys-apps/dtc-1.4.0 )
645 + amd64? ( sys-devel/bin86
646 + system-seabios? ( sys-firmware/seabios )
647 + sys-firmware/ipxe
648 + sys-devel/dev86
649 + sys-power/iasl )
650 + dev-lang/perl
651 + app-misc/pax-utils
652 + doc? (
653 + app-doc/doxygen
654 + dev-python/markdown[${PYTHON_USEDEP}]
655 + dev-tex/latex2html[png,gif]
656 + media-gfx/graphviz
657 + dev-tex/xcolor
658 + media-gfx/transfig
659 + dev-texlive/texlive-latexextra
660 + virtual/latex-base
661 + dev-tex/latexmk
662 + dev-texlive/texlive-latex
663 + dev-texlive/texlive-pictures
664 + dev-texlive/texlive-latexrecommended
665 + )
666 + hvm? ( x11-proto/xproto
667 + !net-libs/libiscsi )
668 + qemu? (
669 + x11-libs/pixman
670 + sdl? ( media-libs/libsdl[X] )
671 + )
672 + system-qemu? ( app-emulation/qemu[xen] )
673 + ocaml? ( dev-ml/findlib
674 + >=dev-lang/ocaml-4 )"
675 +
676 +RDEPEND="${COMMON_DEPEND}
677 + sys-apps/iproute2[-minimal]
678 + net-misc/bridge-utils
679 + screen? (
680 + app-misc/screen
681 + app-admin/logrotate
682 + )"
683 +
684 +# hvmloader is used to bootstrap a fully virtualized kernel
685 +# Approved by QA team in bug #144032
686 +QA_WX_LOAD="usr/lib/xen/boot/hvmloader
687 + usr/share/qemu-xen/qemu/s390-ccw.img"
688 +
689 +RESTRICT="test"
690 +
691 +pkg_setup() {
692 + python_setup
693 + export "CONFIG_LOMOUNT=y"
694 +
695 + #bug 522642, disable compile tools/tests
696 + export "CONFIG_TESTS=n"
697 +
698 + if [[ -z ${XEN_TARGET_ARCH} ]] ; then
699 + if use x86 && use amd64; then
700 + die "Confusion! Both x86 and amd64 are set in your use flags!"
701 + elif use x86; then
702 + export XEN_TARGET_ARCH="x86_32"
703 + elif use amd64 ; then
704 + export XEN_TARGET_ARCH="x86_64"
705 + elif use arm; then
706 + export XEN_TARGET_ARCH="arm32"
707 + elif use arm64; then
708 + export XEN_TARGET_ARCH="arm64"
709 + else
710 + die "Unsupported architecture!"
711 + fi
712 + fi
713 +}
714 +
715 +src_prepare() {
716 + # Upstream's patchset
717 + if [[ -n ${UPSTREAM_VER} ]]; then
718 + einfo "Try to apply Xen Upstream patch set"
719 + EPATCH_SUFFIX="patch" \
720 + EPATCH_FORCE="yes" \
721 + EPATCH_OPTS="-p1" \
722 + epatch "${WORKDIR}"/patches-upstream
723 + fi
724 +
725 + # Security patchset
726 + if [[ -n ${SECURITY_VER} ]]; then
727 + einfo "Try to apply Xen Security patch set"
728 + # apply main xen patches
729 + # Two parallel systems, both work side by side
730 + # Over time they may concdense into one. This will suffice for now
731 + EPATCH_SUFFIX="patch"
732 + EPATCH_FORCE="yes"
733 +
734 + source "${WORKDIR}"/patches-security/${PV}.conf
735 +
736 + for i in ${XEN_SECURITY_MAIN}; do
737 + epatch "${WORKDIR}"/patches-security/xen/$i
738 + done
739 +
740 + # apply qemu-xen/upstream patches
741 + pushd "${S}"/tools/qemu-xen/ > /dev/null
742 + for i in ${XEN_SECURITY_QEMUU}; do
743 + epatch "${WORKDIR}"/patches-security/qemuu/$i
744 + done
745 + popd > /dev/null
746 +
747 + # apply qemu-traditional patches
748 + pushd "${S}"/tools/qemu-xen-traditional/ > /dev/null
749 + for i in ${XEN_SECURITY_QEMUT}; do
750 + epatch "${WORKDIR}"/patches-security/qemut/$i
751 + done
752 + popd > /dev/null
753 + fi
754 +
755 + # move before Gentoo patch, one patch should apply to seabios, to fix gcc-4.5.x build err
756 + mv ../seabios-${SEABIOS_VER} tools/firmware/seabios-dir-remote || die
757 + pushd tools/firmware/ > /dev/null
758 + ln -s seabios-dir-remote seabios-dir || die
759 + popd > /dev/null
760 +
761 + # Gentoo's patchset
762 + if [[ -n ${GENTOO_VER} && -n ${GENTOO_GPV} ]]; then
763 + einfo "Try to apply Gentoo specific patch set"
764 + source "${FILESDIR}"/gentoo-patches.conf
765 + _gpv=_gpv_${PN/-/_}_${PV//./}_${GENTOO_GPV}
766 + for i in ${!_gpv}; do
767 + EPATCH_SUFFIX="patch" \
768 + EPATCH_FORCE="yes" \
769 + epatch "${WORKDIR}"/patches-gentoo/$i
770 + done
771 + fi
772 +
773 + # Ovmf's patchset
774 + if use ovmf; then
775 + if [[ -n ${OVMF_VER} ]];then
776 + einfo "Try to apply Ovmf patch set"
777 + pushd "${WORKDIR}"/ovmf-*/ > /dev/null
778 + EPATCH_SUFFIX="patch" \
779 + EPATCH_FORCE="yes" \
780 + EPATCH_OPTS="-p1" \
781 + epatch "${WORKDIR}"/patches-ovmf
782 + popd > /dev/null
783 + fi
784 + mv ../ovmf-${OVMF_PV} tools/firmware/ovmf-dir-remote || die
785 + fi
786 +
787 + mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die
788 +
789 + # Fix texi2html build error with new texi2html, qemu.doc.html
790 + sed -i -e "/texi2html -monolithic/s/-number//" tools/qemu-xen-traditional/Makefile || die
791 +
792 + use api || sed -e "/SUBDIRS-\$(LIBXENAPI_BINDINGS) += libxen/d" -i tools/Makefile || die
793 + sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' \
794 + -i tools/firmware/Makefile || die
795 +
796 + # Drop .config, fixes to gcc-4.6
797 + sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
798 +
799 + # if the user *really* wants to use their own custom-cflags, let them
800 + if use custom-cflags; then
801 + einfo "User wants their own CFLAGS - removing defaults"
802 +
803 + # try and remove all the default cflags
804 + find "${S}" \( -name Makefile -o -name Rules.mk -o -name Config.mk \) \
805 + -exec sed \
806 + -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
807 + -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
808 + -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
809 + -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
810 + -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
811 + -i {} + || die "failed to re-set custom-cflags"
812 + else
813 + unset CFLAGS
814 + unset LDFLAGS
815 + unset ASFLAGS
816 + unset CPPFLAGS
817 + fi
818 +
819 + if ! use pygrub; then
820 + sed -e '/^SUBDIRS-y += pygrub/d' -i tools/Makefile || die
821 + fi
822 +
823 + if ! use python; then
824 + sed -e '/^SUBDIRS-y += python$/d' -i tools/Makefile || die
825 + fi
826 +
827 + if ! use hvm; then
828 + sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die
829 + # Bug 351648
830 + elif ! use x86 && ! has x86 $(get_all_abis); then
831 + mkdir -p "${WORKDIR}"/extra-headers/gnu || die
832 + touch "${WORKDIR}"/extra-headers/gnu/stubs-32.h || die
833 + export CPATH="${WORKDIR}"/extra-headers
834 + fi
835 +
836 + if use qemu; then
837 + if use sdl; then
838 + sed -i -e "s:\$\$source/configure:\0 --enable-sdl:" \
839 + tools/Makefile || die
840 + else
841 + sed -i -e "s:\${QEMU_ROOT\:\-\.}/configure:\0 --disable-sdl:" \
842 + tools/qemu-xen-traditional/xen-setup || die
843 + sed -i -e "s:\$\$source/configure:\0 --disable-sdl:" \
844 + tools/Makefile || die
845 + fi
846 + else
847 + # Don't bother with qemu, only needed for fully virtualised guests
848 + sed -e "s:install-tools\: tools/qemu-xen-traditional-dir:install-tools\: :g" -i Makefile || die
849 + fi
850 +
851 + # Reset bash completion dir; Bug 472438
852 + sed -e "s:^BASH_COMPLETION_DIR ?= \$(CONFIG_DIR)/bash_completion.d:BASH_COMPLETION_DIR ?= $(get_bashcompdir):" \
853 + -i Config.mk || die
854 + sed -i -e "/bash-completion/s/xl\.sh/xl/g" tools/libxl/Makefile || die
855 +
856 + # xencommons, Bug #492332, sed lighter weight than patching
857 + sed -e 's:\$QEMU_XEN -xen-domid:test -e "\$QEMU_XEN" \&\& &:' \
858 + -i tools/hotplug/Linux/init.d/xencommons.in || die
859 +
860 + # respect multilib, usr/lib/libcacard.so.0.0.0
861 + sed -e "/^libdir=/s/\/lib/\/$(get_libdir)/" \
862 + -i tools/qemu-xen/configure || die
863 +
864 + #bug 518136, don't build 32bit exactuable for nomultilib profile
865 + if [[ "${ARCH}" == 'amd64' ]] && ! has_multilib_profile; then
866 + sed -i -e "/x86_emulator/d" tools/tests/Makefile || die
867 + fi
868 +
869 + # use /var instead of /var/lib, consistat with previous ebuild
870 + sed -i -e "/XEN_LOCK_DIR=/s/\$localstatedir/\/var/g" \
871 + m4/paths.m4 configure tools/configure || die
872 + # use /run instead of /var/run
873 + sed -i -e "/XEN_RUN_DIR=/s/\$localstatedir//g" \
874 + m4/paths.m4 configure tools/configure || die
875 +
876 + # uncomment lines in xl.conf
877 + sed -e 's:^#autoballoon=:autoballoon=:' \
878 + -e 's:^#lockfile=:lockfile=:' \
879 + -e 's:^#vif.default.script=:vif.default.script=:' \
880 + -i tools/examples/xl.conf || die
881 +
882 + # Bug #575868 converted to a sed statement, typo of one char
883 + sed -e "s:granter’s:granter's:" -i xen/include/public/grant_table.h || die
884 +
885 + epatch_user
886 +}
887 +
888 +src_configure() {
889 + local myconf="--prefix=${PREFIX}/usr \
890 + --libdir=${PREFIX}/usr/$(get_libdir) \
891 + --libexecdir=${PREFIX}/usr/libexec \
892 + --disable-werror \
893 + --disable-xen \
894 + --enable-tools \
895 + --enable-docs \
896 + $(use_enable pam) \
897 + $(use_enable api xenapi) \
898 + $(use_enable ovmf) \
899 + $(use_enable ocaml ocamltools) \
900 + --with-xenstored=$(usex ocaml 'oxenstored' 'xenstored') \
901 + "
902 +
903 + use system-seabios && myconf+=" --with-system-seabios=/usr/share/seabios/bios.bin"
904 + use system-qemu && myconf+=" --with-system-qemu=/usr/bin/qemu-system-x86_64"
905 + use amd64 && myconf+=" $(use_enable qemu-traditional)"
906 + econf ${myconf}
907 +}
908 +
909 +src_compile() {
910 + export VARTEXFONTS="${T}/fonts"
911 + local myopt
912 + use debug && myopt="${myopt} debug=y"
913 +
914 + if test-flag-CC -fno-strict-overflow; then
915 + append-flags -fno-strict-overflow
916 + fi
917 +
918 + emake V=1 CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" -C tools ${myopt}
919 +
920 + use doc && emake -C docs txt html
921 + emake -C docs man-pages
922 +}
923 +
924 +src_install() {
925 + # Override auto-detection in the build system, bug #382573
926 + export INITD_DIR=/tmp/init.d
927 + export CONFIG_LEAF_DIR=../tmp/default
928 +
929 + # Let the build system compile installed Python modules.
930 + local PYTHONDONTWRITEBYTECODE
931 + export PYTHONDONTWRITEBYTECODE
932 +
933 + emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" \
934 + XEN_PYTHON_NATIVE_INSTALL=y install-tools
935 +
936 + # Fix the remaining Python shebangs.
937 + python_fix_shebang "${D}"
938 +
939 + # Remove RedHat-specific stuff
940 + rm -rf "${D}"tmp || die
941 +
942 + if use doc; then
943 + emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs
944 +
945 + dohtml -r docs/
946 + docinto pdf
947 + dodoc ${DOCS[@]}
948 + [ -d "${D}"/usr/share/doc/xen ] && mv "${D}"/usr/share/doc/xen/* "${D}"/usr/share/doc/${PF}/html
949 + fi
950 +
951 + rm -rf "${D}"/usr/share/doc/xen/
952 + doman docs/man?/*
953 +
954 + newconfd "${FILESDIR}"/xendomains.confd xendomains
955 + newconfd "${FILESDIR}"/xenstored.confd xenstored
956 + newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled
957 + newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains
958 + newinitd "${FILESDIR}"/xenstored.initd xenstored
959 + newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
960 + newinitd "${FILESDIR}"/xencommons.initd xencommons
961 + newconfd "${FILESDIR}"/xencommons.confd xencommons
962 + newinitd "${FILESDIR}"/xenqemudev.initd xenqemudev
963 + newconfd "${FILESDIR}"/xenqemudev.confd xenqemudev
964 +
965 + if use screen; then
966 + cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains || die
967 + cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/ || die
968 + keepdir /var/log/xen-consoles
969 + fi
970 +
971 + # For -static-libs wrt Bug 384355
972 + if ! use static-libs; then
973 + rm -f "${D}"usr/$(get_libdir)/*.a "${D}"usr/$(get_libdir)/ocaml/*/*.a
974 + fi
975 +
976 + # for xendomains
977 + keepdir /etc/xen/auto
978 +
979 + # Remove files failing QA AFTER emake installs them, avoiding seeking absent files
980 + find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \
981 + -o -name openbios-ppc -o -name palcode-clipper \) -delete || die
982 +}
983 +
984 +pkg_postinst() {
985 + elog "Official Xen Guide and the offical wiki page:"
986 + elog "https://wiki.gentoo.org/wiki/Xen"
987 + elog "http://wiki.xen.org/wiki/Main_Page"
988 + elog ""
989 + elog "Recommended to utilise the xencommons script to config sytem At boot"
990 + elog "Add by use of rc-update on completion of the install"
991 +
992 + if ! use hvm; then
993 + echo
994 + elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
995 + elog "support enable the hvm use flag."
996 + elog "An x86 or amd64 system is required to build HVM support."
997 + fi
998 +
999 + if use qemu; then
1000 + elog "The qemu-bridge-helper is renamed to the xen-bridge-helper in the in source"
1001 + elog "build of qemu. This allows for app-emulation/qemu to be emerged concurrently"
1002 + elog "with the qemu capable xen. It is up to the user to distinguish between and utilise"
1003 + elog "the qemu-bridge-helper and the xen-bridge-helper. File bugs of any issues that arise"
1004 + fi
1005 +}