| 1 |
vapier |
1.27 |
# Copyright 1999-2011 Gentoo Foundation
|
| 2 |
vapier |
1.1 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
vapier |
1.33 |
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v 1.32 2011/04/03 18:18:12 vapier Exp $
|
| 4 |
vapier |
1.21 |
|
| 5 |
|
|
# XXX: need to implement a grub.conf migration in pkg_postinst before we ~arch
|
| 6 |
vapier |
1.33 |
EAPI="2"
|
| 7 |
vapier |
1.1 |
|
| 8 |
vapier |
1.17 |
inherit mount-boot eutils flag-o-matic toolchain-funcs
|
| 9 |
vapier |
1.1 |
|
| 10 |
|
|
if [[ ${PV} == "9999" ]] ; then
|
| 11 |
vapier |
1.29 |
EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
|
| 12 |
vapier |
1.17 |
inherit autotools bzr
|
| 13 |
vapier |
1.2 |
SRC_URI=""
|
| 14 |
|
|
else
|
| 15 |
|
|
SRC_URI="ftp://alpha.gnu.org/gnu/${PN}/${P}.tar.gz
|
| 16 |
|
|
mirror://gentoo/${P}.tar.gz"
|
| 17 |
vapier |
1.1 |
fi
|
| 18 |
|
|
|
| 19 |
vapier |
1.32 |
DESCRIPTION="GNU GRUB boot loader"
|
| 20 |
vapier |
1.1 |
HOMEPAGE="http://www.gnu.org/software/grub/"
|
| 21 |
|
|
|
| 22 |
vapier |
1.4 |
LICENSE="GPL-3"
|
| 23 |
vapier |
1.3 |
use multislot && SLOT="2" || SLOT="0"
|
| 24 |
vapier |
1.1 |
KEYWORDS=""
|
| 25 |
vapier |
1.32 |
IUSE="custom-cflags debug device-mapper multislot static sdl truetype"
|
| 26 |
vapier |
1.1 |
|
| 27 |
vapier |
1.9 |
RDEPEND=">=sys-libs/ncurses-5.2-r5
|
| 28 |
vapier |
1.18 |
dev-libs/lzo
|
| 29 |
vapier |
1.32 |
debug? (
|
| 30 |
|
|
sdl? ( media-libs/libsdl )
|
| 31 |
|
|
)
|
| 32 |
|
|
device-mapper? ( >=sys-fs/lvm2-2.02.45 )
|
| 33 |
vapier |
1.24 |
truetype? ( media-libs/freetype >=media-fonts/unifont-5 )"
|
| 34 |
vapier |
1.9 |
DEPEND="${RDEPEND}
|
| 35 |
vapier |
1.25 |
>=dev-lang/python-2.5.2"
|
| 36 |
vapier |
1.32 |
[[ ${PV} == "9999" ]] && DEPEND+=" >=sys-devel/autogen-5.10 sys-apps/help2man"
|
| 37 |
vapier |
1.1 |
|
| 38 |
vapier |
1.5 |
export STRIP_MASK="*/grub/*/*.mod"
|
| 39 |
vapier |
1.23 |
QA_EXECSTACK="sbin/grub-probe sbin/grub-setup sbin/grub-mkdevicemap bin/grub-script-check bin/grub-fstest"
|
| 40 |
vapier |
1.1 |
|
| 41 |
vapier |
1.33 |
src_prepare() {
|
| 42 |
vapier |
1.15 |
epatch_user
|
| 43 |
vapier |
1.7 |
|
| 44 |
|
|
# autogen.sh does more than just run autotools
|
| 45 |
vapier |
1.19 |
# need to eautomake due to weirdness #296013
|
| 46 |
vapier |
1.17 |
if [[ ${PV} == "9999" ]] ; then
|
| 47 |
vapier |
1.33 |
sed -i -e '/^autoreconf/s:^:set +e; e:' autogen.sh || die
|
| 48 |
vapier |
1.17 |
(. ./autogen.sh) || die
|
| 49 |
|
|
fi
|
| 50 |
vapier |
1.6 |
}
|
| 51 |
|
|
|
| 52 |
vapier |
1.33 |
src_configure() {
|
| 53 |
vapier |
1.1 |
use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS
|
| 54 |
|
|
use static && append-ldflags -static
|
| 55 |
|
|
|
| 56 |
|
|
econf \
|
| 57 |
vapier |
1.12 |
--disable-werror \
|
| 58 |
vapier |
1.3 |
--sbindir=/sbin \
|
| 59 |
|
|
--bindir=/bin \
|
| 60 |
|
|
--libdir=/$(get_libdir) \
|
| 61 |
vapier |
1.11 |
--disable-efiemu \
|
| 62 |
vapier |
1.32 |
$(use_enable device-mapper) \
|
| 63 |
vapier |
1.18 |
$(use_enable truetype grub-mkfont) \
|
| 64 |
vapier |
1.10 |
$(use_enable debug mm-debug) \
|
| 65 |
vapier |
1.32 |
$(use sdl && use_enable debug grub-emu-sdl) \
|
| 66 |
|
|
$(use_enable debug grub-emu-usb)
|
| 67 |
vapier |
1.33 |
}
|
| 68 |
|
|
|
| 69 |
|
|
src_compile() {
|
| 70 |
|
|
emake -j1 || die
|
| 71 |
vapier |
1.1 |
}
|
| 72 |
|
|
|
| 73 |
|
|
src_install() {
|
| 74 |
|
|
emake DESTDIR="${D}" install || die
|
| 75 |
|
|
dodoc AUTHORS ChangeLog NEWS README THANKS TODO
|
| 76 |
vapier |
1.31 |
|
| 77 |
|
|
insinto /etc/defaults
|
| 78 |
|
|
doins "${FILESDIR}"/defaults || die
|
| 79 |
vapier |
1.6 |
cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib
|
| 80 |
|
|
GRUB_DISTRIBUTOR="Gentoo"
|
| 81 |
|
|
EOF
|
| 82 |
vapier |
1.31 |
|
| 83 |
vapier |
1.3 |
if use multislot ; then
|
| 84 |
vapier |
1.14 |
sed -i "s:grub-install:grub2-install:" "${D}"/sbin/grub-install || die
|
| 85 |
vapier |
1.3 |
mv "${D}"/sbin/grub{,2}-install || die
|
| 86 |
vapier |
1.22 |
mv "${D}"/sbin/grub{,2}-set-default || die
|
| 87 |
|
|
mv "${D}"/usr/share/man/man8/grub{,2}-install.8 || die
|
| 88 |
vapier |
1.13 |
mv "${D}"/usr/share/info/grub{,2}.info || die
|
| 89 |
vapier |
1.3 |
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 |
vapier |
1.1 |
}
|
| 106 |
|
|
|
| 107 |
|
|
pkg_postinst() {
|
| 108 |
vapier |
1.28 |
mount-boot_mount_boot_partition
|
| 109 |
vapier |
1.27 |
|
| 110 |
vapier |
1.3 |
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 |
vapier |
1.28 |
|
| 116 |
|
|
# needs to be after we call setup_boot_dir
|
| 117 |
|
|
mount-boot_pkg_postinst
|
| 118 |
vapier |
1.1 |
}
|