summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-emulation/xen-tools')
-rw-r--r--app-emulation/xen-tools/ChangeLog8
-rw-r--r--app-emulation/xen-tools/Manifest12
-rw-r--r--app-emulation/xen-tools/files/xen-consoles.logrotate5
-rw-r--r--app-emulation/xen-tools/files/xen-tools-3.1.0-xen-detect-nopie-fix.patch11
-rw-r--r--app-emulation/xen-tools/files/xen-tools-3.1.3-network-bridge-broadcast.patch11
-rw-r--r--app-emulation/xen-tools/files/xen-tools-3.2.1-qemu-nodocs.patch36
-rw-r--r--app-emulation/xen-tools/files/xend.initd-r271
-rw-r--r--app-emulation/xen-tools/files/xendomains-screen.confd15
-rw-r--r--app-emulation/xen-tools/files/xendomains.confd9
-rwxr-xr-xapp-emulation/xen-tools/files/xendomains.initd-r1117
-rw-r--r--app-emulation/xen-tools/metadata.xml18
-rw-r--r--app-emulation/xen-tools/xen-tools-3.2.3-r1.ebuild223
12 files changed, 536 insertions, 0 deletions
diff --git a/app-emulation/xen-tools/ChangeLog b/app-emulation/xen-tools/ChangeLog
new file mode 100644
index 0000000..e2706c7
--- /dev/null
+++ b/app-emulation/xen-tools/ChangeLog
@@ -0,0 +1,8 @@
+# ChangeLog for app-emulation/xen-tools
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+ 26 May 2009; Wolfram Schlich <wschlich@gentoo.org> -files/xend.initd-r1,
+ +files/xend.initd-r2, -xen-tools-3.2.3.ebuild, +xen-tools-3.2.3-r1.ebuild:
+ fix xend init script
+
diff --git a/app-emulation/xen-tools/Manifest b/app-emulation/xen-tools/Manifest
new file mode 100644
index 0000000..74d6944
--- /dev/null
+++ b/app-emulation/xen-tools/Manifest
@@ -0,0 +1,12 @@
+AUX xen-consoles.logrotate 63 RMD160 035bd8baf1ba68a5525bab4379c0c4e350001a74 SHA1 6f88a4da3349aade6070dfc5c4465e2c00f3e68c SHA256 0da87a4b9094f934e3de937e8ef8d3afc752e76793aa3d730182d0241e118b19
+AUX xen-tools-3.1.0-xen-detect-nopie-fix.patch 385 RMD160 5ad84ac847c1eeeaa7aac2fbcfd3b476ee7c991d SHA1 bd59257c972b7cd976b4b1953ff44a43a1d2b003 SHA256 c8b7a0858001b15ff12cc652977eb7ada06b036a8c593fccac9015ce05c84816
+AUX xen-tools-3.1.3-network-bridge-broadcast.patch 490 RMD160 67a2a7f07e986b0c43f75ade5c073bbcfdae5fca SHA1 53171e6764c6018e529b805a98fa369d2568364b SHA256 1c971a0a81219b8626a25c2d135d51bc8108e7ac839794f356cc349386fe34e3
+AUX xen-tools-3.2.1-qemu-nodocs.patch 1377 RMD160 d20780a6ac4a9f2fee98523edd6701e6bc15951f SHA1 6d7cb96b5fd717291d9d18885bb7a6be869882e4 SHA256 f8dec919bb0187a71217643f302403de7d488729109e21349e5627b3bb569656
+AUX xend.initd-r2 1557 RMD160 397f28691af38acdb3bff1d96fbb8926aa3f77ae SHA1 2ccf9db106629e8bfc956db992bb88160d8cc9c9 SHA256 8b2c11aaf5602a828d1b695ef1706db41371235a85bbc8de037596bc44fefa7f
+AUX xendomains-screen.confd 594 RMD160 79c7a3546cf1d3f8558c2120d6e8c93c753e66b9 SHA1 7f9ed2986495d5fa4a6f8b050cd632fde6a19994 SHA256 c4d7ffcdbeccc5e93460e2abbf70d642a78a363d79ccbbce0407f50cace54e0a
+AUX xendomains.confd 291 RMD160 75d55db5360da12fc3d721c37001ccbfbb844e52 SHA1 e7be8973a4bcbfc7680258e369b07e2ed097ef49 SHA256 2fac318bb96b357dd185f7729d83c0a0b941799cdb89c24ed83051bb085735dc
+AUX xendomains.initd-r1 2808 RMD160 46368e4933160d4e7c9a48c5992b502eba69f287 SHA1 fc5d84cd95f9789c4bb9e5e441246d4b19493ee1 SHA256 a6781ac33d9471ed47bbf119f8d648d154ae35fc76ddfd7d24d7a85217e9538b
+DIST xen-3.2.3.tar.gz 6389954 RMD160 3b755b20130c4e4ffdb654b586a3b4377380c63f SHA1 c51835a88070d629759fa64b8352493bc2c9ea25 SHA256 a76272153d6e65b0165f526fbdb2cd8f6432c632c2d259d7d47818b5ca2f5811
+EBUILD xen-tools-3.2.3-r1.ebuild 6648 RMD160 9749e38ad532446a2a5c769f07e4cf88e14935f9 SHA1 eaa760471267eb1150507f458c7ade4f38ce00e4 SHA256 ad156970581640c52a23e272a51e22994302b2307280f35a3a9c5ab00e728072
+MISC ChangeLog 300 RMD160 9c26955b96b6d4202e265fc6c5275611828e0fad SHA1 58fd5df43152758ed45c5c350006026d6122eae5 SHA256 aa9cde7ddd763c23659553e1c4394b9fa93270fad7988ca9b63e3da187b06b87
+MISC metadata.xml 792 RMD160 22e9eea632d96fb0c0ae482c72dfabebc1c0acaa SHA1 a98f0dfd4743f7d3a33833e4f010576c718e53ca SHA256 6e9589982232db6091dad8d45a2c376537372981fc822f8043cb270df7372ab5
diff --git a/app-emulation/xen-tools/files/xen-consoles.logrotate b/app-emulation/xen-tools/files/xen-consoles.logrotate
new file mode 100644
index 0000000..c644523
--- /dev/null
+++ b/app-emulation/xen-tools/files/xen-consoles.logrotate
@@ -0,0 +1,5 @@
+/var/log/xen-consoles/*.log {
+ rotate 7
+ missingok
+ compress
+}
diff --git a/app-emulation/xen-tools/files/xen-tools-3.1.0-xen-detect-nopie-fix.patch b/app-emulation/xen-tools/files/xen-tools-3.1.0-xen-detect-nopie-fix.patch
new file mode 100644
index 0000000..6515d12
--- /dev/null
+++ b/app-emulation/xen-tools/files/xen-tools-3.1.0-xen-detect-nopie-fix.patch
@@ -0,0 +1,11 @@
+Index: xen-3.1.0-src/tools/misc/Makefile
+===================================================================
+--- xen-3.1.0-src.orig/tools/misc/Makefile
++++ xen-3.1.0-src/tools/misc/Makefile
+@@ -45,3 +45,6 @@ clean:
+
+ xenperf: %: %.o Makefile
+ $(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -lxenctrl
++
++xen-detect: %: %.c Makefile
++ $(CC) $(CFLAGS) $(call cc-option,$(CC),-nopie,) -o $@ $<
diff --git a/app-emulation/xen-tools/files/xen-tools-3.1.3-network-bridge-broadcast.patch b/app-emulation/xen-tools/files/xen-tools-3.1.3-network-bridge-broadcast.patch
new file mode 100644
index 0000000..f916ece
--- /dev/null
+++ b/app-emulation/xen-tools/files/xen-tools-3.1.3-network-bridge-broadcast.patch
@@ -0,0 +1,11 @@
+--- xen-3.1.3/tools/examples/network-bridge.orig 2008-01-31 02:06:54.000000000 -0800
++++ xen-3.1.3/tools/examples/network-bridge 2008-02-02 17:21:25.000000000 -0800
+@@ -70,7 +70,7 @@
+ vif0="vif0.${vifnum}"
+
+ get_ip_info() {
+- addr_pfx=`ip addr show dev $1 | egrep '^ *inet' | sed -e 's/ *inet //' -e 's/ .*//'`
++ addr_pfx=`ip addr show dev $1 | egrep '^ *inet' | sed -e 's/ *inet //' -e "s/$1//"`
+ gateway=`ip route show dev $1 | fgrep default | sed 's/default via //'`
+ }
+
diff --git a/app-emulation/xen-tools/files/xen-tools-3.2.1-qemu-nodocs.patch b/app-emulation/xen-tools/files/xen-tools-3.2.1-qemu-nodocs.patch
new file mode 100644
index 0000000..d112dd4
--- /dev/null
+++ b/app-emulation/xen-tools/files/xen-tools-3.2.1-qemu-nodocs.patch
@@ -0,0 +1,36 @@
+Introduce a configure option to disable building of qemu documentation.
+Gentoo Bug #192427
+
+Index: xen-3.2.1/tools/ioemu/configure
+===================================================================
+--- xen-3.2.1.orig/tools/ioemu/configure
++++ xen-3.2.1/tools/ioemu/configure
+@@ -214,6 +214,8 @@ for opt do
+ ;;
+ --disable-sdl) sdl="no"
+ ;;
++ --enable-docs) build_docs="yes"
++ ;;
+ --enable-coreaudio) coreaudio="yes"
+ ;;
+ --enable-alsa) alsa="yes"
+@@ -295,6 +297,7 @@ echo " --enable-coreaudio enable
+ echo " --enable-alsa enable ALSA audio driver"
+ echo " --enable-fmod enable FMOD audio driver"
+ echo " --enabled-dsound enable DirectSound audio driver"
++echo " --enable-docs enable building of docs (requires texi2html and pod2man)"
+ echo " --disable-vnc-tls disable TLS encryption for VNC server"
+ echo " --enable-system enable all system emulation targets"
+ echo " --disable-system disable all system emulation targets"
+@@ -576,8 +579,9 @@ EOF
+ fi
+
+ # Check if tools are available to build documentation.
+-if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
+- build_docs="yes"
++if [ ! -x "`which texi2html`" ] || [ ! -x "`which pod2man`" ]; then
++ echo "Missing texi2html or pod2man, will not build docs"
++ build_docs="no"
+ fi
+
+ if test "$mingw32" = "yes" ; then
diff --git a/app-emulation/xen-tools/files/xend.initd-r2 b/app-emulation/xen-tools/files/xend.initd-r2
new file mode 100644
index 0000000..b34a5a7
--- /dev/null
+++ b/app-emulation/xen-tools/files/xend.initd-r2
@@ -0,0 +1,71 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+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
+ /usr/sbin/xend status && return 0
+ sleep 1
+ 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 && await_daemons_up
+ eend $?
+ else
+ eerror "Can't start xend - this is not a privileged domain."
+ return 1
+ fi
+}
+
+stop() {
+ if [ "$(xm list 2>/dev/null | wc -l)" -gt 2 ]; then
+ ebegin "Stopping all Xen domains"
+ /usr/sbin/xm shutdown --all --wait >/dev/null
+ eend $?
+ fi
+
+ ebegin "Stopping Xen control daemon"
+ /usr/sbin/xend stop
+ eend $?
+
+ #ebegin "Stopping xenconsoled"
+ #kill $(</var/run/xenconsoled.pid)
+ #eend $?
+
+ #ebegin "Stopping xenstored"
+ #kill $(</var/run/xenstore.pid)
+ #eend $?
+}
+
+restart() {
+ # IMPORTANT: do NOT restart xenstored/xenconsoled when restarting
+ # just xend, as this can be fatal!
+ # When restarting xend, leave alone xenstored/xenconsoled and all
+ # running domains.
+ # See http://article.gmane.org/gmane.comp.emulators.xen.user/40656
+ ebegin "Restarting Xen control daemon"
+ /usr/sbin/xend restart
+ eend $?
+ # we fool /etc/init.d/runscript.sh:svc_restart() here: svc_stop svc_start
+}
+
+status() {
+ is_privileged_domain && /usr/sbin/xend status
+}
diff --git a/app-emulation/xen-tools/files/xendomains-screen.confd b/app-emulation/xen-tools/files/xendomains-screen.confd
new file mode 100644
index 0000000..1482c0a
--- /dev/null
+++ b/app-emulation/xen-tools/files/xendomains-screen.confd
@@ -0,0 +1,15 @@
+# When SCREEN="yes", domains in AUTODIR have their consoles connected to a
+# screen session named SCREEN_NAME, with output logged to individual files
+# named after each domain and written to /var/log/xen-consoles/ . These files
+# are rotated (using app-admin/logrotate) every time xendomains is started.
+
+SCREEN="yes"
+SCREEN_NAME="xen"
+
+# Number of seconds between writes to screen's logfiles.
+#
+# Lower values mean more disk activity and hence a possible performance
+# impact, but higher values mean a greater chance of loosing some output
+# in the event of a crash.
+
+SCREEN_LOG_INTERVAL="1"
diff --git a/app-emulation/xen-tools/files/xendomains.confd b/app-emulation/xen-tools/files/xendomains.confd
new file mode 100644
index 0000000..90c1f52
--- /dev/null
+++ b/app-emulation/xen-tools/files/xendomains.confd
@@ -0,0 +1,9 @@
+# /etc/conf.d/xendomains
+
+# Directory of domains to boot. AUTODIR should contain one or more symlinks
+# to domain config files in /etc/xen
+AUTODIR=/etc/xen/auto
+
+# Send shutdown commands to all domains in parallel instead of waiting for
+# each to shutdown individually
+PARALLEL_SHUTDOWN=yes
diff --git a/app-emulation/xen-tools/files/xendomains.initd-r1 b/app-emulation/xen-tools/files/xendomains.initd-r1
new file mode 100755
index 0000000..85a76a1
--- /dev/null
+++ b/app-emulation/xen-tools/files/xendomains.initd-r1
@@ -0,0 +1,117 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+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 -c ${SCREENRC:-/dev/null} -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 -c ${SCREENRC:-/dev/null} -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:=/etc/xen/auto}/"* 2>/dev/null | sort); 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.
+ DOMAINS="$(ls "${AUTODIR:=/etc/xen/auto}/"* 2>/dev/null | sort -r)"
+
+ if [[ "$PARALLEL_SHUTDOWN" = "yes" ]] ; then
+ for dom in $DOMAINS ; do
+ name=$(get_domname ${dom})
+ if is_running ${name} ; then
+ ebegin " Asking domain ${name} to shutdown in the background..."
+ xm shutdown --wait ${name} >/dev/null &
+ else
+ einfo " Not stopping domain ${name} - not running"
+ fi
+ done
+ einfo " Waiting for shutdown of domains that are still running"
+ wait
+ eend $?
+ else
+ for dom in $DOMAINS ; do
+ name=$(get_domname ${dom})
+ if is_running ${name} ; then
+ ebegin " Waiting for domain ${name} to shutdown"
+ xm shutdown --wait ${name} >/dev/null
+ eend $?
+ else
+ einfo " Not stopping domain ${name} - not running"
+ fi
+ done
+ fi
+ if using_screen ; then
+ if ${screen_cmd} sleep 0 >/dev/null 2>&1 ; then
+ ebegin "Closing screen session ${SCREEN_NAME}"
+ ${screen_cmd} quit
+ eend $?
+ else
+ eend 0
+ fi
+ fi
+}
+
+status() {
+ /usr/sbin/xm list
+}
diff --git a/app-emulation/xen-tools/metadata.xml b/app-emulation/xen-tools/metadata.xml
new file mode 100644
index 0000000..1cc8665
--- /dev/null
+++ b/app-emulation/xen-tools/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>xen</herd>
+<use>
+ <flag name='custom-cflags'>Use CFLAGS from /etc/make.conf rather than the
+ default Xen CFLAGS (not supported)</flag>
+ <flag name='hvm'>Enable support for hardware based virtualization (VT-x,
+ AMD-v</flag>
+ <flag name='pygrub'>Install the pygrub boot loader</flag>
+ <flag name='screen'>Enable support for running domain U console in an
+ <pkg>app-misc/screen</pkg> session</flag>
+ <flag name='acm'>Enable the ACM/sHype XSM module from IBM</flag>
+ <flag name='flask'>Enable the Flask XSM module from NSA</flag>
+ <flag name='api'>Build the C libxenapi bindings</flag>
+<!-- <flag name='vtpm'>Enable TPM emulation</flag> -->
+</use>
+</pkgmetadata>
diff --git a/app-emulation/xen-tools/xen-tools-3.2.3-r1.ebuild b/app-emulation/xen-tools/xen-tools-3.2.3-r1.ebuild
new file mode 100644
index 0000000..f161671
--- /dev/null
+++ b/app-emulation/xen-tools/xen-tools-3.2.3-r1.ebuild
@@ -0,0 +1,223 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit flag-o-matic eutils multilib
+
+DESCRIPTION="Xend daemon and tools"
+HOMEPAGE="http://xen.org/"
+SRC_URI="http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz"
+S="${WORKDIR}/xen-${PV}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc debug screen custom-cflags pygrub hvm"
+
+CDEPEND="dev-lang/python
+ sys-libs/zlib
+ hvm? ( media-libs/libsdl )"
+
+DEPEND="${CDEPEND}
+ sys-devel/gcc
+ dev-lang/perl
+ app-misc/pax-utils
+ doc? (
+ dev-tex/latex2html
+ media-gfx/transfig
+ media-gfx/graphviz
+ )
+ hvm? (
+ x11-proto/xproto
+ net-libs/libvncserver
+ sys-devel/dev86
+ )"
+
+RDEPEND="${CDEPEND}
+ sys-apps/iproute2
+ net-misc/bridge-utils
+ screen? (
+ app-misc/screen
+ app-admin/logrotate
+ )
+ || ( sys-fs/udev sys-apps/hotplug )"
+
+PYTHON_MODNAME="xen grub"
+
+# hvmloader is used to bootstrap a fully virtualized kernel
+# Approved by QA team in bug #144032
+QA_WX_LOAD="usr/lib/xen/boot/hvmloader"
+
+pkg_setup() {
+ if ! use x86 && ! has x86 $(get_all_abis) && use hvm; then
+ eerror "HVM (VT-x and AMD-v) cannot be built on this system. An x86 or"
+ eerror "an amd64 multilib profile is required. Remove the hvm use flag"
+ eerror "to build xen-tools on your current profile."
+ die "USE=hvm is unsupported on this system."
+ fi
+
+ if [[ -z ${XEN_TARGET_ARCH} ]] ; then
+ if use x86 && use amd64; then
+ die "Confusion! Both x86 and amd64 are set in your use flags!"
+ elif 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
+
+ if use doc && ! built_with_use -o dev-tex/latex2html png gif; then
+ # die early instead of later
+ eerror "USE=doc requires latex2html with image support. Please add"
+ eerror "'png' and/or 'gif' to your use flags and re-emerge latex2html"
+ die "latex2html missing both png and gif flags"
+ fi
+
+ if use pygrub && ! built_with_use dev-lang/python ncurses; then
+ eerror "USE=pygrub requires python to be built with ncurses support. Please add"
+ eerror "'ncurses' to your use flags and re-emerge python"
+ die "python is missing ncurses flags"
+ 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
+
+ # Disable hvm support on systems that don't support x86_32 binaries.
+ if ! use hvm; then
+ chmod 644 tools/check/check_x11_devel
+ sed -i -e '/^CONFIG_IOEMU := y$/d' "${S}"/config/*.mk
+ sed -i -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' "${S}"/tools/Makefile
+ fi
+
+ if ! use pygrub; then
+ sed -i -e "/^SUBDIRS-y += pygrub$/d" "${S}"/tools/Makefile
+ fi
+
+ # Fix network broadcast on bridged networks
+ epatch "${FILESDIR}/${PN}-3.1.3-network-bridge-broadcast.patch"
+
+ # Fix building small dumb utility called 'xen-detect' on hardened
+ epatch "${FILESDIR}/${PN}-3.1.0-xen-detect-nopie-fix.patch"
+
+ # Introduce a configure option to disable qemu documentation building, #192427
+ epatch "${FILESDIR}/${PN}-3.2.1-qemu-nodocs.patch"
+}
+
+src_compile() {
+ export VARTEXFONTS="${T}/fonts"
+ local myopt myconf
+ use debug && myopt="${myopt} debug=y"
+
+ use custom-cflags || unset CFLAGS
+ if test-flag-CC -fno-strict-overflow; then
+ append-flags -fno-strict-overflow
+ fi
+
+ if use hvm; then
+ myconf="${myconf} --disable-system --disable-user"
+ (cd tools/ioemu && econf ${myconf}) || die "configure failured"
+ fi
+
+ 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}" -C tools ${myopt} install \
+ || 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}"/xend.initd-r2 xend \
+ || die "Couldn't install xen.initd"
+ newconfd "${FILESDIR}"/xendomains.confd xendomains \
+ || die "Couldn't install xendomains.confd"
+ newinitd "${FILESDIR}"/xendomains.initd-r1 xendomains \
+ || die "Couldn't install xendomains.initd"
+
+ 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 /var/lib/xen /var/log/xen
+
+ # for xendomains
+ keepdir /etc/xen/auto
+}
+
+pkg_postinst() {
+ elog "Official Xen Guide and the unoffical wiki page:"
+ elog " http://www.gentoo.org/doc/en/xen-guide.xml"
+ elog " http://gentoo-wiki.com/HOWTO_Xen_and_Gentoo"
+
+ if [[ "$(scanelf -s __guard -q $(type -P python))" ]] ; then
+ echo
+ 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"
+ ewarn "This probablem may be resolved as of Xen 3.0.4, if not post in the bug."
+ fi
+
+ 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 built_with_use sys-apps/iproute2 minimal; then
+ echo
+ ewarn "Your sys-apps/iproute2 is built with USE=minimal. Networking"
+ ewarn "will not work until you rebuild iproute2 without USE=minimal."
+ fi
+
+ if ! use hvm; then
+ echo
+ elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
+ elog "support enable the hvm use flag."
+ elog "An x86 or amd64 multilib system is required to build HVM support."
+ echo
+ elog "The ioemu use flag has been removed and replaced with hvm."
+ 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
+}