summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMantas Mikulėnas2015-08-08 18:25:17 +0300
committerMantas Mikulėnas2015-08-08 18:25:34 +0300
commite2ce7e8f1ec4a6f54e3cd984079995459a5664ce (patch)
tree7cfc28689e090218aa0f101827a7732f700fc754
downloadaur-e2ce7e8f1ec4a6f54e3cd984079995459a5664ce.tar.gz
initial import
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD26
-rwxr-xr-xcachefilesd49
3 files changed, 92 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..e50bce29416
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = cachefilesd
+ pkgdesc = Userspace daemon acting as a backend for FS-Cache
+ pkgver = 0.10.5
+ pkgrel = 1
+ url = http://people.redhat.com/~dhowells/fscache/
+ arch = i686
+ arch = x86_64
+ license = GPL
+ depends = glibc
+ backup = etc/cachefilesd.conf
+ source = http://people.redhat.com/~dhowells/fscache/cachefilesd-0.10.5.tar.bz2
+ source = cachefilesd
+ md5sums = 9e85dd0ace346ff47e188ded8c05ab3b
+ md5sums = a4f0c47a945f296f120e29f156aea9ba
+
+pkgname = cachefilesd
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..d51a094a5bf
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,26 @@
+# Maintainer: Rémy Oudompheng <remy@archlinux.org>
+
+pkgname=cachefilesd
+pkgver=0.10.5
+pkgrel=1
+pkgdesc="Userspace daemon acting as a backend for FS-Cache"
+arch=('i686' 'x86_64')
+url="http://people.redhat.com/~dhowells/fscache/"
+license=('GPL')
+depends=('glibc')
+source=(http://people.redhat.com/~dhowells/fscache/${pkgname}-${pkgver}.tar.bz2
+ cachefilesd)
+backup=(etc/cachefilesd.conf)
+md5sums=('9e85dd0ace346ff47e188ded8c05ab3b'
+ 'a4f0c47a945f296f120e29f156aea9ba')
+
+build() {
+ cd "$pkgname-$pkgver"
+ make CFLAGS="$CFLAGS"
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+ install -D -m 755 "${srcdir}/cachefilesd" "${pkgdir}/etc/rc.d/cachefilesd"
+}
diff --git a/cachefilesd b/cachefilesd
new file mode 100755
index 00000000000..4624369c9e5
--- /dev/null
+++ b/cachefilesd
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+pidfile="/run/cachefilesd.pid"
+
+get_pid() {
+ if [ -r "${pid_file}" ]; then
+ cat "${pid_file}"
+ else
+ pgrep -f /sbin/cachefilesd
+ fi
+}
+
+PID=$(get_pid)
+
+case "$1" in
+ start)
+ stat_busy "Starting cachefilesd"
+ modprobe cachefiles 2>/dev/null
+ [[ -z "$PID" ]] && /sbin/cachefilesd -p "$pidfile"
+ if (( $? > 0 )); then
+ stat_fail
+ else
+ add_daemon cachefilesd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping cachefilesd"
+ [[ ! -z "$PID" ]] && kill $PID &> /dev/null
+ if (( $? > 0 )); then
+ stat_fail
+ else
+ rm -f "$pidfile"
+ rm_daemon cachefilesd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 0.5
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0