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