/[gentoo-x86]/sys-boot/grub/grub-9999.ebuild
Gentoo

Contents of /sys-boot/grub/grub-9999.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.17 - (show annotations) (download)
Sun Jan 10 06:09:56 2010 UTC (4 years, 6 months ago) by vapier
Branch: MAIN
Changes since 1.16: +8 -6 lines
unify grub 2 ebuilds, replace aclocal calls to eaclocal, and only run autotools on live bzr ebuilds

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v 1.16 2009/11/22 17:34:52 vapier Exp $
4
5 inherit mount-boot eutils flag-o-matic toolchain-funcs
6
7 if [[ ${PV} == "9999" ]] ; then
8 EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub"
9 inherit autotools bzr
10 SRC_URI=""
11 else
12 SRC_URI="ftp://alpha.gnu.org/gnu/${PN}/${P}.tar.gz
13 mirror://gentoo/${P}.tar.gz"
14 fi
15
16 DESCRIPTION="GNU GRUB 2 boot loader"
17 HOMEPAGE="http://www.gnu.org/software/grub/"
18
19 LICENSE="GPL-3"
20 use multislot && SLOT="2" || SLOT="0"
21 KEYWORDS=""
22 IUSE="custom-cflags debug multislot static"
23
24 RDEPEND=">=sys-libs/ncurses-5.2-r5
25 dev-libs/lzo"
26 DEPEND="${RDEPEND}
27 dev-lang/ruby"
28 PROVIDE="virtual/bootloader"
29
30 export STRIP_MASK="*/grub/*/*.mod"
31 QA_EXECSTACK="sbin/grub-probe sbin/grub-setup sbin/grub-mkdevicemap"
32
33 src_unpack() {
34 if [[ ${PV} == "9999" ]] ; then
35 bzr_src_unpack
36 else
37 unpack ${A}
38 fi
39 cd "${S}"
40 epatch "${FILESDIR}"/${PN}-1.96-genkernel.patch #256335
41 epatch_user
42
43 # autogen.sh does more than just run autotools
44 if [[ ${PV} == "9999" ]] ; then
45 sed -i -e '/^\(auto\|ac\)/s:^:e:' autogen.sh
46 (. ./autogen.sh) || die
47 fi
48 }
49
50 src_compile() {
51 use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS
52 use static && append-ldflags -static
53
54 econf \
55 --disable-werror \
56 --sbindir=/sbin \
57 --bindir=/bin \
58 --libdir=/$(get_libdir) \
59 --disable-efiemu \
60 --enable-grub-mkfont \
61 $(use_enable debug mm-debug) \
62 $(use_enable debug grub-emu) \
63 $(use_enable debug grub-emu-usb) \
64 $(use_enable debug grub-fstest)
65 emake -j1 || die "making regular stuff"
66 }
67
68 src_install() {
69 emake DESTDIR="${D}" install || die
70 dodoc AUTHORS ChangeLog NEWS README THANKS TODO
71 cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib
72 GRUB_DISTRIBUTOR="Gentoo"
73 EOF
74 if use multislot ; then
75 sed -i "s:grub-install:grub2-install:" "${D}"/sbin/grub-install || die
76 mv "${D}"/sbin/grub{,2}-install || die
77 mv "${D}"/usr/share/info/grub{,2}.info || die
78 fi
79 }
80
81 setup_boot_dir() {
82 local boot_dir=$1
83 local dir=${boot_dir}/grub
84
85 if [[ ! -e ${dir}/grub.cfg ]] ; then
86 einfo "Running: grub-mkconfig -o '${dir}/grub.cfg'"
87 grub-mkconfig -o "${dir}/grub.cfg"
88 fi
89
90 #local install=grub-install
91 #use multislot && install="grub2-install --grub-setup=/bin/true"
92 #einfo "Running: ${install} "
93 #${install}
94 }
95
96 pkg_postinst() {
97 if use multislot ; then
98 elog "You have installed grub2 with USE=multislot, so to coexist"
99 elog "with grub1, the grub2 install binary is named grub2-install."
100 fi
101 setup_boot_dir "${ROOT}"boot
102 }

  ViewVC Help
Powered by ViewVC 1.1.20