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

Contents of /app-emulation/xen-pvgrub/xen-pvgrub-4.1.1-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Tue Apr 24 09:49:47 2012 UTC (2 years, 5 months ago) by mgorny
Branch: MAIN
Changes since 1.4: +3 -3 lines
Update to use mirror://.

(Portage version: 2.2.0_alpha101/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-pvgrub/xen-pvgrub-4.1.1-r1.ebuild,v 1.4 2011/11/01 10:19:29 chainsaw Exp $
4
5 EAPI="2"
6
7 inherit flag-o-matic eutils multilib toolchain-funcs
8
9 XEN_EXTFILES_URL="http://xenbits.xensource.com/xen-extfiles"
10 OCAML_URL=http://caml.inria.fr/pub/distrib
11 LIBPCI_URL=ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci
12 GRUB_URL=mirror://gnu-alpha/grub
13 SRC_URI="
14 http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
15 $GRUB_URL/grub-0.97.tar.gz
16 $XEN_EXTFILES_URL/zlib-1.2.3.tar.gz
17 $LIBPCI_URL/pciutils-2.2.9.tar.bz2
18 $XEN_EXTFILES_URL/lwip-1.3.0.tar.gz
19 $XEN_EXTFILES_URL/newlib/newlib-1.16.0.tar.gz
20 $OCAML_URL/ocaml-3.11
21 "
22
23 S="${WORKDIR}/xen-${PV}"
24
25 DESCRIPTION="allows to boot Xen domU kernels from a menu.lst laying inside guest filesystem"
26 HOMEPAGE="http://xen.org/"
27 LICENSE="GPL-2"
28 SLOT="0"
29 KEYWORDS="amd64 x86"
30 IUSE="custom-cflags"
31
32 DEPEND="sys-devel/gettext
33 sys-devel/gcc"
34
35 RDEPEND=">=app-emulation/xen-${PV}"
36
37 src_prepare() {
38 # Drop .config
39 sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
40 # if the user *really* wants to use their own custom-cflags, let them
41 if use custom-cflags; then
42 einfo "User wants their own CFLAGS - removing defaults"
43 # try and remove all the default custom-cflags
44 find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
45 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
46 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
47 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
48 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
49 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
50 -i {} \;
51 fi
52
53 sed -i \
54 -e 's/WGET=.*/WGET=cp -t . /' \
55 -e "s;\$(XEN_EXTFILES_URL);${DISTDIR};" \
56 -e 's/$(LD)/$(LD) LDFLAGS=/' \
57 -e 's;install-grub: pv-grub;install-grub:;' \
58 "${S}"/stubdom/Makefile || die
59 # Fix gcc-4.6
60 sed -i \
61 -e "s:-Werror::g" \
62 -i tools/libxc/Makefile \
63 -i extras/mini-os/minios.mk || die
64
65 #Prevent internal downloading
66 cp $DISTDIR/zlib-1.2.3.tar.gz \
67 $DISTDIR/pciutils-2.2.9.tar.bz2 \
68 $DISTDIR/lwip-1.3.0.tar.gz \
69 $DISTDIR/ocaml-3.11 \
70 $DISTDIR/newlib-1.16.0.tar.gz \
71 $DISTDIR/grub-0.97.tar.gz \
72 ./stubdom/ || die "files not coped to stubdom"
73
74 einfo "files copied to stubdom"
75 ls -ld stubdom/zlib-1.2.3.tar.gz
76 ls -ld stubdom/Makefile || die "stubdom/Makefile could not be adjusted"
77
78 sed -e 's:^\t$(WGET) $(LWIP_URL):#\t$(WGET) $(LWIP_URL):' \
79 -e 's:^\t$(WGET) $(NEWLIB_URL):#\t$(WGET) $(NEWLIB_URL):' \
80 -e 's:^\t$(WGET) $(ZLIB_URL):#\t$(WGET) $(ZLIB_URL):' \
81 -e 's:^\t$(WGET) $(LIBPCI_URL):#\t$(WGET) $(LIBPCI_URL):' \
82 -e 's:^\t$(WGET) $(OCAML_URL):#\t$(WGET) $(OCAML_URL):' \
83 -e 's:^\t$(WGET) $(GRUB_URL):#$(WGET) $(GRUB_URL):' \
84 -i stubdom/Makefile || die "stubdom/Makefile could not be adjusted"
85 einfo "1st Makefile adjusted"
86 }
87
88 src_compile() {
89 use custom-cflags || unset CFLAGS
90 if test-flag-CC -fno-strict-overflow; then
91 append-flags -fno-strict-overflow
92 fi
93
94 emake CC=$(tc-getCC) LD=$(tc-getLD) -C tools/include || die "prepare libelf headers failed"
95
96 if use x86; then
97 emake -j1 CC=$(tc-getCC) LD=$(tc-getLD) \
98 XEN_TARGET_ARCH="x86_32" -C stubdom pv-grub || \
99 die "compile pv-grub_x86_32 failed"
100 fi
101 if use amd64; then
102 emake -j1 CC=$(tc-getCC) LD=$(tc-getLD) \
103 XEN_TARGET_ARCH="x86_64" -C stubdom pv-grub || \
104 die "compile pv-grub_x86_64 failed"
105 if use multilib; then
106 multilib_toolchain_setup x86
107 emake -j1 XEN_TARGET_ARCH="x86_32" -C stubdom pv-grub || die "compile pv-grub_x86_32 failed"
108 fi
109 fi
110 }
111
112 src_install() {
113 if use x86; then
114 emake -j1 XEN_TARGET_ARCH="x86_32" DESTDIR="${D}" -C stubdom install-grub || die "install pv-grub_x86_32 failed"
115 fi
116 if use amd64; then
117 emake -j1 XEN_TARGET_ARCH="x86_64" DESTDIR="${D}" -C stubdom install-grub || die "install pv-grub_x86_64 failed"
118 if use multilib; then
119 emake -j1 XEN_TARGET_ARCH="x86_32" DESTDIR="${D}" -C stubdom install-grub || die "install pv-grub_x86_32 failed"
120 fi
121 fi
122 }
123
124 pkg_postinst() {
125 elog "Official Xen Guide and the unoffical wiki page:"
126 elog " http://www.gentoo.org/doc/en/xen-guide.xml"
127 elog " http://en.gentoo-wiki.com/wiki/Xen/"
128 }

  ViewVC Help
Powered by ViewVC 1.1.20