# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-cluster/pvfs2/pvfs2-1.5.1.ebuild,v 1.1 2006/07/24 22:06:41 genstef Exp $ inherit linux-mod autotools toolchain-funcs MY_PN="${PN%[0-9]*}" MY_P="${MY_PN}-${PV}" DESCRIPTION="Parallel Virtual File System version 2" HOMEPAGE="http://www.pvfs.org/pvfs2/" SRC_URI="ftp://ftp.parl.clemson.edu/pub/pvfs2/${MY_P}.tar.gz" IUSE="gtk static doc" RDEPEND="gtk? ( >=x11-libs/gtk+-2 ) sys-libs/db" DEPEND="${RDEPEND} virtual/linux-sources" SLOT="0" LICENSE="GPL-2" KEYWORDS="~ppc ~x86 ~amd64" S="${WORKDIR}/${MY_P}" #Without this, the make kmod_install in src_install() would fail. ARCH=$(tc-arch-kernel) pkg_setup() { linux-mod_pkg_setup if kernel_is 2 4; then BUILD_TARGETS="kmod24 all" ECONF_PARAMS="--with-kernel24=${KV_DIR}" MODULE_NAMES="pvfs2(fs::src/kernel/linux-2.4)" else BUILD_TARGETS="kmod all" ECONF_PARAMS="--with-kernel=${KV_DIR} --enable-verbose-build" MODULE_NAMES="pvfs2(fs::src/kernel/linux-2.6)" fi #Notice I don't include --disable-static because it makes the linker fail due to a missing library #needed by LIBS_THREADED += -lpvfs2-threaded. However that library is only compiled if static is enabled. Anyway #it is used to build pvfs2-client-core-threaded, which is not installed by make kmod_install (unstable perhaps?) ECONF_PARAMS="${ECONF_PARAMS} --enable-mmap-racache $(use_enable !static shared)" ECONF_PARAMS="${ECONF_PARAMS} $(use_enable gtk karma)" } src_unpack() { unpack ${A} cd "${S}" epatch "${FILESDIR}"/${PN}-1.5.1-destdir.patch epatch "${FILESDIR}"/${PV}-link-librt-properly.patch epatch "${FILESDIR}"/${PV}-soname.patch epatch "${FILESDIR}"/${PV}-as-needed.patch #This fixes the Makefile LDFLAGS being overriden by the LDFLAGS used by emake (called from linux-mod_src_compile) grep '$(E)$(LD).*$(LDFLAGS)' * -R -l | xargs sed -i 's/$(LDFLAGS)/$(AM_LDFLAGS) &/' sed -i 's,^LDFLAGS = -L @BUILD_ABSOLUTE_TOP@/lib,AM_&,' Makefile.in AT_M4DIR="maint/config" eautoreconf } src_compile() { econf ${ECONF_PARAMS} || die "Unable to run econf ${ECONF_PARAMS}" emake HOSTCC="$(tc-getBUILD_CC)" CC="$(get-KERNEL_CC)" ${LDFLAGS} ${BUILD_TARGETS} \ || die "Unable to make ${BUILD_TARGETS}." } src_install() { #We don't use linux-mod_src_install because kmod_install also installs some other important files if kernel_is 2 4; then emake DESTDIR="${D}" kmod24_install || die "install failed" else emake DESTDIR="${D}" kmod_install || die "install failed" fi emake DESTDIR="${D}" install || die "install failed" newinitd "${FILESDIR}"/pvfs2-server.rc pvfs2-server newconfd "${FILESDIR}"/pvfs2-server.conf pvfs2-server dodoc AUTHORS CREDITS ChangeLog INSTALL README docinto examples dodoc examples/{fs.conf,pvfs2-server.rc,server.conf-localhost} # this is LARGE (~5mb) if use doc; then docdir="/usr/share/doc/${PF}/" cp -pPR ${S}/doc ${D}${docdir} rm -rf ${D}${docdir}/man fi } pkg_preinst() { linux-mod_pkg_preinst } pkg_postinst() { linux-mod_pkg_postinst elog "To enable PVFS2 Server on boot you will have to add it to the" elog "default profile, issue the following command as root to do so." elog elog "rc-update add pvfs2-server default" }