/[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.6 - (hide annotations) (download)
Sat Mar 14 13:28:30 2009 UTC (6 years, 4 months ago) by vapier
Branch: MAIN
Changes since 1.5: +16 -2 lines
Locate kernels made by genkernel #256335 and mark Gentoo as the distro.
(Portage version: 2.2_rc25/cvs/Linux x86_64)

1 vapier 1.6 # Copyright 1999-2009 Gentoo Foundation
2 vapier 1.1 # Distributed under the terms of the GNU General Public License v2
3 vapier 1.6 # $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v 1.5 2009/01/01 11:24:35 vapier Exp $
4 vapier 1.1
5     inherit 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 vapier 1.2 SRC_URI=""
11     else
12     SRC_URI="ftp://alpha.gnu.org/gnu/${PN}/${P}.tar.gz
13     mirror://gentoo/${P}.tar.gz"
14 vapier 1.1 fi
15    
16     DESCRIPTION="GNU GRUB 2 boot loader"
17     HOMEPAGE="http://www.gnu.org/software/grub/"
18    
19 vapier 1.4 LICENSE="GPL-3"
20 vapier 1.3 use multislot && SLOT="2" || SLOT="0"
21 vapier 1.1 KEYWORDS=""
22 vapier 1.3 IUSE="custom-cflags multislot static"
23 vapier 1.1
24     DEPEND=">=sys-libs/ncurses-5.2-r5
25     dev-libs/lzo"
26     PROVIDE="virtual/bootloader"
27    
28 vapier 1.5 export STRIP_MASK="*/grub/*/*.mod"
29 vapier 1.3 QA_EXECSTACK="sbin/grub-probe sbin/grub-setup"
30 vapier 1.1
31 vapier 1.6 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    
41 vapier 1.1 src_compile() {
42     use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS
43     use static && append-ldflags -static
44    
45     econf \
46 vapier 1.3 --sbindir=/sbin \
47     --bindir=/bin \
48     --libdir=/$(get_libdir) \
49 vapier 1.1 || die "econf failed"
50     emake -j1 || die "making regular stuff"
51     }
52    
53     src_install() {
54     emake DESTDIR="${D}" install || die
55     dodoc AUTHORS ChangeLog NEWS README THANKS TODO
56 vapier 1.6 cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib
57     GRUB_DISTRIBUTOR="Gentoo"
58     EOF
59     EOF
60 vapier 1.3 if use multislot ; then
61     sed -i s:grub-install:grub2-install: "${D}"/sbin/grub-install
62     mv "${D}"/sbin/grub{,2}-install || die
63     mv "${D}"/usr/share/man/man8/grub{,2}-install.8 || die
64     fi
65     }
66    
67     setup_boot_dir() {
68     local boot_dir=$1
69     local dir=${boot_dir}/grub
70    
71     if [[ ! -e ${dir}/grub.cfg ]] ; then
72     einfo "Running: grub-mkconfig -o '${dir}/grub.cfg'"
73     grub-mkconfig -o "${dir}/grub.cfg"
74     fi
75    
76     #local install=grub-install
77     #use multislot && install="grub2-install --grub-setup=/bin/true"
78     #einfo "Running: ${install} "
79     #${install}
80 vapier 1.1 }
81    
82     pkg_postinst() {
83 vapier 1.3 if use multislot ; then
84     elog "You have installed grub2 with USE=multislot, so to coexist"
85     elog "with grub1, the grub2 install binary is named grub2-install."
86     fi
87     setup_boot_dir "${ROOT}"boot
88 vapier 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20