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