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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20