/[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.7 - (show annotations) (download)
Mon Apr 27 05:23:28 2009 UTC (5 years, 2 months ago) by vapier
Branch: MAIN
Changes since 1.6: +6 -3 lines
Generate autotool files now that upstream removed things from svn #267233 by James Erickson.
(Portage version: 2.2_rc31/cvs/Linux x86_64)

1 # Copyright 1999-2009 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.6 2009/03/14 13:28:30 vapier Exp $
4
5 inherit autotools mount-boot eutils flag-o-matic toolchain-funcs
6
7 if [[ ${PV} == "9999" ]] ; then
8 ESVN_REPO_URI="svn://svn.sv.gnu.org/grub/trunk/grub2"
9 inherit subversion
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 multislot static"
23
24 DEPEND=">=sys-libs/ncurses-5.2-r5
25 dev-libs/lzo"
26 PROVIDE="virtual/bootloader"
27
28 export STRIP_MASK="*/grub/*/*.mod"
29 QA_EXECSTACK="sbin/grub-probe sbin/grub-setup"
30
31 src_unpack() {
32 if [[ ${PV} == "9999" ]] ; then
33 subversion_src_unpack
34 else
35 unpack ${A}
36 fi
37 cd "${S}"
38 epatch "${FILESDIR}"/${PN}-1.96-genkernel.patch #256335
39
40 # autogen.sh does more than just run autotools
41 sed -i -e 's:^auto:eauto:' autogen.sh
42 (. ./autogen.sh) || die
43 }
44
45 src_compile() {
46 use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS
47 use static && append-ldflags -static
48
49 econf \
50 --sbindir=/sbin \
51 --bindir=/bin \
52 --libdir=/$(get_libdir) \
53 || die "econf failed"
54 emake -j1 || die "making regular stuff"
55 }
56
57 src_install() {
58 emake DESTDIR="${D}" install || die
59 dodoc AUTHORS ChangeLog NEWS README THANKS TODO
60 cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib
61 GRUB_DISTRIBUTOR="Gentoo"
62 EOF
63 if use multislot ; then
64 sed -i s:grub-install:grub2-install: "${D}"/sbin/grub-install
65 mv "${D}"/sbin/grub{,2}-install || die
66 mv "${D}"/usr/share/man/man8/grub{,2}-install.8 || die
67 fi
68 }
69
70 setup_boot_dir() {
71 local boot_dir=$1
72 local dir=${boot_dir}/grub
73
74 if [[ ! -e ${dir}/grub.cfg ]] ; then
75 einfo "Running: grub-mkconfig -o '${dir}/grub.cfg'"
76 grub-mkconfig -o "${dir}/grub.cfg"
77 fi
78
79 #local install=grub-install
80 #use multislot && install="grub2-install --grub-setup=/bin/true"
81 #einfo "Running: ${install} "
82 #${install}
83 }
84
85 pkg_postinst() {
86 if use multislot ; then
87 elog "You have installed grub2 with USE=multislot, so to coexist"
88 elog "with grub1, the grub2 install binary is named grub2-install."
89 fi
90 setup_boot_dir "${ROOT}"boot
91 }

  ViewVC Help
Powered by ViewVC 1.1.20