diff options
author | Justin Lecher <jlec@gentoo.org> | 2010-09-19 08:08:16 +0000 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2010-09-19 08:08:16 +0000 |
commit | ff67e41700ffa4d8289dbd92345f232c2571e245 (patch) | |
tree | ade222643d504f71bee54be289b9b221b3d84cb7 /sys-fs/cachefilesd | |
parent | Version bump. (diff) | |
download | gentoo-2-ff67e41700ffa4d8289dbd92345f232c2571e245.tar.gz gentoo-2-ff67e41700ffa4d8289dbd92345f232c2571e245.tar.bz2 gentoo-2-ff67e41700ffa4d8289dbd92345f232c2571e245.zip |
New addition, 275014; thanks Bruno Redondi and everyone else for the contribution
(Portage version: 2.2_rc83/cvs/Linux x86_64)
Diffstat (limited to 'sys-fs/cachefilesd')
-rw-r--r-- | sys-fs/cachefilesd/ChangeLog | 12 | ||||
-rw-r--r-- | sys-fs/cachefilesd/cachefilesd-0.10.1.ebuild | 50 | ||||
-rw-r--r-- | sys-fs/cachefilesd/files/0.10.1-makefile.patch | 21 | ||||
-rw-r--r-- | sys-fs/cachefilesd/files/cachefilesd.conf | 8 | ||||
-rw-r--r-- | sys-fs/cachefilesd/files/cachefilesd.init | 52 | ||||
-rw-r--r-- | sys-fs/cachefilesd/metadata.xml | 8 |
6 files changed, 151 insertions, 0 deletions
diff --git a/sys-fs/cachefilesd/ChangeLog b/sys-fs/cachefilesd/ChangeLog new file mode 100644 index 000000000000..95b77e182999 --- /dev/null +++ b/sys-fs/cachefilesd/ChangeLog @@ -0,0 +1,12 @@ +# ChangeLog for sys-fs/cachefilesd +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/cachefilesd/ChangeLog,v 1.1 2010/09/19 08:08:16 jlec Exp $ + +*cachefilesd-0.10.1 (19 Sep 2010) + + 19 Sep 2010; Justin Lecher <jlec@gentoo.org> +files/0.10.1-makefile.patch, + +cachefilesd-0.10.1.ebuild, +files/cachefilesd.conf, + +files/cachefilesd.init, +metadata.xml: + New addition, 275014; thanks Bruno Redondi and everyone else for the + contribution + diff --git a/sys-fs/cachefilesd/cachefilesd-0.10.1.ebuild b/sys-fs/cachefilesd/cachefilesd-0.10.1.ebuild new file mode 100644 index 000000000000..06466a9daee7 --- /dev/null +++ b/sys-fs/cachefilesd/cachefilesd-0.10.1.ebuild @@ -0,0 +1,50 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/cachefilesd/cachefilesd-0.10.1.ebuild,v 1.1 2010/09/19 08:08:16 jlec Exp $ + +EAPI="2" + +inherit eutils toolchain-funcs + +DESCRIPTION="Provides a caching directory on an already mounted filesystem" +HOMEPAGE="http://people.redhat.com/~dhowells/fscache/" +SRC_URI="http://people.redhat.com/~dhowells/fscache/${P}.tar.bz2" + +IUSE="doc selinux" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +src_prepare() { + epatch "${FILESDIR}"/${PV}-makefile.patch + tc-export CC + if ! use selinux; then + sed -e '/^secctx/s:^:#:g' -i cachefilesd.conf || die + fi +} +src_install() { + emake DESTDIR="${D}" install || die "install failed" + + if use selinux; then + insinto /usr/share/doc/${P} + doins -r selinux || die + fi + + dodoc README howto.txt || die + + newconfd "${FILESDIR}"/cachefilesd.conf cachefilesd || die + newinitd "${FILESDIR}"/cachefilesd.init cachefilesd || die + + keepdir /var/cache/cachefilesd +} + +pkg_postinst() { + [[ -d /var/fscache ]] && return + elog "Before CacheFiles can be used, a directory for local storage" + elog "must be created. The default configuration of /etc/cachefilesd.conf" + elog "uses /var/fscache. The filesystem mounted there must support" + elog "extended attributes (mount -o user_xattr)." + elog "" + elog "Once that is taken care of, start the daemon, add -o ...,fsc" + elog "to the mount options of your network mounts, and let it fly!" +} diff --git a/sys-fs/cachefilesd/files/0.10.1-makefile.patch b/sys-fs/cachefilesd/files/0.10.1-makefile.patch new file mode 100644 index 000000000000..af029c9293a3 --- /dev/null +++ b/sys-fs/cachefilesd/files/0.10.1-makefile.patch @@ -0,0 +1,21 @@ +diff --git a/Makefile b/Makefile +index 15a8445..d650f47 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,4 +1,3 @@ +-CFLAGS := -g -O2 -Wall + INSTALL := install + DESTDIR := + BUILDFOR := +@@ -21,7 +20,10 @@ endif + # + all: cachefilesd + +-cachefilesd: cachefilesd.c Makefile ++cachefilesd.o: cachefilesd.c ++ $(CC) $(CFLAGS) -c $< ++ ++cachefilesd: cachefilesd.o + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< + + # diff --git a/sys-fs/cachefilesd/files/cachefilesd.conf b/sys-fs/cachefilesd/files/cachefilesd.conf new file mode 100644 index 000000000000..40d1e92c88c6 --- /dev/null +++ b/sys-fs/cachefilesd/files/cachefilesd.conf @@ -0,0 +1,8 @@ +# Config file for /etc/init.d/cachefilesd +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/cachefilesd/files/cachefilesd.conf,v 1.1 2010/09/19 08:08:16 jlec Exp $ + +# -d - This can be specified multiple times. +# -f <configfile> - Read the specified configuration file instead of /etc/cachefiles.conf +OPTIONS="" diff --git a/sys-fs/cachefilesd/files/cachefilesd.init b/sys-fs/cachefilesd/files/cachefilesd.init new file mode 100644 index 000000000000..6c934b06d029 --- /dev/null +++ b/sys-fs/cachefilesd/files/cachefilesd.init @@ -0,0 +1,52 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/cachefilesd/files/cachefilesd.init,v 1.1 2010/09/19 08:08:16 jlec Exp $ + +depend() { + need localmount + use logger + before nfsmount +} + +checkxattr() { + local testpath testfile ret + testpath=$(awk '/^[[:space:]]*dir/ {print $2}' /etc/cachefilesd.conf) + testfile="${testpath}/.tmp-xattr-test.cachefilesd" + touch "${testfile}" + # creates a file in the testpath and tries to set an attribute on it to check + # if the support is available + attr -s test -V xattr "${testfile}" 2>&1 > /dev/null + ret=$? + rm -f "${testfile}" + [ ${ret} -ne 0 ] && eerror "xattr support missing on the ${testpath} filesystem" + return ${ret} +} + +start() { + ebegin "Starting cachefilesd" + checkxattr || return $? + # check if the cachefiles modules is loaded (or builtin) + if [ ! -c /dev/cachefiles ] ; then + local ret + einfo "/dev/cachefiles doesn't exist, trying to modprobe cachefiles" + modprobe cachefiles + ret=$? + if [ $ret -ne 0 ] ; then + eerror "cachefiles modules cannot be loaded so cachefilesd " + error "cannot be started, aborting. Did you build fscache in your " + error "kernel? Note that you need a 2.6.30 or better kernel" + return $ret + fi + fi + start-stop-daemon --start --pidfile /var/run/cachefilesd.pid --exec /sbin/cachefilesd -- ${OPTIONS} + eend $? "Failed to start cachefilesd. Check the system log to see the error" + +} + +stop() { + ebegin "Stopping cachefilesd" + start-stop-daemon --stop --exec /sbin/cachefilesd --pidfile /var/run/cachefilesd.pid + eend $? "Failed to stop cachefilesd" +} + diff --git a/sys-fs/cachefilesd/metadata.xml b/sys-fs/cachefilesd/metadata.xml new file mode 100644 index 000000000000..9aa75ad4091e --- /dev/null +++ b/sys-fs/cachefilesd/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>no-herd</herd> +<maintainer> + <email>jlec@gentoo.org</email> +</maintainer> +</pkgmetadata> |