/[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.32 - (show annotations) (download)
Sun Apr 3 18:18:12 2011 UTC (3 years, 5 months ago) by vapier
Branch: MAIN
Changes since 1.31: +11 -9 lines
Add support for USE="device-mapper sdl", drop dead configure options, and only depend on autogen for live scm ebuilds #357337 by Jon Severinsson.

(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.31 2011/04/03 18:10:01 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 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 device-mapper multislot static sdl truetype"
25
26 RDEPEND=">=sys-libs/ncurses-5.2-r5
27 dev-libs/lzo
28 debug? (
29 sdl? ( media-libs/libsdl )
30 )
31 device-mapper? ( >=sys-fs/lvm2-2.02.45 )
32 truetype? ( media-libs/freetype >=media-fonts/unifont-5 )"
33 DEPEND="${RDEPEND}
34 >=dev-lang/python-2.5.2"
35 [[ ${PV} == "9999" ]] && DEPEND+=" >=sys-devel/autogen-5.10 sys-apps/help2man"
36
37 export STRIP_MASK="*/grub/*/*.mod"
38 QA_EXECSTACK="sbin/grub-probe sbin/grub-setup sbin/grub-mkdevicemap bin/grub-script-check bin/grub-fstest"
39
40 src_unpack() {
41 if [[ ${PV} == "9999" ]] ; then
42 bzr_src_unpack
43 else
44 unpack ${A}
45 fi
46 cd "${S}"
47 epatch_user
48
49 # autogen.sh does more than just run autotools
50 # need to eautomake due to weirdness #296013
51 if [[ ${PV} == "9999" ]] ; then
52 sed -i -e '/^autoreconf/s:^:e:' autogen.sh || die
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 device-mapper) \
68 $(use_enable truetype grub-mkfont) \
69 $(use_enable debug mm-debug) \
70 $(use sdl && use_enable debug grub-emu-sdl) \
71 $(use_enable debug grub-emu-usb)
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
79 insinto /etc/defaults
80 doins "${FILESDIR}"/defaults || die
81 cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib
82 GRUB_DISTRIBUTOR="Gentoo"
83 EOF
84
85 if use multislot ; then
86 sed -i "s:grub-install:grub2-install:" "${D}"/sbin/grub-install || die
87 mv "${D}"/sbin/grub{,2}-install || die
88 mv "${D}"/sbin/grub{,2}-set-default || die
89 mv "${D}"/usr/share/man/man8/grub{,2}-install.8 || die
90 mv "${D}"/usr/share/info/grub{,2}.info || die
91 fi
92 }
93
94 setup_boot_dir() {
95 local boot_dir=$1
96 local dir=${boot_dir}/grub
97
98 if [[ ! -e ${dir}/grub.cfg ]] ; then
99 einfo "Running: grub-mkconfig -o '${dir}/grub.cfg'"
100 grub-mkconfig -o "${dir}/grub.cfg"
101 fi
102
103 #local install=grub-install
104 #use multislot && install="grub2-install --grub-setup=/bin/true"
105 #einfo "Running: ${install} "
106 #${install}
107 }
108
109 pkg_postinst() {
110 mount-boot_mount_boot_partition
111
112 if use multislot ; then
113 elog "You have installed grub2 with USE=multislot, so to coexist"
114 elog "with grub1, the grub2 install binary is named grub2-install."
115 fi
116 setup_boot_dir "${ROOT}"boot
117
118 # needs to be after we call setup_boot_dir
119 mount-boot_pkg_postinst
120 }

  ViewVC Help
Powered by ViewVC 1.1.20