/[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.22 - (show annotations) (download)
Tue Jul 6 00:41:18 2010 UTC (4 years, 1 month ago) by vapier
Branch: MAIN
Changes since 1.21: +3 -1 lines
Rename grub-install manpage and grub2-set-default script for USE=multislot #288877 by pyon.
(Portage version: 2.2_rc67/cvs/Linux x86_64)

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.21 2010/07/06 00:33:33 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 )"
29 DEPEND="${RDEPEND}
30 dev-lang/ruby"
31 PROVIDE="virtual/bootloader"
32
33 export STRIP_MASK="*/grub/*/*.mod"
34 QA_EXECSTACK="sbin/grub-probe sbin/grub-setup sbin/grub-mkdevicemap bin/grub-script-check"
35
36 src_unpack() {
37 if [[ ${PV} == "9999" ]] ; then
38 bzr_src_unpack
39 else
40 unpack ${A}
41 fi
42 cd "${S}"
43 epatch "${FILESDIR}"/${PN}-1.99-genkernel.patch #256335
44 epatch_user
45
46 # autogen.sh does more than just run autotools
47 # need to eautomake due to weirdness #296013
48 if [[ ${PV} == "9999" ]] ; then
49 sed -i \
50 -e '/^\(auto\|ac\)/s:^:e:' \
51 -e "s:^eautomake:`which automake`:" \
52 autogen.sh
53 (. ./autogen.sh) || die
54 fi
55 }
56
57 src_compile() {
58 use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS
59 use static && append-ldflags -static
60
61 econf \
62 --disable-werror \
63 --sbindir=/sbin \
64 --bindir=/bin \
65 --libdir=/$(get_libdir) \
66 --disable-efiemu \
67 $(use_enable truetype grub-mkfont) \
68 $(use_enable debug mm-debug) \
69 $(use_enable debug grub-emu) \
70 $(use_enable debug grub-emu-usb) \
71 $(use_enable debug grub-fstest)
72 emake -j1 || die "making regular stuff"
73 }
74
75 src_install() {
76 emake DESTDIR="${D}" install || die
77 dodoc AUTHORS ChangeLog NEWS README THANKS TODO
78 cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib
79 GRUB_DISTRIBUTOR="Gentoo"
80 EOF
81 if use multislot ; then
82 sed -i "s:grub-install:grub2-install:" "${D}"/sbin/grub-install || die
83 mv "${D}"/sbin/grub{,2}-install || die
84 mv "${D}"/sbin/grub{,2}-set-default || die
85 mv "${D}"/usr/share/man/man8/grub{,2}-install.8 || die
86 mv "${D}"/usr/share/info/grub{,2}.info || die
87 fi
88 }
89
90 setup_boot_dir() {
91 local boot_dir=$1
92 local dir=${boot_dir}/grub
93
94 if [[ ! -e ${dir}/grub.cfg ]] ; then
95 einfo "Running: grub-mkconfig -o '${dir}/grub.cfg'"
96 grub-mkconfig -o "${dir}/grub.cfg"
97 fi
98
99 #local install=grub-install
100 #use multislot && install="grub2-install --grub-setup=/bin/true"
101 #einfo "Running: ${install} "
102 #${install}
103 }
104
105 pkg_postinst() {
106 if use multislot ; then
107 elog "You have installed grub2 with USE=multislot, so to coexist"
108 elog "with grub1, the grub2 install binary is named grub2-install."
109 fi
110 setup_boot_dir "${ROOT}"boot
111 }

  ViewVC Help
Powered by ViewVC 1.1.20