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