# Copyright 2005-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-fs/dmraid/dmraid-1.0.0_rc8-r1.ebuild,v 1.1 2005/07/28 02:24:07 solar Exp $ inherit linux-info flag-o-matic DESCRIPTION="dmraid (Device-mapper RAID tool and library)" HOMEPAGE="http://people.redhat.com/~heinzm/sw/dmraid/" SRC_URI="http://people.redhat.com/~heinzm/sw/dmraid/src/${P/_/.}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="x86 amd64" IUSE="static selinux" DEPEND="sys-fs/device-mapper selinux? ( sys-libs/libselinux ) selinux? ( sys-libs/libsepol )" S=${WORKDIR}/${PN}/${PV/_/.} pkg_setup() { if kernel_is lt 2 6; then ewarn "You are using a kernel < 2.6" ewarn "DMraid uses recently introduced Device-Mapper features." ewarn "These might be unavailable in the kernel you are running now." fi } src_unpack() { unpack ${A} epatch ${FILESDIR}/${PN}-1.0.0-rc10-asr-make.patch cd ${S} } src_compile() { local myconf= #myconf="${myconf} $(use_enable static static_link)" if use static; then myconf="${myconf} --enable-static_link" if use selinux; then ewarn "NOTE - compiling with libselinux / libsepol is not currently possible for static" fi myconf="${myconf} --disable-libsepol --disable-libselinux" else myconf="${myconf} --enable-shared_lib" myconf="${myconf} $(use_enable selinux libselinux)" myconf="${myconf} $(use_enable selinux libsepol)" fi #inlining doesnt seem to work for dmraid filter-flags -fno-inline ./configure ${myconf} || die "Failed configure" emake || die "emake failed" } src_install() { einstall DESTDIR=${D} || die "einstall failed" dolib.a lib/libdmraid.a # no header file is installed by make install insinto /usr/include newins include/dmraid.h libdmraid.h dodoc CHANGELOG README TODO KNOWN_BUGS doc/* } pkg_postinst() { echo einfo "For booting Gentoo from Device-Mapper RAID you can use Genkernel." echo einfo "Genkernel will generate the kernel and the initrd with a staticly linked dmraid binary:" einfo "emerge -av sys-kernel/genkernel" einfo "genkernel --dmraid --udev all" echo ewarn "DMraid should be safe to use, but no warranties can be given" echo ebeep }