# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit kernel-mod eutils DESCRIPTION="User-mode filesystem implementation" HOMEPAGE="http://lufs.sourceforge.net/lufs/" SRC_URI="mirror://sourceforge/lufs/${P}.tar.gz http://sites.inka.de/~W1752/vlfs/vlfs-0.3.diff" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="debug kernelsupport lufssuid" RDEPEND="" DEPEND="virtual/linux-sources sys-devel/automake sys-devel/autoconf >=sys-apps/sed-4" pkg_setup() { if use kernelsupport; then kernel-mod_check_modules_supported fi } src_unpack() { unpack ${P}.tar.gz cd ${S} # Fix GCC 3.3.2 build failure (see also # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13192) epatch ${FILESDIR}/gentoo-gcc332fix-${PV}.patch epatch ${FILESDIR}/${P}-fPIC.patch epatch ${FILESDIR}/lufs-automount-port.diff epatch ${FILESDIR}/${P}-enable-gnome-2.patch epatch ${DISTDIR}/vlfs-0.3.diff epatch ${FILESDIR}/captive.diff ln -s ../../../include/lufs/proto.h kernel/Linux/2.4 ln -s ../../../include/lufs/proto.h kernel/Linux/2.6 } src_compile() { aclocal && automake && autoconf local myconf myconf="--enable-wavfs --enable-cardfs --with-kernel=${KV} --with-kheaders=${ROOT}/usr/src/linux/include" if ! use kernelsupport; then myconf="${myconf} --disable-kernel-support" fi if ! use lufssuid; then myconf="${myconf} --disable-suid" fi if [ "`portageq has_version / sys-fs/autofs`" == "0" ] ; then myconf="${myconf} --enable-autofs-install" fi if use debug; then myconf="${myconf} --enable-debug --enable-kdebug" fi unset ARCH econf ${myconf} || die if use kernelsupport; then # http://marc.theaimsgroup.com/?l=gentoo-dev&m=109672618708314&w=2 kernel-mod_getversion if [ ${KV_MINOR} -gt 5 ] && [ ${KV_PATCH} -gt 5 ] then sed -i 's:SUBDIRS=:M=:g' kernel/Linux/2.6/Makefile fi fi emake KERNEL_DIR="${ROOT}/usr/src/linux" KDIR="${ROOT}/usr/src/linux" || die "emake failed" } src_install () { dodoc AUTHORS ChangeLog Contributors INSTALL \ NEWS README THANKS TODO docs/cefs.txt dohtml docs/lufs.html env -u ARCH make DESTDIR=${D} KDIR="${ROOT}/usr/src/linux" install || die "make install failed" if use kernelsupport; then if kernel-mod_is_2_6_kernel then KV_OBJ="ko" else KV_OBJ="o" fi insinto ${ROOT}/lib/modules/${KV}/extra doins kernel/Linux/2.${KV_MINOR}/lufs.$KV_OBJ fi dodir /etc/autofs mv ${D}/etc/auto.* ${D}/etc/autofs if ! use lufssuid; then chmod -s ${D}/usr/bin/lufsmnt else chmod +s ${D}/usr/bin/lufsmnt fi } pkg_postinst() { if ! use lufssuid; then einfo einfo "/usr/bin/lufsmnt is not suid root because that is a security risk (see the README)" einfo "If you want normal users to be able to use it, you must set it suid root yourself." einfo "Set the lufssuid use-flag to do that automatically." einfo else einfo einfo "/usr/bin/lufsmnt is suid root. Read the README; this is a security risk." einfo fi if use kernelsupport; then einfo "Checking kernel module dependencies" test -r "${ROOT}/usr/src/linux/System.map" && \ depmod -ae -F "${ROOT}/usr/src/linux/System.map" -b "${ROOT}" -r ${KV} fi }