# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils linux-info linux-mod # correct for dash in filename MY_PF=${PF/\0.0/\0-0} S="${WORKDIR}/${MY_PF}" DESCRIPTION="Linux filesystem which utilizes copy-on-write functionality" HOMEPAGE="http://sourceforge.net/projects/mapfs" SRC_URI="mirror://sourceforge/mapfs/${MY_PF}.tar.gz" LICENSE="GPL-2" SLOT="${KV}" KEYWORDS="~x86" IUSE="" RDEPEND="virtual/modutils" DEPEND="virtual/linux-sources" pkg_setup() { get_version if [ "${KV_MAJOR}" == "2" -a "${KV_MINOR}" == "4" -a "${KV_PATCH}" -lt "7" ]; then eerror "Kernel is ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}; MapFS is known to" eerror "build for kernels 2.4.7 - 2.6.16." eerror "Kernel too old, exiting." exit 1 fi linux-mod_pkg_setup MODULE_NAMES="mapfs(kernel/fs/mapfs:${S})" } src_unpack() { unpack ${A} || die "unpack failed" if [ "${KV_MAJOR}" == "2" -a "${KV_MINOR}" == "6" -a "${KV_PATCH}" -gt "13" ]; then # Patch for Kernels >2.6.13 # http://sourceforge.net/tracker/index.php?func=detail&aid=1474603&group_id=149646&atid=775455 epatch ${FILESDIR}/mapfs-kernel-2.6.16.patch fi } src_compile() { cd ${ROOT}/usr/src/linux-${KV} unset ARCH make SUBDIRS=${WORKDIR}/${MY_PF} modules || die } src_install() { linux-mod_src_install dodoc LICENSE dodir /etc/init.d cp ${FILESDIR}/mapfs.init ${D}/etc/init.d/mapfs }