/[gentoo-x86]/app-emulation/xen/xen-4.2.2-r2.ebuild
Gentoo

Contents of /app-emulation/xen/xen-4.2.2-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Jan 24 15:37:31 2014 UTC (4 years, 7 months ago) by dlan
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
clean 4.3.0, and unstable ones

(Portage version: 2.2.8/cvs/Linux x86_64, signed Manifest commit with key 0xAABEFD55)

1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-emulation/xen/xen-4.2.2-r2.ebuild,v 1.1 2014/01/17 02:44:09 dlan Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python{2_6,2_7} )
8
9 if [[ $PV == *9999 ]]; then
10 KEYWORDS=""
11 REPO="xen-unstable.hg"
12 EHG_REPO_URI="http://xenbits.xensource.com/${REPO}"
13 S="${WORKDIR}/${REPO}"
14 live_eclass="mercurial"
15 else
16 KEYWORDS="~amd64 ~x86"
17 SRC_URI="http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz"
18 fi
19
20 inherit mount-boot flag-o-matic python-any-r1 toolchain-funcs eutils ${live_eclass}
21
22 DESCRIPTION="The Xen virtual machine monitor"
23 HOMEPAGE="http://xen.org/"
24 LICENSE="GPL-2"
25 SLOT="0"
26 IUSE="custom-cflags debug efi flask pae xsm"
27
28 DEPEND="${PYTHON_DEPS}
29 efi? ( >=sys-devel/binutils-2.22[multitarget] )
30 !efi? ( >=sys-devel/binutils-2.22[-multitarget] )"
31 RDEPEND=""
32 PDEPEND="~app-emulation/xen-tools-${PV}"
33
34 RESTRICT="test"
35
36 # Approved by QA team in bug #144032
37 QA_WX_LOAD="boot/xen-syms-${PV}"
38
39 REQUIRED_USE="
40 flask? ( xsm )
41 "
42
43 #Security patches
44 XSA_PATCHES=(
45 "${FILESDIR}"/${PN}-4-CVE-2013-1918-XSA-45_[1-7].patch
46 "${FILESDIR}"/${PN}-4.2-2013-2076-XSA-52to54.patch
47 "${FILESDIR}"/${PN}-4.2-CVE-2013-1432-XSA-58.patch
48 "${FILESDIR}"/${PN}-4.2-CVE-2013-4553-XSA-74.patch
49 "${FILESDIR}"/${PN}-CVE-2013-4554-XSA-76.patch
50 "${FILESDIR}"/${PN}-CVE-2013-6400-XSA-80.patch
51 )
52
53 pkg_setup() {
54 python-any-r1_pkg_setup
55 if [[ -z ${XEN_TARGET_ARCH} ]]; then
56 if use x86 && use amd64; then
57 die "Confusion! Both x86 and amd64 are set in your use flags!"
58 elif use x86; then
59 export XEN_TARGET_ARCH="x86_32"
60 elif use amd64; then
61 export XEN_TARGET_ARCH="x86_64"
62 else
63 die "Unsupported architecture!"
64 fi
65 fi
66
67 if use flask ; then
68 export "XSM_ENABLE=y"
69 export "FLASK_ENABLE=y"
70 elif use xsm ; then
71 export "XSM_ENABLE=y"
72 fi
73 }
74
75 src_prepare() {
76 # Drop .config and fix gcc-4.6
77 epatch "${FILESDIR}"/${PN/-pvgrub/}-4-fix_dotconfig-gcc.patch
78
79 if use efi; then
80 epatch "${FILESDIR}"/${PN}-4.2-efi.patch
81 export EFI_VENDOR="gentoo"
82 export EFI_MOUNTPOINT="boot"
83 fi
84
85 # if the user *really* wants to use their own custom-cflags, let them
86 if use custom-cflags; then
87 einfo "User wants their own CFLAGS - removing defaults"
88 # try and remove all the default custom-cflags
89 find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
90 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
91 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
92 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
93 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
94 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
95 -i {} \; || die "failed to re-set custom-cflags"
96 fi
97
98 # not strictly necessary to fix this
99 sed -i 's/, "-Werror"//' "${S}/tools/python/setup.py" || die "failed to re-set setup.py"
100
101 [[ ${XSA_PATCHES[@]} ]] && epatch "${XSA_PATCHES[@]}"
102 epatch_user
103 }
104
105 src_configure() {
106 use debug && myopt="${myopt} debug=y"
107 use pae && myopt="${myopt} pae=y"
108
109 if use custom-cflags; then
110 filter-flags -fPIE -fstack-protector
111 replace-flags -O3 -O2
112 else
113 unset CFLAGS
114 fi
115 }
116
117 src_compile() {
118 # Send raw LDFLAGS so that --as-needed works
119 emake CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
120 }
121
122 src_install() {
123 local myopt
124 use debug && myopt="${myopt} debug=y"
125 use pae && myopt="${myopt} pae=y"
126
127 # The 'make install' doesn't 'mkdir -p' the subdirs
128 if use efi; then
129 mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
130 fi
131
132 emake LDFLAGS="$(raw-ldflags)" DESTDIR="${D}" -C xen ${myopt} install
133 }
134
135 pkg_postinst() {
136 elog "Official Xen Guide and the unoffical wiki page:"
137 elog " http://www.gentoo.org/doc/en/xen-guide.xml"
138 elog " http://en.gentoo-wiki.com/wiki/Xen/"
139
140 use pae && ewarn "This is a PAE build of Xen. It will *only* boot PAE kernels!"
141 use efi && einfo "The efi executable is installed in boot/efi/gentoo"
142 }

  ViewVC Help
Powered by ViewVC 1.1.20