Gentoo Archives: gentoo-commits

From: "Micheal Marineau (marineam)" <marineam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/xen-tools: ChangeLog xen-tools-3.1.0-r2.ebuild xen-tools-3.0.4_p1-r2.ebuild xen-tools-3.1.1-r1.ebuild xen-tools-3.1.0-r1.ebuild xen-tools-3.1.1.ebuild xen-tools-3.0.4_p1-r1.ebuild
Date: Tue, 23 Oct 2007 19:09:21
Message-Id: E1IkP7l-0006xX-Bn@stork.gentoo.org
1 marineam 07/10/23 19:09:09
2
3 Modified: ChangeLog
4 Added: xen-tools-3.1.0-r2.ebuild
5 xen-tools-3.0.4_p1-r2.ebuild
6 xen-tools-3.1.1-r1.ebuild
7 Removed: xen-tools-3.1.0-r1.ebuild xen-tools-3.1.1.ebuild
8 xen-tools-3.0.4_p1-r1.ebuild
9 Log:
10 Security fix
11 (Portage version: 2.1.3.9)
12
13 Revision Changes Path
14 1.32 app-emulation/xen-tools/ChangeLog
15
16 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/xen-tools/ChangeLog?rev=1.32&view=markup
17 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/xen-tools/ChangeLog?rev=1.32&content-type=text/plain
18 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/xen-tools/ChangeLog?r1=1.31&r2=1.32
19
20 Index: ChangeLog
21 ===================================================================
22 RCS file: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v
23 retrieving revision 1.31
24 retrieving revision 1.32
25 diff -u -r1.31 -r1.32
26 --- ChangeLog 15 Oct 2007 18:34:34 -0000 1.31
27 +++ ChangeLog 23 Oct 2007 19:09:08 -0000 1.32
28 @@ -1,6 +1,17 @@
29 # ChangeLog for app-emulation/xen-tools
30 # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
31 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v 1.31 2007/10/15 18:34:34 marineam Exp $
32 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v 1.32 2007/10/23 19:09:08 marineam Exp $
33 +
34 +*xen-tools-3.1.1-r1 (23 Oct 2007)
35 +*xen-tools-3.1.0-r2 (23 Oct 2007)
36 +*xen-tools-3.0.4_p1-r2 (23 Oct 2007)
37 +
38 + 23 Oct 2007; Michael Marineau <marineam@g.o>
39 + +files/xen-tools-3.1.1-insecure-file-creation-fix.patch,
40 + -xen-tools-3.0.4_p1-r1.ebuild, +xen-tools-3.0.4_p1-r2.ebuild,
41 + -xen-tools-3.1.0-r1.ebuild, +xen-tools-3.1.0-r2.ebuild,
42 + -xen-tools-3.1.1.ebuild, +xen-tools-3.1.1-r1.ebuild:
43 + Fix an insecure temp file creation, bug #196824, CVE-2007-3919
44
45 *xen-tools-3.1.1 (15 Oct 2007)
46
47
48
49
50 1.1 app-emulation/xen-tools/xen-tools-3.1.0-r2.ebuild
51
52 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/xen-tools/xen-tools-3.1.0-r2.ebuild?rev=1.1&view=markup
53 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/xen-tools/xen-tools-3.1.0-r2.ebuild?rev=1.1&content-type=text/plain
54
55 Index: xen-tools-3.1.0-r2.ebuild
56 ===================================================================
57 # Copyright 1999-2007 Gentoo Foundation
58 # Distributed under the terms of the GNU General Public License v2
59 # $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-3.1.0-r2.ebuild,v 1.1 2007/10/23 19:09:08 marineam Exp $
60
61 inherit flag-o-matic eutils multilib
62
63 DESCRIPTION="Xend daemon and tools"
64 HOMEPAGE="http://www.xensource.com/xen/xen/"
65 SRC_URI="http://bits.xensource.com/oss-xen/release/${PV}/src.tgz/xen-${PV}-src.tgz"
66 S="${WORKDIR}/xen-${PV}-src"
67
68 LICENSE="GPL-2"
69 SLOT="0"
70 KEYWORDS="~amd64 ~x86"
71 IUSE="doc debug screen custom-cflags pygrub hvm"
72
73 CDEPEND="dev-lang/python
74 sys-libs/zlib
75 hvm? ( media-libs/libsdl )"
76
77 DEPEND="${CDEPEND}
78 sys-devel/gcc
79 dev-lang/perl
80 app-misc/pax-utils
81 doc? (
82 dev-tex/latex2html
83 media-gfx/transfig
84 media-gfx/graphviz
85 )
86 hvm? (
87 x11-proto/xproto
88 net-libs/libvncserver
89 sys-devel/dev86
90 )"
91
92 RDEPEND="${CDEPEND}
93 sys-apps/iproute2
94 net-misc/bridge-utils
95 screen? (
96 app-misc/screen
97 app-admin/logrotate
98 )
99 || ( sys-fs/udev sys-apps/hotplug )"
100
101 PYTHON_MODNAME="xen grub"
102
103 # hvmloader is used to bootstrap a fully virtualized kernel
104 # Approved by QA team in bug #144032
105 QA_WX_LOAD="usr/lib/xen/boot/hvmloader"
106
107 pkg_setup() {
108 if ! use x86 && ! has x86 $(get_all_abis) && use hvm; then
109 eerror "HVM (VT-x and AMD-v) cannot be built on this system. An x86 or"
110 eerror "an amd64 multilib profile is required. Remove the hvm use flag"
111 eerror "to build xen-tools on your current profile."
112 die "USE=hvm is unsupported on this system."
113 fi
114
115 if [[ -z ${XEN_TARGET_ARCH} ]] ; then
116 if use x86 && use amd64; then
117 die "Confusion! Both x86 and amd64 are set in your use flags!"
118 elif use x86; then
119 export XEN_TARGET_ARCH="x86_32"
120 elif use amd64 ; then
121 export XEN_TARGET_ARCH="x86_64"
122 else
123 die "Unsupported architecture!"
124 fi
125 fi
126
127 if use doc && ! built_with_use -o dev-tex/latex2html png gif; then
128 # die early instead of later
129 eerror "USE=doc requires latex2html with image support. Please add"
130 eerror "'png' and/or 'gif' to your use flags and re-emerge latex2html"
131 die "latex2html missing both png and gif flags"
132 fi
133 }
134
135 src_unpack() {
136 unpack ${A}
137 cd "${S}"
138
139 # if the user *really* wants to use their own custom-cflags, let them
140 if use custom-cflags; then
141 einfo "User wants their own CFLAGS - removing defaults"
142 # try and remove all the default custom-cflags
143 find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
144 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
145 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
146 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
147 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
148 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
149 -i {} \;
150 fi
151
152 # Disable hvm support on systems that don't support x86_32 binaries.
153 if ! use hvm; then
154 chmod 644 tools/check/check_x11_devel
155 sed -i -e '/^CONFIG_IOEMU := y$/d' "${S}"/config/*.mk
156 sed -i -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' "${S}"/tools/Makefile
157 fi
158
159 if ! use pygrub; then
160 sed -i -e "/^SUBDIRS-y += pygrub$/d" "${S}"/tools/Makefile
161 fi
162
163 # Allow --as-needed LDFLAGS
164 epatch "${FILESDIR}/${PN}-3.0.4_p1--as-needed.patch"
165
166 # Fix network broadcast on bridged networks
167 epatch "${FILESDIR}/${PN}-3.0.4_p1-network-bridge-broadcast.patch"
168
169 # Also look in python's site packages for xen, as it installs there
170 epatch "${FILESDIR}/${PN}-3.1.0-python-site-packages.patch"
171
172 # Fix building small dumb utility called 'xen-detect' on hardened
173 epatch "${FILESDIR}/${PN}-3.1.0-xen-detect-nopie-fix.patch"
174
175 # Security fix, CVE-2007-4993
176 # https://bugs.gentoo.org/show_bug.cgi?id=193808
177 epatch "${FILESDIR}/${PN}-3.1.0-pygrub-security-fix.patch"
178
179 # Fix an insecure temp file creation, bug #196824, CVE-2007-3919
180 epatch "${FILESDIR}/${PN}-3.1.1-insecure-file-creation-fix.patch"
181 }
182
183 src_compile() {
184 local myopt myconf
185 use debug && myopt="${myopt} debug=y"
186
187 use custom-cflags || unset CFLAGS
188 if test-flag-CC -fno-strict-overflow; then
189 append-flags -fno-strict-overflow
190 fi
191
192 if use hvm; then
193 myconf="${myconf} --disable-system --disable-user"
194 (cd tools/ioemu && econf ${myconf}) || die "configure failured"
195 fi
196
197 emake -C tools ${myopt} || die "compile failed"
198
199 if use doc; then
200 sh ./docs/check_pkgs || die "package check failed"
201 emake -C docs || die "compiling docs failed"
202 fi
203
204 emake -C docs man-pages || die "make man-pages failed"
205 }
206
207 src_install() {
208 local myopt="XEN_PYTHON_NATIVE_INSTALL=1"
209
210 make DESTDIR="${D}" -C tools ${myopt} install \
211 || die "install failed"
212
213 # Remove RedHat-specific stuff
214 rm -rf "${D}"/etc/sysconfig
215
216 if use doc; then
217 make DESTDIR="${D}" -C docs install || die "install docs failed"
218 # Rename doc/xen to the Gentoo-style doc/xen-x.y
219 mv "${D}"/usr/share/doc/{${PN},${PF}}
220 fi
221
222 doman docs/man?/*
223
224 newinitd "${FILESDIR}"/xend.initd xend \
225 || die "Couldn't install xen.initd"
226 newconfd "${FILESDIR}"/xendomains.confd xendomains \
227 || die "Couldn't install xendomains.confd"
228 newinitd "${FILESDIR}"/xendomains.initd xendomains \
229 || die "Couldn't install xendomains.initd"
230
231 if use screen; then
232 cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains
233 cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/
234 keepdir /var/log/xen-consoles
235 fi
236
237 # xend expects these to exist
238 keepdir /var/run/xenstored /var/lib/xenstored /var/xen/dump /var/lib/xen /var/log/xen
239
240 # for xendomains
241 keepdir /etc/xen/auto
242 }
243
244 pkg_postinst() {
245 elog "Official Xen Guide and the unoffical wiki page:"
246 elog " http://www.gentoo.org/doc/en/xen-guide.xml"
247 elog " http://gentoo-wiki.com/HOWTO_Xen_and_Gentoo"
248
249 if [[ "$(scanelf -s __guard -q $(type -P python))" ]] ; then
250 echo
251 ewarn "xend may not work when python is built with stack smashing protection (ssp)."
252 ewarn "If 'xm create' fails with '<ProtocolError for /RPC2: -1 >', see bug #141866"
253 ewarn "This probablem may be resolved as of Xen 3.0.4, if not post in the bug."
254 fi
255
256 if ! built_with_use dev-lang/python ncurses; then
257 echo
258 ewarn "NB: Your dev-lang/python is built without USE=ncurses."
259 ewarn "Please rebuild python with USE=ncurses to make use of xenmon.py."
260 fi
261
262 if built_with_use sys-apps/iproute2 minimal; then
263 echo
264 ewarn "Your sys-apps/iproute2 is built with USE=minimal. Networking"
265 ewarn "will not work until you rebuild iproute2 without USE=minimal."
266 fi
267
268 if ! use hvm; then
269 echo
270 elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
271 elog "support enable the hvm use flag."
272 elog "An x86 or amd64 multilib system is required to build HVM support."
273 echo
274 elog "The ioemu use flag has been removed and replaced with hvm."
275 fi
276
277 if grep -qsF XENSV= "${ROOT}/etc/conf.d/xend"; then
278 echo
279 elog "xensv is broken upstream (Gentoo bug #142011)."
280 elog "Please remove '${ROOT%/}/etc/conf.d/xend', as it is no longer needed."
281 fi
282 }
283
284
285
286 1.1 app-emulation/xen-tools/xen-tools-3.0.4_p1-r2.ebuild
287
288 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/xen-tools/xen-tools-3.0.4_p1-r2.ebuild?rev=1.1&view=markup
289 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/xen-tools/xen-tools-3.0.4_p1-r2.ebuild?rev=1.1&content-type=text/plain
290
291 Index: xen-tools-3.0.4_p1-r2.ebuild
292 ===================================================================
293 # Copyright 1999-2007 Gentoo Foundation
294 # Distributed under the terms of the GNU General Public License v2
295 # $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-3.0.4_p1-r2.ebuild,v 1.1 2007/10/23 19:09:08 marineam Exp $
296
297 inherit flag-o-matic distutils eutils multilib
298
299 DESCRIPTION="Xend daemon and tools"
300 HOMEPAGE="http://www.xensource.com/xen/xen/"
301 MY_PV=${PV/_p/_}
302 SRC_URI="http://bits.xensource.com/oss-xen/release/${MY_PV/_/-}/src.tgz/xen-${MY_PV}-src.tgz"
303 S="${WORKDIR}/xen-${MY_PV}-src"
304
305 LICENSE="GPL-2"
306 SLOT="0"
307 KEYWORDS="~amd64 ~x86"
308 IUSE="doc debug screen custom-cflags pygrub ioemu"
309
310 CDEPEND="dev-lang/python
311 sys-libs/zlib
312 ioemu? ( media-libs/libsdl )"
313
314 DEPEND="${CDEPEND}
315 sys-devel/gcc
316 dev-lang/perl
317 sys-devel/dev86
318 app-misc/pax-utils
319 doc? (
320 dev-tex/latex2html
321 media-gfx/transfig
322 )
323 ioemu? (
324 x11-proto/xproto
325 net-libs/libvncserver
326 )"
327
328 RDEPEND="${CDEPEND}
329 sys-apps/iproute2
330 net-misc/bridge-utils
331 screen? (
332 app-misc/screen
333 app-admin/logrotate
334 )
335 || ( sys-fs/udev sys-apps/hotplug )"
336
337 PYTHON_MODNAME="xen grub"
338
339 # hvmloader is used to bootstrap a fully virtualized kernel
340 # Approved by QA team in bug #144032
341 QA_WX_LOAD="usr/lib/xen/boot/hvmloader"
342
343 pkg_setup() {
344 if [[ "$(scanelf -s __guard -q `which python`)" ]] ; then
345 ewarn "xend may not work when python is built with stack smashing protection (ssp)."
346 ewarn "If 'xm create' fails with '<ProtocolError for /RPC2: -1 >', see bug #141866"
347 fi
348
349 if [[ -z ${XEN_TARGET_ARCH} ]] ; then
350 if use x86 && use amd64; then
351 die "Confusion! Both x86 and amd64 are set in your use flags!"
352 elif use x86; then
353 export XEN_TARGET_ARCH="x86_32"
354 elif use amd64 ; then
355 export XEN_TARGET_ARCH="x86_64"
356 else
357 die "Unsupported architecture!"
358 fi
359 fi
360
361 if use doc && ! built_with_use -o dev-tex/latex2html png gif; then
362 # die early instead of later
363 eerror "USE=doc requires latex2html with image support. Please add"
364 eerror "'png' and/or 'gif' to your use flags and re-emerge latex2html"
365 die "latex2html missing both png and gif flags"
366 fi
367 }
368
369 src_unpack() {
370 unpack ${A}
371 cd "${S}"
372
373 # if the user *really* wants to use their own custom-cflags, let them
374 if use custom-cflags; then
375 einfo "User wants their own CFLAGS - removing defaults"
376 # try and remove all the default custom-cflags
377 find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
378 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
379 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
380 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
381 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
382 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
383 -i {} \;
384 fi
385
386 # Disable the 32bit-only vmxassist if we are not on x86 and we don't
387 # support the x86 ABI. Also disable hvmloader, since it requires vmxassist.
388 if ! use x86 && ! has x86 $(get_all_abis); then
389 sed -i -e "/SUBDIRS += vmxassist/d" "${S}"/tools/firmware/Makefile
390 sed -i -e "/SUBDIRS += hvmloader/d" "${S}"/tools/firmware/Makefile
391 fi
392
393 if ! use pygrub; then
394 sed -i -e "/^SUBDIRS-y += pygrub$/d" "${S}"/tools/Makefile
395 fi
396
397 # Don't bother with ioemu, only needed for fully virtualised guests
398 if ! use ioemu; then
399 chmod 644 tools/check/check_x11_devel
400 sed -i -e "/^CONFIG_IOEMU := y$/d" "${S}"/config/*.mk
401 fi
402
403 # Allow --as-needed LDFLAGS
404 epatch "${FILESDIR}/${P}"--as-needed.patch
405
406 # Fix vnclisten
407 epatch "${FILESDIR}/${P}"-vnclisten.patch
408
409 # Fix network broadcast on bridged networks
410 epatch "${FILESDIR}/${P}"-network-bridge-broadcast.patch
411
412 # Disable QEMU monitor mode in VNC, bug #170917
413 epatch "${FILESDIR}/${P}"-remove-monitor-mode-from-vnc.patch
414
415 # Security fix, CVE-2007-4993
416 # https://bugs.gentoo.org/show_bug.cgi?id=193808
417 epatch "${FILESDIR}/${P}-pygrub-security-fix.patch"
418
419 # Fix an insecure temp file creation, bug #196824, CVE-2007-3919
420 epatch "${FILESDIR}/${PN}-3.1.1-insecure-file-creation-fix.patch"
421 }
422
423 src_compile() {
424 local myopt myconf
425 use debug && myopt="${myopt} debug=y"
426
427 use custom-cflags || unset CFLAGS
428 gcc-specs-ssp && append-flags -fno-stack-protector -fno-stack-protector-all
429
430 if use ioemu; then
431 myconf="${myconf} --disable-system --disable-user"
432 (cd tools/ioemu && econf ${myconf}) || die "configure failured"
433 fi
434
435 emake -C tools ${myopt} || die "compile failed"
436
437 if use doc; then
438 sh ./docs/check_pkgs || die "package check failed"
439 emake -C docs || die "compiling docs failed"
440 fi
441
442 emake -C docs man-pages || die "make man-pages failed"
443 }
444
445 src_install() {
446 local myopt="XEN_PYTHON_NATIVE_INSTALL=1"
447
448 make DESTDIR="${D}" ${myopt} install-tools \
449 || die "install failed"
450
451 # Remove RedHat-specific stuff
452 rm -rf "${D}"/etc/sysconfig
453
454 if use doc; then
455 make DESTDIR="${D}" -C docs install || die "install docs failed"
456 # Rename doc/xen to the Gentoo-style doc/xen-x.y
457 mv "${D}"/usr/share/doc/{${PN},${PF}}
458 fi
459
460 doman docs/man?/*
461
462 newinitd "${FILESDIR}"/xend.initd xend \
463 || die "Couldn't install xen.initd"
464 newconfd "${FILESDIR}"/xendomains.confd xendomains \
465 || die "Couldn't install xendomains.confd"
466 newinitd "${FILESDIR}"/xendomains.initd xendomains \
467 || die "Couldn't install xendomains.initd"
468
469 if use screen; then
470 cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains
471 cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/
472 keepdir /var/log/xen-consoles
473 fi
474
475 # xend expects these to exist
476 keepdir /var/run/xenstored /var/lib/xenstored /var/xen/dump /var/lib/xen /var/log/xen
477 }
478
479 pkg_postinst() {
480 elog "Please visit the Xen and Gentoo wiki:"
481 elog "http://gentoo-wiki.com/HOWTO_Xen_and_Gentoo"
482
483 if [[ "$(scanelf -s __guard -q `which python`)" ]] ; then
484 ewarn "xend may not work when python is built with stack smashing protection (ssp)."
485 ewarn "If 'xm create' fails with '<ProtocolError for /RPC2: -1 >', see bug #141866"
486 fi
487
488 if ! built_with_use dev-lang/python ncurses; then
489 echo
490 ewarn "NB: Your dev-lang/python is built without USE=ncurses."
491 ewarn "Please rebuild python with USE=ncurses to make use of xenmon.py."
492 fi
493
494 if ! use x86 && ! has x86 $(get_all_abis); then
495 echo
496 elog "Your system does not support building x86 binaries (amd64 no-multilib)"
497 elog "hvmloader has not been built, which is required for HVM guests."
498 fi
499
500 if grep -qsF XENSV= "${ROOT}/etc/conf.d/xend"; then
501 echo
502 elog "xensv is broken upstream (Gentoo bug #142011)."
503 elog "Please remove '${ROOT%/}/etc/conf.d/xend', as it is no longer needed."
504 fi
505 }
506
507
508
509 1.1 app-emulation/xen-tools/xen-tools-3.1.1-r1.ebuild
510
511 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/xen-tools/xen-tools-3.1.1-r1.ebuild?rev=1.1&view=markup
512 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/xen-tools/xen-tools-3.1.1-r1.ebuild?rev=1.1&content-type=text/plain
513
514 Index: xen-tools-3.1.1-r1.ebuild
515 ===================================================================
516 # Copyright 1999-2007 Gentoo Foundation
517 # Distributed under the terms of the GNU General Public License v2
518 # $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-3.1.1-r1.ebuild,v 1.1 2007/10/23 19:09:08 marineam Exp $
519
520 inherit flag-o-matic eutils multilib
521
522 DESCRIPTION="Xend daemon and tools"
523 HOMEPAGE="http://www.xensource.com/xen/xen/"
524 #SRC_URI="http://bits.xensource.com/oss-xen/release/${PV}/src.tgz/xen-${PV}-src.tgz"
525 #S="${WORKDIR}/xen-${PV}-src"
526
527 # Temporary while we wait on the upstream tarball
528 SRC_URI="mirror://gentoo//xen-${PV}.tgz"
529 S="${WORKDIR}/xen-${PV}"
530
531 LICENSE="GPL-2"
532 SLOT="0"
533 KEYWORDS="~amd64 ~x86"
534 IUSE="doc debug screen custom-cflags pygrub hvm"
535
536 CDEPEND="dev-lang/python
537 sys-libs/zlib
538 hvm? ( media-libs/libsdl )"
539
540 DEPEND="${CDEPEND}
541 sys-devel/gcc
542 dev-lang/perl
543 app-misc/pax-utils
544 doc? (
545 dev-tex/latex2html
546 media-gfx/transfig
547 media-gfx/graphviz
548 )
549 hvm? (
550 x11-proto/xproto
551 net-libs/libvncserver
552 sys-devel/dev86
553 )"
554
555 RDEPEND="${CDEPEND}
556 sys-apps/iproute2
557 net-misc/bridge-utils
558 screen? (
559 app-misc/screen
560 app-admin/logrotate
561 )
562 || ( sys-fs/udev sys-apps/hotplug )"
563
564 PYTHON_MODNAME="xen grub"
565
566 # hvmloader is used to bootstrap a fully virtualized kernel
567 # Approved by QA team in bug #144032
568 QA_WX_LOAD="usr/lib/xen/boot/hvmloader"
569
570 pkg_setup() {
571 if ! use x86 && ! has x86 $(get_all_abis) && use hvm; then
572 eerror "HVM (VT-x and AMD-v) cannot be built on this system. An x86 or"
573 eerror "an amd64 multilib profile is required. Remove the hvm use flag"
574 eerror "to build xen-tools on your current profile."
575 die "USE=hvm is unsupported on this system."
576 fi
577
578 if [[ -z ${XEN_TARGET_ARCH} ]] ; then
579 if use x86 && use amd64; then
580 die "Confusion! Both x86 and amd64 are set in your use flags!"
581 elif use x86; then
582 export XEN_TARGET_ARCH="x86_32"
583 elif use amd64 ; then
584 export XEN_TARGET_ARCH="x86_64"
585 else
586 die "Unsupported architecture!"
587 fi
588 fi
589
590 if use doc && ! built_with_use -o dev-tex/latex2html png gif; then
591 # die early instead of later
592 eerror "USE=doc requires latex2html with image support. Please add"
593 eerror "'png' and/or 'gif' to your use flags and re-emerge latex2html"
594 die "latex2html missing both png and gif flags"
595 fi
596 }
597
598 src_unpack() {
599 unpack ${A}
600 cd "${S}"
601
602 # if the user *really* wants to use their own custom-cflags, let them
603 if use custom-cflags; then
604 einfo "User wants their own CFLAGS - removing defaults"
605 # try and remove all the default custom-cflags
606 find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
607 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
608 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
609 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
610 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
611 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
612 -i {} \;
613 fi
614
615 # Disable hvm support on systems that don't support x86_32 binaries.
616 if ! use hvm; then
617 chmod 644 tools/check/check_x11_devel
618 sed -i -e '/^CONFIG_IOEMU := y$/d' "${S}"/config/*.mk
619 sed -i -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' "${S}"/tools/Makefile
620 fi
621
622 if ! use pygrub; then
623 sed -i -e "/^SUBDIRS-y += pygrub$/d" "${S}"/tools/Makefile
624 fi
625
626 # Allow --as-needed LDFLAGS
627 epatch "${FILESDIR}/${PN}-3.0.4_p1--as-needed.patch"
628
629 # Fix network broadcast on bridged networks
630 epatch "${FILESDIR}/${PN}-3.0.4_p1-network-bridge-broadcast.patch"
631
632 # Fix building small dumb utility called 'xen-detect' on hardened
633 epatch "${FILESDIR}/${PN}-3.1.0-xen-detect-nopie-fix.patch"
634
635 # Fix an insecure temp file creation, bug #196824, CVE-2007-3919
636 epatch "${FILESDIR}/${PN}-3.1.1-insecure-file-creation-fix.patch"
637 }
638
639 src_compile() {
640 local myopt myconf
641 use debug && myopt="${myopt} debug=y"
642
643 use custom-cflags || unset CFLAGS
644 if test-flag-CC -fno-strict-overflow; then
645 append-flags -fno-strict-overflow
646 fi
647
648 if use hvm; then
649 myconf="${myconf} --disable-system --disable-user"
650 (cd tools/ioemu && econf ${myconf}) || die "configure failured"
651 fi
652
653 emake -C tools ${myopt} || die "compile failed"
654
655 if use doc; then
656 sh ./docs/check_pkgs || die "package check failed"
657 emake -C docs || die "compiling docs failed"
658 fi
659
660 emake -C docs man-pages || die "make man-pages failed"
661 }
662
663 src_install() {
664 local myopt="XEN_PYTHON_NATIVE_INSTALL=1"
665
666 make DESTDIR="${D}" -C tools ${myopt} install \
667 || die "install failed"
668
669 # Remove RedHat-specific stuff
670 rm -rf "${D}"/etc/sysconfig
671
672 if use doc; then
673 make DESTDIR="${D}" -C docs install || die "install docs failed"
674 # Rename doc/xen to the Gentoo-style doc/xen-x.y
675 mv "${D}"/usr/share/doc/{${PN},${PF}}
676 fi
677
678 doman docs/man?/*
679
680 newinitd "${FILESDIR}"/xend.initd xend \
681 || die "Couldn't install xen.initd"
682 newconfd "${FILESDIR}"/xendomains.confd xendomains \
683 || die "Couldn't install xendomains.confd"
684 newinitd "${FILESDIR}"/xendomains.initd xendomains \
685 || die "Couldn't install xendomains.initd"
686
687 if use screen; then
688 cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains
689 cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/
690 keepdir /var/log/xen-consoles
691 fi
692
693 # xend expects these to exist
694 keepdir /var/run/xenstored /var/lib/xenstored /var/xen/dump /var/lib/xen /var/log/xen
695
696 # for xendomains
697 keepdir /etc/xen/auto
698 }
699
700 pkg_postinst() {
701 elog "Official Xen Guide and the unoffical wiki page:"
702 elog " http://www.gentoo.org/doc/en/xen-guide.xml"
703 elog " http://gentoo-wiki.com/HOWTO_Xen_and_Gentoo"
704
705 if [[ "$(scanelf -s __guard -q $(type -P python))" ]] ; then
706 echo
707 ewarn "xend may not work when python is built with stack smashing protection (ssp)."
708 ewarn "If 'xm create' fails with '<ProtocolError for /RPC2: -1 >', see bug #141866"
709 ewarn "This probablem may be resolved as of Xen 3.0.4, if not post in the bug."
710 fi
711
712 if ! built_with_use dev-lang/python ncurses; then
713 echo
714 ewarn "NB: Your dev-lang/python is built without USE=ncurses."
715 ewarn "Please rebuild python with USE=ncurses to make use of xenmon.py."
716 fi
717
718 if built_with_use sys-apps/iproute2 minimal; then
719 echo
720 ewarn "Your sys-apps/iproute2 is built with USE=minimal. Networking"
721 ewarn "will not work until you rebuild iproute2 without USE=minimal."
722 fi
723
724 if ! use hvm; then
725 echo
726 elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
727 elog "support enable the hvm use flag."
728 elog "An x86 or amd64 multilib system is required to build HVM support."
729 echo
730 elog "The ioemu use flag has been removed and replaced with hvm."
731 fi
732
733 if grep -qsF XENSV= "${ROOT}/etc/conf.d/xend"; then
734 echo
735 elog "xensv is broken upstream (Gentoo bug #142011)."
736 elog "Please remove '${ROOT%/}/etc/conf.d/xend', as it is no longer needed."
737 fi
738 }
739
740
741
742 --
743 gentoo-commits@g.o mailing list