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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Thu Feb 20 15:08:59 2014 UTC (4 years, 9 months ago) by dlan
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
clean old ebuilds

(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-r4.ebuild,v 1.2 2014/02/12 14:08:09 keytoaster 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 "${FILESDIR}"/${PN}-4-XSA-83.patch # bug #499054
52 "${FILESDIR}"/${PN}-4.2-XSA-84.patch # bug #500536
53 "${FILESDIR}"/${PN}-4.2-XSA-85.patch # bug #500528
54 "${FILESDIR}"/${PN}-4.2-XSA-87.patch # bug #499124
55 )
56
57 pkg_setup() {
58 python-any-r1_pkg_setup
59 if [[ -z ${XEN_TARGET_ARCH} ]]; then
60 if use x86 && use amd64; then
61 die "Confusion! Both x86 and amd64 are set in your use flags!"
62 elif use x86; then
63 export XEN_TARGET_ARCH="x86_32"
64 elif use amd64; then
65 export XEN_TARGET_ARCH="x86_64"
66 else
67 die "Unsupported architecture!"
68 fi
69 fi
70
71 if use flask ; then
72 export "XSM_ENABLE=y"
73 export "FLASK_ENABLE=y"
74 elif use xsm ; then
75 export "XSM_ENABLE=y"
76 fi
77 }
78
79 src_prepare() {
80 # Drop .config and fix gcc-4.6
81 epatch "${FILESDIR}"/${PN/-pvgrub/}-4-fix_dotconfig-gcc.patch
82
83 if use efi; then
84 epatch "${FILESDIR}"/${PN}-4.2-efi.patch
85 export EFI_VENDOR="gentoo"
86 export EFI_MOUNTPOINT="boot"
87 fi
88
89 # if the user *really* wants to use their own custom-cflags, let them
90 if use custom-cflags; then
91 einfo "User wants their own CFLAGS - removing defaults"
92 # try and remove all the default custom-cflags
93 find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
94 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
95 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
96 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
97 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
98 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
99 -i {} \; || die "failed to re-set custom-cflags"
100 fi
101
102 # not strictly necessary to fix this
103 sed -i 's/, "-Werror"//' "${S}/tools/python/setup.py" || die "failed to re-set setup.py"
104
105 [[ ${XSA_PATCHES[@]} ]] && epatch "${XSA_PATCHES[@]}"
106 epatch_user
107 }
108
109 src_configure() {
110 use debug && myopt="${myopt} debug=y"
111 use pae && myopt="${myopt} pae=y"
112
113 if use custom-cflags; then
114 filter-flags -fPIE -fstack-protector
115 replace-flags -O3 -O2
116 else
117 unset CFLAGS
118 fi
119 }
120
121 src_compile() {
122 # Send raw LDFLAGS so that --as-needed works
123 emake CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
124 }
125
126 src_install() {
127 local myopt
128 use debug && myopt="${myopt} debug=y"
129 use pae && myopt="${myopt} pae=y"
130
131 # The 'make install' doesn't 'mkdir -p' the subdirs
132 if use efi; then
133 mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
134 fi
135
136 emake LDFLAGS="$(raw-ldflags)" DESTDIR="${D}" -C xen ${myopt} install
137 }
138
139 pkg_postinst() {
140 elog "Official Xen Guide and the unoffical wiki page:"
141 elog " http://www.gentoo.org/doc/en/xen-guide.xml"
142 elog " http://en.gentoo-wiki.com/wiki/Xen/"
143
144 use pae && ewarn "This is a PAE build of Xen. It will *only* boot PAE kernels!"
145 use efi && einfo "The efi executable is installed in boot/efi/gentoo"
146 }

  ViewVC Help
Powered by ViewVC 1.1.20