/[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.36 - (show annotations) (download)
Sun Aug 21 04:33:07 2011 UTC (2 years, 10 months ago) by vapier
Branch: MAIN
Changes since 1.35: +2 -2 lines
Depend on virtual/yacc, not bison.

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

  ViewVC Help
Powered by ViewVC 1.1.20