| 1 |
jdhore |
1.2 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
tommy |
1.1 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
vapier |
1.3 |
# $Header: /var/cvsroot/gentoo-x86/sys-fs/dmraid/dmraid-1.0.0_rc16-r3.ebuild,v 1.2 2012/05/04 19:09:17 jdhore Exp $ |
| 4 |
tommy |
1.1 |
|
| 5 |
|
|
EAPI="2" |
| 6 |
|
|
|
| 7 |
vapier |
1.3 |
inherit autotools linux-info flag-o-matic eutils |
| 8 |
tommy |
1.1 |
|
| 9 |
|
|
MY_PV=${PV/_/.}-3 |
| 10 |
|
|
|
| 11 |
|
|
DESCRIPTION="Device-mapper RAID tool and library" |
| 12 |
|
|
HOMEPAGE="http://people.redhat.com/~heinzm/sw/dmraid/" |
| 13 |
|
|
SRC_URI="http://people.redhat.com/~heinzm/sw/dmraid/src/${PN}-${MY_PV}.tar.bz2" |
| 14 |
|
|
|
| 15 |
|
|
LICENSE="GPL-2" |
| 16 |
|
|
SLOT="0" |
| 17 |
|
|
KEYWORDS="~amd64 ~ppc ~x86" |
| 18 |
|
|
IUSE="dietlibc intel_led klibc led mini static" |
| 19 |
|
|
|
| 20 |
|
|
RDEPEND="|| ( >=sys-fs/lvm2-2.02.45 |
| 21 |
|
|
sys-fs/device-mapper ) |
| 22 |
|
|
klibc? ( dev-libs/klibc ) |
| 23 |
|
|
dietlibc? ( dev-libs/dietlibc )" |
| 24 |
|
|
DEPEND="${RDEPEND} |
| 25 |
jdhore |
1.2 |
virtual/pkgconfig" |
| 26 |
tommy |
1.1 |
|
| 27 |
|
|
S=${WORKDIR}/${PN}/${MY_PV}/${PN} |
| 28 |
|
|
|
| 29 |
|
|
pkg_setup() { |
| 30 |
|
|
if kernel_is lt 2 6 ; then |
| 31 |
|
|
ewarn "You are using a kernel < 2.6" |
| 32 |
|
|
ewarn "DMraid uses recently introduced Device-Mapper features." |
| 33 |
|
|
ewarn "These might be unavailable in the kernel you are running now." |
| 34 |
|
|
fi |
| 35 |
|
|
} |
| 36 |
|
|
|
| 37 |
|
|
src_prepare() { |
| 38 |
|
|
epatch "${FILESDIR}"/${P}-undo-p-rename.patch \ |
| 39 |
|
|
"${FILESDIR}"/${P}-return-all-sets.patch \ |
| 40 |
|
|
"${FILESDIR}"/${P}-static-build-fixes.patch |
| 41 |
|
|
# pkg_check_modules is not in aclocal.m4 by default, and eautoreconf doesnt add it |
| 42 |
|
|
elog "Appending pkg.m4 from system to aclocal.m4" |
| 43 |
|
|
cat "${ROOT}"/usr/share/aclocal/pkg.m4 >>"${S}"/aclocal.m4 || die "Could not append pkg.m4" |
| 44 |
|
|
eautoreconf |
| 45 |
|
|
|
| 46 |
|
|
elog "Creating prepatched source archive for use with Genkernel" |
| 47 |
|
|
# archive the patched source for use with genkernel |
| 48 |
|
|
cd "${WORKDIR}" |
| 49 |
|
|
mkdir -p "tmp/${PN}" |
| 50 |
|
|
cp -a "${PN}/${MY_PV}/${PN}" "tmp/${PN}" |
| 51 |
|
|
mv "tmp/${PN}/${PN}" "tmp/${PN}/${MY_PV}" |
| 52 |
|
|
cd tmp |
| 53 |
|
|
tar -jcf ${PN}-${MY_PV}-prepatched.tar.bz2 ${PN} || die |
| 54 |
|
|
mv ${PN}-${MY_PV}-prepatched.tar.bz2 .. |
| 55 |
|
|
} |
| 56 |
|
|
|
| 57 |
|
|
src_configure() { |
| 58 |
|
|
local mylibc |
| 59 |
|
|
if use klibc && use dietlibc; then |
| 60 |
|
|
ewarn "Cannot compile against both klibc and dietlibc -- choosing klibc." |
| 61 |
|
|
mylibc="--enable-klibc --disable-dietlibc" |
| 62 |
|
|
else |
| 63 |
|
|
mylibc="$(use_enable klibc) $(use_enable dietlibc)" |
| 64 |
|
|
fi |
| 65 |
|
|
econf --with-usrlibdir='${prefix}'/$(get_libdir) \ |
| 66 |
|
|
$(use_enable static static_link) \ |
| 67 |
|
|
$(use_enable mini) \ |
| 68 |
|
|
$(use_enable led) \ |
| 69 |
|
|
$(use_enable intel_led) \ |
| 70 |
|
|
${mylibc} |
| 71 |
|
|
} |
| 72 |
|
|
|
| 73 |
|
|
src_install() { |
| 74 |
|
|
emake DESTDIR="${D}" install || die "emake install failed" |
| 75 |
|
|
dodoc CHANGELOG README TODO KNOWN_BUGS doc/* || die "dodoc failed" |
| 76 |
|
|
insinto /usr/share/${PN} |
| 77 |
|
|
doins "${WORKDIR}"/${PN}-${MY_PV}-prepatched.tar.bz2 || die |
| 78 |
|
|
} |
| 79 |
|
|
|
| 80 |
|
|
pkg_postinst() { |
| 81 |
|
|
elog "For booting Gentoo from Device-Mapper RAID you can use Genkernel." |
| 82 |
|
|
elog " " |
| 83 |
|
|
elog "Genkernel will generate the kernel and the initrd with a statically " |
| 84 |
|
|
elog "linked dmraid binary (its own version which may not be the same as this version):" |
| 85 |
|
|
elog "\t emerge -av sys-kernel/genkernel" |
| 86 |
|
|
elog "\t genkernel --dmraid all" |
| 87 |
|
|
elog " " |
| 88 |
|
|
elog "If you would rather use this version of DMRAID with Genkernel, update the following" |
| 89 |
|
|
elog "in /etc/genkernel.conf:" |
| 90 |
|
|
elog "\t DMRAID_VER=\"${MY_PV}\"" |
| 91 |
|
|
elog "\t DMRAID_SRCTAR=\"/usr/share/${PN}/${PN}-${MY_PV}-prepatched.tar.bz2\"" |
| 92 |
|
|
elog " " |
| 93 |
|
|
ewarn "DMRAID should be safe to use, but no warranties can be given" |
| 94 |
|
|
} |