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