/[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.33 - (show annotations) (download)
Sun May 29 17:25:05 2011 UTC (3 years, 3 months ago) by vapier
Branch: MAIN
Changes since 1.32: +9 -11 lines
Convert to EAPI=2 and do not run `set -e` with eautoreconf #369093 by Zachary Bedell.

(Portage version: 2.2.0_alpha33/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.32 2011/04/03 18:18:12 vapier 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 [[ ${PV} == "9999" ]] && DEPEND+=" >=sys-devel/autogen-5.10 sys-apps/help2man"
37
38 export STRIP_MASK="*/grub/*/*.mod"
39 QA_EXECSTACK="sbin/grub-probe sbin/grub-setup sbin/grub-mkdevicemap bin/grub-script-check bin/grub-fstest"
40
41 src_prepare() {
42 epatch_user
43
44 # autogen.sh does more than just run autotools
45 # need to eautomake due to weirdness #296013
46 if [[ ${PV} == "9999" ]] ; then
47 sed -i -e '/^autoreconf/s:^:set +e; e:' autogen.sh || die
48 (. ./autogen.sh) || die
49 fi
50 }
51
52 src_configure() {
53 use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS
54 use static && append-ldflags -static
55
56 econf \
57 --disable-werror \
58 --sbindir=/sbin \
59 --bindir=/bin \
60 --libdir=/$(get_libdir) \
61 --disable-efiemu \
62 $(use_enable device-mapper) \
63 $(use_enable truetype grub-mkfont) \
64 $(use_enable debug mm-debug) \
65 $(use sdl && use_enable debug grub-emu-sdl) \
66 $(use_enable debug grub-emu-usb)
67 }
68
69 src_compile() {
70 emake -j1 || die
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