linamh/sys-boot/refit/refit-0.14.2.ebuild
geos_one 55b21af815 sys-boot/refit: add gptsync.efi
(Portage version: 2.2.0_alpha4/svn/Linux x86_64)

git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/linamh@2727 6952d904-891a-0410-993b-d76249ca496b
2010-11-12 16:56:36 +00:00

82 lines
2.1 KiB
Bash

# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=2
inherit eutils versionator
MY_P="${PN}_${PV}"
DESCRIPTION="graphical boot menu for ia32 and x64 EFI systems"
HOMEPAGE="http://refit.sourceforge.net/"
# tarballs use debian versioning format
MY_PN="refit"
MY_PVR=$(replace_version_separator 2 '-' )
MY_PV=${MY_PVR/-*/}
S="${WORKDIR}/${MY_PN}-${MY_PV}"
SRC_URI_BASE="mirror://debian/pool/main/${MY_PN:0:1}/${MY_PN}/"
SRC_URI="${SRC_URI_BASE}${MY_PN}_${MY_PV}.orig.tar.gz
${SRC_URI_BASE}${MY_PN}_${MY_PVR}.debian.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND=">=sys-boot/gnu-efi-0.3a
sys-boot/syslinux"
RDEPEND=""
src_prepare() {
for f in $(<"${WORKDIR}"/debian/patches/series) ; do
EPATCH_OPTS="-p1" epatch "${WORKDIR}"/debian/patches/$f
done
sed -e "s!\$(LIBEG)!!" -i refit/Makefile
}
src_compile() {
local iarch
case $ARCH in
x86) iarch=ia32 ;;
amd64) iarch=x86_64 ;;
*) die "unknown architecture: $ARCH" ;;
esac
# Generate include/syslinux_mbr.h
chmod +x "${WORKDIR}"/debian/mbr/mkmbrhdr.py
"${WORKDIR}"/debian/mbr/mkmbrhdr.py /usr/share/syslinux/mbr.bin > include/syslinux_mbr.h
# Move the AA font in place
cp -f "${WORKDIR}"/debian/font/egemb_font.h libeg/
# Build EFI applications
emake -C libeg SRCDIR="${S}"/libeg ARCH=${iarch} || die
emake -C refit SRCDIR="${S}"/refit ARCH=${iarch} DEBVER="${iarch} (Gentoo ${PVR})" || die
emake -C gptsync -f Makefile.gnuefi SRCDIR="${S}"/gptsync ARCH=${iarch} || die
# Build the gptsync command-line utility
mkdir gptsync/buildux
emake -C gptsync/buildux -f ../Makefile.unix SRCDIR="${S}"/gptsync CC="$(tc-getCC)" \
CFLAGS="-Wall ${CFLAGS}" LDFLAGS="${LDFLAGS}" || die
}
src_install() {
dosbin gptsync/buildux/gptsync
dosbin gptsync/buildux/showpart
insinto /usr/share/${PN}
doins refit/refit.efi
insinto /usr/share/${PN}/tools
doins gptsync/gptsync.efi
insinto /usr/share/${PN}/${PN}
doins -r icons
doins images/vollabel/refit.vollabel
doins refit.conf
doman gptsync/gptsync.8
doman "${WORKDIR}"/debian/showpart.8
}