--- /dev/null
+diff --git a/refind-install b/refind-install
+index 0f4accd..07f2b35 100755
+--- a/refind-install
++++ b/refind-install
+@@ -1168,7 +1168,13 @@ InstallOnLinux() {
+ # install under OS X or Linux, depending on the detected platform.
+ #
+ GetParams "$@"
+-ThisDir="$( cd -P "${BASH_SOURCE%/*}" && pwd )"
++ThisScript="${BASH_SOURCE[0]}"
++while [ -h "$ThisScript" ]; do
++ ThisDir="$( cd -P "$( dirname "$ThisScript" )" && pwd )"
++ ThisScript="$(readlink "$ThisScript")"
++ [[ $ThisScript != /* ]] && ThisScript="$ThisDir/$ThisScript"
++done
++ThisDir="$( cd -P "$( dirname "$ThisScript" )" && pwd )"
+ RefindDir="$ThisDir/refind"
+ if [[ $UID != 0 ]] ; then
+ echo "Not running as root; attempting to elevate privileges via sudo...."
<name>Sam Jorna</name>
<description>Proxy - Maintainer. Assign bugs to him</description>
</maintainer>
- <longdescription>EFI Boot Manager</longdescription>
- <use>
+ <maintainer>
+ <email>sveyret@gmail.com</email>
+ <name>Stephane Veyret</name>
+ <description>Proxy - Maintainer.CC on bugs</description>
+ </maintainer>
+ <longdescription lang="en">EFI Boot Manager</longdescription>
+ <longdescription lang="fr">Gestionnaire d'amorçage EFI</longdescription>
+ <use lang="en">
<flag name="ext2">Builds the EFI binary ext2 filesystem driver</flag>
<flag name="ext4">Builds the EFI binary ext4 filesystem driver</flag>
<flag name="reiserfs">Builds the EFI binary reiserfs filesystem driver</flag>
<flag name="iso9660">Builds the EFI binary iso9660 filesystem driver</flag>
<flag name="hfs">Builds the EFI binary hfs filesystem driver</flag>
- <flag name="btrfs"> Builds the EFI binary btrfs filesystem driver</flag>
+ <flag name="btrfs">Builds the EFI binary btrfs filesystem driver</flag>
<flag name="ntfs">Builds the EFI binary ntfs filesystem driver</flag>
+ <flag name="doc">Install document files</flag>
+ </use>
+ <use lang="fr">
+ <flag name="ext2">Construire le gestionnaire EFI pour le système de fichier ext2</flag>
+ <flag name="ext4">Construire le gestionnaire EFI pour le système de fichier ext4</flag>
+ <flag name="reiserfs">Construire le gestionnaire EFI pour le système de fichier reiserfs</flag>
+ <flag name="iso9660">Construire le gestionnaire EFI pour le système de fichier iso9660</flag>
+ <flag name="hfs">Construire le gestionnaire EFI pour le système de fichier hfs</flag>
+ <flag name="btrfs">Construire le gestionnaire EFI pour le système de fichier btrfs</flag>
+ <flag name="ntfs">Construire le gestionnaire EFI pour le système de fichier ntfs</flag>
+ <flag name="doc">Installer les fichiers de documentation</flag>
</use>
<upstream>
<remote-id type="sourceforge">refind</remote-id>
--- /dev/null
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="The rEFInd UEFI Boot Manager by Rod Smith"
+HOMEPAGE="http://www.rodsbooks.com/refind/"
+
+SRC_URI="mirror://sourceforge/project/${PN}/${PV}/${PN}-src-${PV}.tar.gz"
+
+LICENSE="BSD GPL-2 GPL-3 FDL-1.3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+FS_USE="btrfs +ext2 +ext4 hfs +iso9660 ntfs reiserfs"
+IUSE="${FS_USE} doc"
+
+DEPEND=">=sys-boot/gnu-efi-3.0.2"
+
+DOCS="NEWS.txt README.txt docs/refind docs/Styles"
+
+pkg_setup() {
+ if use x86 ; then
+ export EFIARCH=ia32
+ export BUILDARCH=ia32
+ elif use amd64; then
+ export EFIARCH=x64
+ export BUILDARCH=x86_64
+ else
+ # Try to support anyway
+ export BUILDARCH=$( uname -m | sed s,i[3456789]86,ia32, )
+ if [[ ${BUILDARCH} == "x86_64" ]] ; then
+ export EFIARCH=x64
+ else
+ export EFIARCH=${ARCH}
+ fi
+ fi
+}
+
+src_prepare() {
+ # Make refind-install "symlink-proof"
+ epatch "${FILESDIR}/${PV}-refind-install-symlink.patch"
+}
+
+src_compile() {
+ # Make main EFI
+ all_target=gnuefi
+ emake ARCH=${BUILDARCH} ${all_target}
+
+ # Make filesystem drivers
+ export gnuefi_target="_gnuefi"
+ for fs in ${FS_USE}; do
+ fs=${fs#+}
+ if use "${fs}"; then
+ einfo "Building ${fs} filesystem driver"
+ rm -f "${S}/filesystems/fsw_efi.o"
+ emake -C "${S}/filesystems" ARCH=${BUILDARCH} ${fs}${gnuefi_target}
+ fi
+ done
+}
+
+src_install() {
+ exeinto "/usr/share/${P}"
+ doexe refind-install
+ dosym "/usr/share/${P}/refind-install" "/usr/sbin/refind-install"
+
+ dodoc "${S}"/{COPYING.txt,LICENSE.txt,CREDITS.txt}
+ if use doc; then
+ doman "${S}/docs/man/"*
+ dodoc -r ${DOCS}
+ fi
+
+ insinto "/usr/share/${P}/refind"
+ doins "${S}/refind/refind_${EFIARCH}.efi"
+ doins -r "${S}/drivers_${EFIARCH}"
+ doins "${S}/refind.conf-sample"
+ doins -r images icons fonts banners
+
+ insinto "/usr/share/${P}/refind/tools_${EFIARCH}"
+ doins "${S}/gptsync/gptsync_${EFIARCH}.efi"
+
+ insinto "/etc/refind.d"
+ doins -r "${S}/keys"
+
+ dosbin "${S}/mkrlconf"
+ dosbin "${S}/mvrefind"
+}
+
+pkg_postinst() {
+ elog "rEFInd has been built and installed into /usr/share/${P}"
+ elog "You will need to use the command 'refind-install' to install"
+ elog "the binaries into your EFI System Partition"
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ elog ""
+ elog "refind-install requires additional packages to be fully functional:"
+ elog " app-crypt/sbsigntool for binary signing for use with SecureBoot"
+ elog " sys-boot/efibootmgr for writing to NVRAM"
+ elog " sys-block/parted for automatic ESP location and mount"
+ elog ""
+ elog "A sample configuration can be found at"
+ elog "/usr/share/${P}/refind/refind.conf-sample"
+ else
+ ewarn "Note that this will not update any EFI binaries on your EFI"
+ ewarn "System Partition - this needs to be done manually."
+ fi
+}