diff options
author | Andrew Ross <aross@gentoo.org> | 2006-10-14 00:00:03 +0000 |
---|---|---|
committer | Andrew Ross <aross@gentoo.org> | 2006-10-14 00:00:03 +0000 |
commit | 7da8851583575ad44d38d8adda2b60222673779e (patch) | |
tree | 2c61663f9806ccaff968457422327c9ad4c8bbdc /app-emulation/xen-tools | |
parent | replace einfo with elog (diff) | |
download | historical-7da8851583575ad44d38d8adda2b60222673779e.tar.gz historical-7da8851583575ad44d38d8adda2b60222673779e.tar.bz2 historical-7da8851583575ad44d38d8adda2b60222673779e.zip |
Fix a PTRACE_* compilation error, thanks to Thomas Veith <th_veith@web.de>
Package-Manager: portage-2.1.1
Diffstat (limited to 'app-emulation/xen-tools')
-rw-r--r-- | app-emulation/xen-tools/ChangeLog | 42 | ||||
-rw-r--r-- | app-emulation/xen-tools/Manifest | 31 | ||||
-rw-r--r-- | app-emulation/xen-tools/files/3.0.2-r4/pygrub-progsreiserfs-0.3.1.patch | 56 | ||||
-rw-r--r-- | app-emulation/xen-tools/files/3.0.2-r4/xc_ptrace.patch | 24 | ||||
-rw-r--r-- | app-emulation/xen-tools/files/3.0.2-r4/xend.initd | 61 | ||||
-rwxr-xr-x | app-emulation/xen-tools/files/3.0.2-r4/xendomains.initd | 96 | ||||
-rw-r--r-- | app-emulation/xen-tools/files/digest-xen-tools-3.0.2-r4 | 3 | ||||
-rw-r--r-- | app-emulation/xen-tools/xen-tools-3.0.2-r4.ebuild | 199 |
8 files changed, 507 insertions, 5 deletions
diff --git a/app-emulation/xen-tools/ChangeLog b/app-emulation/xen-tools/ChangeLog index 6cd6a911ebfc..c4e257db8d00 100644 --- a/app-emulation/xen-tools/ChangeLog +++ b/app-emulation/xen-tools/ChangeLog @@ -1,6 +1,46 @@ # ChangeLog for app-emulation/xen-tools # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v 1.17 2006/08/14 07:11:47 aross Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v 1.18 2006/10/14 00:00:03 aross Exp $ + +*xen-tools-3.0.2-r4 (13 Oct 2006) + + 13 Oct 2006; <aross@gentoo.org> + +files/3.0.2-r4/pygrub-progsreiserfs-0.3.1.patch, + +files/3.0.2-r4/xc_ptrace.patch, +files/3.0.2-r4/xendomains.initd, + +files/3.0.2-r4/xend.initd, +xen-tools-3.0.2-r4.ebuild: + Fix a PTRACE_* compilation error, thanks to Thomas Veith <th_veith@web.de> + in #151014. + + Introduce the pygrub local USE flag and fix a compile error when + sys-fs/progsreiserfs is installed, thanks to M. Edward Borasky + <znmeb@cesmail.net> and Mauricio Zambrano <mauro@webdb.homelinux.net> in + #137137. + + Make ntp-client start after xend, thanks to Harris Landgarten + <harrisl@lhjonline.com> in #144057. + + Make /etc/init.d/xendomains correctly handle domains with numbers, periods + and/or hyphens, thanks to Robert S <robert_s@emailme.net.au> in #148628. + + Fix a compile error with python-2.5, thanks to Charlie Shepherd + <masterdriverz@gmail.com> and Marien Zwart <marienz@gentoo.org> in #149138. + + Fix a compilation error on AMD64 with a 64 bit kernel and 32 bit userland, + thanks to tonich <tonich@artparade.ru> and Sven Wegener + <swegener@gentoo.org> in #143999. + + Make /etc/init.d/xend fail gracefully when started in a non-privileged + domain or unmodified kernel, thanks to Christian Hesse <mail@earthworm.de> + and Robert S <robert_s@emailme.net.au> in #148486. + + Only warn instead of dying when python is build with stack smashing + protection (ssp), thanks to Tuan Van <langthang@gentoo.org>, Raimonds Cicans + <ray@apollo.lv>, Brad Plant <bplant@westnet.com.au> and Sven Wegener + <swegener@gentoo.org> in #141866. + + Replace the hardened USE flag with test-flag-CC from flag-o-matic.eclass to + avoid compile errors with gcc-4.1 and USE=hardened, thanks to Richard + Benjamin Voigt <bvoigt@kas.com> in #147876. *xen-tools-3.0.2-r3 (15 Aug 2006) diff --git a/app-emulation/xen-tools/Manifest b/app-emulation/xen-tools/Manifest index d71081c3352d..35f9b658c9a5 100644 --- a/app-emulation/xen-tools/Manifest +++ b/app-emulation/xen-tools/Manifest @@ -1,3 +1,19 @@ +AUX 3.0.2-r4/pygrub-progsreiserfs-0.3.1.patch 1506 RMD160 c77b33651e07273a613e3fc6379d80eb48315f39 SHA1 92256c3d1caeacc54f6e75c987ea302bb234a649 SHA256 1cbbd32e3130f375ca95409bd39ab817be987f029bd0ba349f1b9279eaf5b857 +MD5 c8951e871a571c6dd3d00d8b4642bd76 files/3.0.2-r4/pygrub-progsreiserfs-0.3.1.patch 1506 +RMD160 c77b33651e07273a613e3fc6379d80eb48315f39 files/3.0.2-r4/pygrub-progsreiserfs-0.3.1.patch 1506 +SHA256 1cbbd32e3130f375ca95409bd39ab817be987f029bd0ba349f1b9279eaf5b857 files/3.0.2-r4/pygrub-progsreiserfs-0.3.1.patch 1506 +AUX 3.0.2-r4/xc_ptrace.patch 661 RMD160 926f246fcc65c707bf4bb822749e81cd844a0966 SHA1 5e059cbf266944cc9fb5eb62ea9cbbdd967a5a23 SHA256 62aabe6052ae89aec55d79582df16a3302e6aedbea86dc5ad44c657ad2f7a4b8 +MD5 7f74bc1ef57300624b22bd6409106e99 files/3.0.2-r4/xc_ptrace.patch 661 +RMD160 926f246fcc65c707bf4bb822749e81cd844a0966 files/3.0.2-r4/xc_ptrace.patch 661 +SHA256 62aabe6052ae89aec55d79582df16a3302e6aedbea86dc5ad44c657ad2f7a4b8 files/3.0.2-r4/xc_ptrace.patch 661 +AUX 3.0.2-r4/xend.initd 1297 RMD160 bffa9040ec982e8138b29a6d821106314ca10af6 SHA1 f32da37f4f8fd4ee1d9b75ca54e7e4a2ccd0fe17 SHA256 a759dbab945a775b5157c4570d813065c56fbf4d3a8c1ff84d7033fb1a88e53e +MD5 c313816bbc7b56ef2102727999775e74 files/3.0.2-r4/xend.initd 1297 +RMD160 bffa9040ec982e8138b29a6d821106314ca10af6 files/3.0.2-r4/xend.initd 1297 +SHA256 a759dbab945a775b5157c4570d813065c56fbf4d3a8c1ff84d7033fb1a88e53e files/3.0.2-r4/xend.initd 1297 +AUX 3.0.2-r4/xendomains.initd 2284 RMD160 b3df4b127ce9926ebd492e9b6c38233461eb2f3e SHA1 8a2451f6d42b0496c3dab94a9b392db9cda075b1 SHA256 33d153f233bc6ecc5098cb33ab0fe9a888b98389019f0103866ef04c15952d5a +MD5 421a1b55c1b22368399ac3f0d1fb4efc files/3.0.2-r4/xendomains.initd 2284 +RMD160 b3df4b127ce9926ebd492e9b6c38233461eb2f3e files/3.0.2-r4/xendomains.initd 2284 +SHA256 33d153f233bc6ecc5098cb33ab0fe9a888b98389019f0103866ef04c15952d5a files/3.0.2-r4/xendomains.initd 2284 AUX xen-consoles.logrotate 63 RMD160 035bd8baf1ba68a5525bab4379c0c4e350001a74 SHA1 6f88a4da3349aade6070dfc5c4465e2c00f3e68c SHA256 0da87a4b9094f934e3de937e8ef8d3afc752e76793aa3d730182d0241e118b19 MD5 9df68ac65dc3f372f5d61183abdc83ff files/xen-consoles.logrotate 63 RMD160 035bd8baf1ba68a5525bab4379c0c4e350001a74 files/xen-consoles.logrotate 63 @@ -55,10 +71,14 @@ EBUILD xen-tools-3.0.2-r3.ebuild 5530 RMD160 fe932ebe8722970f5a433a0619552c6ec2f MD5 11588a83ffd3177430efeca5cc668ba3 xen-tools-3.0.2-r3.ebuild 5530 RMD160 fe932ebe8722970f5a433a0619552c6ec2f93eaf xen-tools-3.0.2-r3.ebuild 5530 SHA256 cff3399ef7a791cafcf2053c00124ab56772b730ac8aa32a088ced857b011c1e xen-tools-3.0.2-r3.ebuild 5530 -MISC ChangeLog 4062 RMD160 78653570587403aa5e04541b135ddd0f4f60835f SHA1 ec6271ba72eabdf409404613d9429a1f624ccb73 SHA256 07d9d83bfd17a744f49111142b2e827367a5aad766666461017407f48ce079f5 -MD5 e53a1414ff96596d233b5b7d2202d739 ChangeLog 4062 -RMD160 78653570587403aa5e04541b135ddd0f4f60835f ChangeLog 4062 -SHA256 07d9d83bfd17a744f49111142b2e827367a5aad766666461017407f48ce079f5 ChangeLog 4062 +EBUILD xen-tools-3.0.2-r4.ebuild 5866 RMD160 6fabc675848cdf2544fbeba716fc45d12566f2a1 SHA1 ec3038aeb2272a70491b3496090f10e341a64c40 SHA256 12ba21944106878a0428eba664043d261ce7c5b6e071a4947cf4e104b92ef5e6 +MD5 83fdf00b38417083698ca0134f67477f xen-tools-3.0.2-r4.ebuild 5866 +RMD160 6fabc675848cdf2544fbeba716fc45d12566f2a1 xen-tools-3.0.2-r4.ebuild 5866 +SHA256 12ba21944106878a0428eba664043d261ce7c5b6e071a4947cf4e104b92ef5e6 xen-tools-3.0.2-r4.ebuild 5866 +MISC ChangeLog 5868 RMD160 b2edf563779d4ef0e1f9bfb88259a7fc6bc89e23 SHA1 cc44f41eb01731112387ddca96ac65d183a570ce SHA256 f6b3a2a2185bfcbcbed7716b5575225a66ccceb4c0cfcb0f0f0aa600bc9f5b99 +MD5 fdde02803777fe167085e9c76c463f29 ChangeLog 5868 +RMD160 b2edf563779d4ef0e1f9bfb88259a7fc6bc89e23 ChangeLog 5868 +SHA256 f6b3a2a2185bfcbcbed7716b5575225a66ccceb4c0cfcb0f0f0aa600bc9f5b99 ChangeLog 5868 MISC metadata.xml 156 RMD160 bb062b1ba5554779dcfd0e73baf533ce9fbcdf68 SHA1 e6da014f2004758c7a806592ef9450489eebf593 SHA256 4a030777459245372bda9f7925f3a5ed3ef2b29b77e1a2971f3400ac2059b1e2 MD5 559b4095659a2a2a489784de8a6ef95e metadata.xml 156 RMD160 bb062b1ba5554779dcfd0e73baf533ce9fbcdf68 metadata.xml 156 @@ -69,3 +89,6 @@ SHA256 274536fc8a3cb10fda114e533062b0dbddcda4ae15f52033a39b85785b221794 files/di MD5 6618adc624bc8ab64af0f4555c33529a files/digest-xen-tools-3.0.2-r3 235 RMD160 ad3a1d2a82c40b0bca653431c2d7964809580e5e files/digest-xen-tools-3.0.2-r3 235 SHA256 274536fc8a3cb10fda114e533062b0dbddcda4ae15f52033a39b85785b221794 files/digest-xen-tools-3.0.2-r3 235 +MD5 6618adc624bc8ab64af0f4555c33529a files/digest-xen-tools-3.0.2-r4 235 +RMD160 ad3a1d2a82c40b0bca653431c2d7964809580e5e files/digest-xen-tools-3.0.2-r4 235 +SHA256 274536fc8a3cb10fda114e533062b0dbddcda4ae15f52033a39b85785b221794 files/digest-xen-tools-3.0.2-r4 235 diff --git a/app-emulation/xen-tools/files/3.0.2-r4/pygrub-progsreiserfs-0.3.1.patch b/app-emulation/xen-tools/files/3.0.2-r4/pygrub-progsreiserfs-0.3.1.patch new file mode 100644 index 000000000000..2132a6378711 --- /dev/null +++ b/app-emulation/xen-tools/files/3.0.2-r4/pygrub-progsreiserfs-0.3.1.patch @@ -0,0 +1,56 @@ +diff -urN xen-3.0.2/tools/pygrub/src/fsys/reiser/reisermodule.c xen-3.0.2-b/tools/pygrub/src/fsys/reiser/reisermodule.c +--- xen-3.0.2/tools/pygrub/src/fsys/reiser/reisermodule.c 2006-04-09 18:05:53.000000000 -0400 ++++ xen-3.0.2-b/tools/pygrub/src/fsys/reiser/reisermodule.c 2006-08-18 12:51:42.000000000 -0400 +@@ -17,7 +17,7 @@ + #include <stdlib.h> + #include <stdio.h> + +-#include <dal/file_dal.h> ++#include <dal/file.h> + #include <reiserfs/reiserfs.h> + + #if (PYTHON_API_VERSION >= 1011) +@@ -46,8 +46,7 @@ + + if (!dal) return; + +- close((int)(unsigned long)dal->dev); +- dal_free(dal); ++ dal_close(dal); + } + + /* reiser file object */ +@@ -195,7 +194,7 @@ + if (fs->fs != NULL) + { + reiserfs_fs_close(fs->fs); +- file_dal_close(fs->dal); ++ file_close(fs->dal); + fs->fs = NULL; + } + Py_INCREF(Py_None); +@@ -218,13 +217,13 @@ + return NULL; + } + +- if (!(dal = file_dal_open(name, block_size, O_RDONLY))) { ++ if (!(dal = file_open(name, block_size, O_RDONLY))) { + PyErr_SetString(PyExc_ValueError, "Couldn't create device abstraction"); + return NULL; + } + + if (!(rfs = reiserfs_fs_open_fast(dal, dal))) { +- file_dal_close(dal); ++ file_close(dal); + PyErr_SetString(PyExc_ValueError, "unable to open file"); + return NULL; + } +@@ -265,7 +264,7 @@ + if (fs->fs != NULL) + { + reiserfs_fs_close(fs->fs); +- file_dal_close(fs->dal); ++ file_close(fs->dal); + fs->fs = NULL; + } + PyObject_DEL(fs); diff --git a/app-emulation/xen-tools/files/3.0.2-r4/xc_ptrace.patch b/app-emulation/xen-tools/files/3.0.2-r4/xc_ptrace.patch new file mode 100644 index 000000000000..af51c3d88a77 --- /dev/null +++ b/app-emulation/xen-tools/files/3.0.2-r4/xc_ptrace.patch @@ -0,0 +1,24 @@ +--- tools/libxc/xc_ptrace.c-orig 2006-10-13 15:53:29.000000000 +1000 ++++ tools/libxc/xc_ptrace.c 2006-10-13 15:54:06.000000000 +1000 +@@ -597,17 +597,13 @@ + online_vcpus_changed(cpumap); + break; + +- case PTRACE_SETFPREGS: +- case PTRACE_SETFPXREGS: +- case PTRACE_PEEKUSER: +- case PTRACE_POKEUSER: +- case PTRACE_SYSCALL: +- case PTRACE_KILL: +- goto out_unspported; /* XXX not yet supported */ +- + case PTRACE_TRACEME: + printf("PTRACE_TRACEME is an invalid request under Xen\n"); + goto out_error; ++ ++ default: ++ goto out_unspported; /* XXX not yet supported */ ++ + } + + return retval; diff --git a/app-emulation/xen-tools/files/3.0.2-r4/xend.initd b/app-emulation/xen-tools/files/3.0.2-r4/xend.initd new file mode 100644 index 000000000000..3ecd31f8661d --- /dev/null +++ b/app-emulation/xen-tools/files/3.0.2-r4/xend.initd @@ -0,0 +1,61 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/3.0.2-r4/xend.initd,v 1.1 2006/10/14 00:00:03 aross Exp $ + +opts="start stop status restart" + +depend() { + need net + before xendomains sshd ntp-client ntpd nfs nfsmount rsyncd portmap dhcp +} + +await_daemons_up() { + for ((i=0; i<5; i++)); do + sleep 1 + /usr/sbin/xend status && return 0 + done + return 1 +} + +is_privileged_domain() { + grep -qsE '^control_d$' /proc/xen/capabilities + return $? +} + +start() { + if is_privileged_domain ; then + ebegin "Starting Xen control daemon" + /usr/sbin/xend start + /usr/sbin/xend status || await_daemons_up + eend $? + else + eerror "Can't start xend - this is not a privileged domain." + return 1 + fi +} + +stop() { + if [ "$(xm list | wc -l)" -gt 2 ]; then + ebegin " Stopping all domains" + /usr/sbin/xm shutdown --all --wait >/dev/null + eend $? + fi + + ebegin "Stopping Xen control daemon" + /usr/sbin/xend stop + eend $? + + # This needs more testing (bug #149321) + #ebegin "Stopping xenconsoled" + #kill $(</var/run/xenconsoled.pid) + #eend $? + + #ebegin "Stopping xenstored" + #kill $(</var/run/xenstore.pid) + #eend $? +} + +status() { + is_privileged_domain && /usr/sbin/xend status +} diff --git a/app-emulation/xen-tools/files/3.0.2-r4/xendomains.initd b/app-emulation/xen-tools/files/3.0.2-r4/xendomains.initd new file mode 100755 index 000000000000..039c76527aa1 --- /dev/null +++ b/app-emulation/xen-tools/files/3.0.2-r4/xendomains.initd @@ -0,0 +1,96 @@ +#!/sbin/runscript +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/3.0.2-r4/xendomains.initd,v 1.1 2006/10/14 00:00:03 aross Exp $ + +opts="start stop status restart" + +depend() { + need xend + after dhcp +} + +get_domname() { + local name_from_file=$(sed -rn 's/^name\W*=\W*\"?([[:alnum:]_\.-]+)\"?\W*;?/\1/p' "${1}" | tail -n 1) + + if [[ -z ${name_from_file} ]] ; then + basename "${1}" + else + echo ${name_from_file} + fi +} + +is_running() { + /usr/sbin/xm list "${1}" >/dev/null 2>&1 +} + +using_screen() { + [[ "${SCREEN}" == "yes" || "${SCREEN}" == "YES" ]] +} + +set_screen_cmd() { + screen_cmd="screen -q -r ${SCREEN_NAME:=xen} -X" +} + +start() { + set_screen_cmd + + einfo "Starting Xen domains from ${AUTODIR:=/etc/xen/auto}" + if using_screen ; then + ebegin "Creating screen session to hold domain consoles" + ( screen -d -m -S ${SCREEN_NAME} -t dom0 \ + && ${screen_cmd} zombie dr \ + && logrotate -f /etc/xen/xen-consoles.logrotate \ + && ${screen_cmd} logfile /var/log/xen-consoles/%t.log \ + && ${screen_cmd} logfile flush ${SCREEN_LOG_INTERVAL:-1} \ + && ${screen_cmd} log on \ + && ${screen_cmd} deflog on ) >/dev/null + if [[ $? -ne 0 ]] ; then + eend 1 + return 1 + else + eend + fi + fi + # Create all domains with config files in AUTODIR. + for dom in $(ls "${AUTODIR}/"* 2>/dev/null); do + name=$(get_domname ${dom}) + if ! is_running ${name} ; then + ebegin " Starting domain ${name}" + if using_screen ; then + ${screen_cmd} screen -t ${name} xm create ${dom} -c + else + xm create --quiet ${dom} + fi + eend $? + else + einfo " Not starting domain ${name} - already running" + fi + done +} + +stop() { + set_screen_cmd + + einfo "Shutting down Xen domains from ${AUTODIR:=/etc/xen/auto}" + # Stop all domains with config files in AUTODIR. + for dom in $(ls "${AUTODIR}/"* 2>/dev/null); do + name=$(get_domname ${dom}) + if is_running ${name} ; then + ebegin " Stopping domain ${name}" + xm shutdown --wait ${name} >/dev/null + eend $? + else + einfo " Not stopping domain ${name} - not running" + fi + done + if using_screen ; then + ebegin "Closing screen session ${SCREEN_NAME}" + ${screen_cmd} quit + eend $? + fi +} + +status() { + /usr/sbin/xm list +} diff --git a/app-emulation/xen-tools/files/digest-xen-tools-3.0.2-r4 b/app-emulation/xen-tools/files/digest-xen-tools-3.0.2-r4 new file mode 100644 index 000000000000..724d092d5489 --- /dev/null +++ b/app-emulation/xen-tools/files/digest-xen-tools-3.0.2-r4 @@ -0,0 +1,3 @@ +MD5 544eab940a0734a55459d648e5c3b224 xen-3.0.2-src.tgz 4933621 +RMD160 34e4431a981891319f8a5ea0c3f604e7d8d7d7af xen-3.0.2-src.tgz 4933621 +SHA256 f18ffab16a457fa721d11933c75f8288f6958c88c2669857c7c11d5107ba2951 xen-3.0.2-src.tgz 4933621 diff --git a/app-emulation/xen-tools/xen-tools-3.0.2-r4.ebuild b/app-emulation/xen-tools/xen-tools-3.0.2-r4.ebuild new file mode 100644 index 000000000000..ca6112b1be0f --- /dev/null +++ b/app-emulation/xen-tools/xen-tools-3.0.2-r4.ebuild @@ -0,0 +1,199 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-3.0.2-r4.ebuild,v 1.1 2006/10/14 00:00:03 aross Exp $ + +inherit mount-boot flag-o-matic distutils eutils multilib + +DESCRIPTION="Xend daemon and tools" +HOMEPAGE="http://xen.sourceforge.net" +SRC_URI="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/xen-${PV}-src.tgz" +S="${WORKDIR}/xen-${PV}" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc debug screen custom-cflags pygrub vnc sdl" + +CDEPEND="dev-lang/python + sys-libs/zlib + sdl? ( media-libs/libsdl ) + vnc? ( media-libs/libsdl ) + pygrub? ( >=sys-fs/progsreiserfs-0.3.1_rc8 )" + +DEPEND="${CDEPEND} + sys-devel/gcc + dev-lang/perl + app-misc/pax-utils + doc? ( + dev-tex/latex2html + media-gfx/transfig + ) + vnc? ( net-libs/libvncserver )" + +RDEPEND="${CDEPEND} + >=app-emulation/xen-3.0.2 + sys-apps/iproute2 + net-misc/bridge-utils + screen? ( + app-misc/screen + app-admin/logrotate + ) + || ( sys-fs/udev sys-apps/hotplug )" + +PYTHON_MODNAME="xen grub" + +pkg_setup() { + if use vnc && ! use sdl ; then + ewarn "You have the 'vnc' USE flag set, but not 'sdl'." + ewarn "VNC functionality requires SDL support, so it" + ewarn "will be enabled anyway." + fi + + if [[ "$(scanelf -s __guard -q `which python`)" ]] ; then + ewarn "xend may not work when python is built with stack smashing protection (ssp)." + ewarn "If 'xm create' fails with '<ProtocolError for /RPC2: -1 >', see bug #141866" + fi + + if [[ -z ${XEN_TARGET_ARCH} ]] ; then + if use x86 ; then + export XEN_TARGET_ARCH="x86_32" + elif use amd64 ; then + export XEN_TARGET_ARCH="x86_64" + else + die "Unsupported architecture!" + fi + fi +} + +src_unpack() { + unpack ${A} + cd "${S}" + + # if the user *really* wants to use their own custom-cflags, let them + if use custom-cflags; then + einfo "User wants their own CFLAGS - removing defaults" + # try and remove all the default custom-cflags + find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \ + -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \ + -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \ + -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \ + -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \ + -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \ + -i {} \; + fi + + # xen tries to be smart and filter out CFLAGs not supported by gcc. + # It doesn't handle no* flags though, but flag-o-matic's test-flag-CC does. + for FLAG in -nopie -fno-stack-protector -fno-stack-protector-all; do + test-flag-CC ${FLAG} && HARDFLAGS="${HARDFLAGS} ${FLAG}" + done + sed -i "s/^CFLAGS :=$/& ${HARDFLAGS}/" \ + "${S}"/tools/firmware/{hvmloader,vmxassist}/Makefile + + + # Disable the 32bit-only vmxassist if we are not on x86 + # and we don't support the x86 ABI + if ! use x86 && ! has x86 $(get_all_abis); then + sed -i -e "/SUBDIRS += vmxassist/d" "${S}"tools/firmware/Makefile + fi + + if use pygrub; then + # Upstream use Debian and hence progsreiserfs-0.3.0, + # which has a different API to 0.3.1 + epatch "${FILESDIR}/${PVR}"/pygrub-progsreiserfs-0.3.1.patch + else + sed -i -e "/^SUBDIRS += pygrub$/d" "${S}"/tools/Makefile + fi + + # Fixes for hardened and amd64 + epatch "${FILESDIR}"/${P}-bxclobber.patch + epatch "${FILESDIR}"/${P}-pushpop.patch + + # Allow --as-needed LDFLAGS + epatch "${FILESDIR}/${P}"--as-needed.patch + + # Allow building with python-2.5 (bug #149138) + # Backported from upstream - should be in 3.0.3 + sed -i 's/\.2|^2\.3|^2\.4/.[2345]/' "${S}"/tools/check/check_python + + # Fix upstream's broken test cases (bug #141233) + epatch "${FILESDIR}/${P}"-test-uuid.patch + epatch "${FILESDIR}/${P}"-test-xauthority.patch + + # Fix compilation error with newer glibc (bug #151014) + # Backported from upstream - should be in 3.0.3 + epatch "${FILESDIR}/${PVR}"/xc_ptrace.patch +} + +src_compile() { + local myopt myconf + use debug && myopt="${myopt} debug=y" + + myconf="${myconf} $(use_enable vnc)" + if use vnc ; then + myconf="${myconf} --enable-sdl" + else + myconf="${myconf} $(use_enable sdl)" + fi + + use custom-cflags || unset CFLAGS + gcc-specs-ssp && append-flags -fno-stack-protector -fno-stack-protector-all + + (cd tools/ioemu && econf ${myconf}) || die "configure failured" + emake -C tools ${myopt} || die "compile failed" + + if use doc; then + sh ./docs/check_pkgs || die "package check failed" + emake -C docs || die "compiling docs failed" + fi + + emake -C docs man-pages || die "make man-pages failed" +} + +src_install() { + local myopt="XEN_PYTHON_NATIVE_INSTALL=1" + + make DESTDIR="${D}" ${myopt} install-tools \ + || die "install failed" + + # Remove RedHat-specific stuff + rm -rf "${D}"/etc/sysconfig + + if use doc; then + make DESTDIR="${D}" -C docs install || die "install docs failed" + # Rename doc/xen to the Gentoo-style doc/xen-x.y + mv "${D}"/usr/share/doc/{${PN},${PF}} + fi + + doman docs/man?/* + + newinitd "${FILESDIR}/${PVR}"/xend.initd xend + newconfd "${FILESDIR}"/xendomains.confd xendomains + newinitd "${FILESDIR}/${PVR}"/xendomains.initd xendomains + + if use screen; then + cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains + cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/ + keepdir /var/log/xen-consoles + fi + + # xend expects these to exist + keepdir /var/run/xenstored /var/lib/xenstored /var/xen/dump +} + +pkg_postinst() { + elog "Please visit the Xen and Gentoo wiki:" + elog "http://gentoo-wiki.com/HOWTO_Xen_and_Gentoo" + + if ! built_with_use dev-lang/python ncurses; then + echo + ewarn "NB: Your dev-lang/python is built without USE=ncurses." + ewarn "Please rebuild python with USE=ncurses to make use of xenmon.py." + fi + + if grep -qsF XENSV= "${ROOT}/etc/conf.d/xend"; then + echo + elog "xensv is broken upstream (Gentoo bug #142011)." + elog "Please remove '${ROOT%/}/etc/conf.d/xend', as it is no longer needed." + fi +} |