/[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.31 - (show annotations) (download)
Sun Apr 3 18:10:01 2011 UTC (3 years, 5 months ago) by vapier
Branch: MAIN
Changes since 1.30: +5 -1 lines
Start an example /etc/defaults/grub #359365 by john.

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

1 # Copyright 1999-2011 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.30 2011/04/03 17:43:44 vapier Exp $
4
5 # XXX: need to implement a grub.conf migration in pkg_postinst before we ~arch
6
7 inherit mount-boot eutils flag-o-matic toolchain-funcs
8
9 if [[ ${PV} == "9999" ]] ; then
10 EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
11 inherit autotools bzr
12 SRC_URI=""
13 else
14 SRC_URI="ftp://alpha.gnu.org/gnu/${PN}/${P}.tar.gz
15 mirror://gentoo/${P}.tar.gz"
16 fi
17
18 DESCRIPTION="GNU GRUB 2 boot loader"
19 HOMEPAGE="http://www.gnu.org/software/grub/"
20
21 LICENSE="GPL-3"
22 use multislot && SLOT="2" || SLOT="0"
23 KEYWORDS=""
24 IUSE="custom-cflags debug truetype multislot static"
25
26 RDEPEND=">=sys-libs/ncurses-5.2-r5
27 dev-libs/lzo
28 truetype? ( media-libs/freetype >=media-fonts/unifont-5 )"
29 DEPEND="${RDEPEND}
30 >=sys-devel/autogen-5.10
31 >=dev-lang/python-2.5.2"
32 [[ ${PV} == "9999" ]] && DEPEND+=" sys-apps/help2man"
33 PROVIDE="virtual/bootloader"
34
35 export STRIP_MASK="*/grub/*/*.mod"
36 QA_EXECSTACK="sbin/grub-probe sbin/grub-setup sbin/grub-mkdevicemap bin/grub-script-check bin/grub-fstest"
37
38 src_unpack() {
39 if [[ ${PV} == "9999" ]] ; then
40 bzr_src_unpack
41 else
42 unpack ${A}
43 fi
44 cd "${S}"
45 epatch_user
46
47 # autogen.sh does more than just run autotools
48 # need to eautomake due to weirdness #296013
49 if [[ ${PV} == "9999" ]] ; then
50 sed -i -e '/^autoreconf/s:^:e:' autogen.sh || die
51 (. ./autogen.sh) || die
52 fi
53 }
54
55 src_compile() {
56 use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS
57 use static && append-ldflags -static
58
59 econf \
60 --disable-werror \
61 --sbindir=/sbin \
62 --bindir=/bin \
63 --libdir=/$(get_libdir) \
64 --disable-efiemu \
65 $(use_enable truetype grub-mkfont) \
66 $(use_enable debug mm-debug) \
67 $(use_enable debug grub-emu) \
68 $(use_enable debug grub-emu-usb) \
69 $(use_enable debug grub-fstest)
70 emake -j1 || die "making regular stuff"
71 }
72
73 src_install() {
74 emake DESTDIR="${D}" install || die
75 dodoc AUTHORS ChangeLog NEWS README THANKS TODO
76
77 insinto /etc/defaults
78 doins "${FILESDIR}"/defaults || die
79 cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib
80 GRUB_DISTRIBUTOR="Gentoo"
81 EOF
82
83 if use multislot ; then
84 sed -i "s:grub-install:grub2-install:" "${D}"/sbin/grub-install || die
85 mv "${D}"/sbin/grub{,2}-install || die
86 mv "${D}"/sbin/grub{,2}-set-default || die
87 mv "${D}"/usr/share/man/man8/grub{,2}-install.8 || die
88 mv "${D}"/usr/share/info/grub{,2}.info || die
89 fi
90 }
91
92 setup_boot_dir() {
93 local boot_dir=$1
94 local dir=${boot_dir}/grub
95
96 if [[ ! -e ${dir}/grub.cfg ]] ; then
97 einfo "Running: grub-mkconfig -o '${dir}/grub.cfg'"
98 grub-mkconfig -o "${dir}/grub.cfg"
99 fi
100
101 #local install=grub-install
102 #use multislot && install="grub2-install --grub-setup=/bin/true"
103 #einfo "Running: ${install} "
104 #${install}
105 }
106
107 pkg_postinst() {
108 mount-boot_mount_boot_partition
109
110 if use multislot ; then
111 elog "You have installed grub2 with USE=multislot, so to coexist"
112 elog "with grub1, the grub2 install binary is named grub2-install."
113 fi
114 setup_boot_dir "${ROOT}"boot
115
116 # needs to be after we call setup_boot_dir
117 mount-boot_pkg_postinst
118 }

  ViewVC Help
Powered by ViewVC 1.1.20