summaryrefslogtreecommitdiff
path: root/social
diff options
context:
space:
mode:
authorNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-09-06 02:06:11 -0300
committerNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-09-06 02:06:11 -0300
commit9088da5f2dc47ac8fb7b6a7add6bd6d970e97cfd (patch)
tree5f1e1c366fd1cac4ed63e2f42ecb1d07bfd1a355 /social
parentc9c71d29263fd54eb93d4382781becbd865dffe4 (diff)
social/opentracker-20110831-1
Diffstat (limited to 'social')
-rw-r--r--social/opentracker/PKGBUILD60
-rw-r--r--social/opentracker/license.txt2
-rwxr-xr-xsocial/opentracker/opentracker.rc.d37
3 files changed, 99 insertions, 0 deletions
diff --git a/social/opentracker/PKGBUILD b/social/opentracker/PKGBUILD
new file mode 100644
index 000000000..61702974c
--- /dev/null
+++ b/social/opentracker/PKGBUILD
@@ -0,0 +1,60 @@
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgname=opentracker
+pkgver=20110831
+pkgrel=1
+pkgdesc='An open and free bittorrent tracker'
+arch=('i686' 'x86_64')
+url='http://erdgeist.org/arts/software/opentracker/'
+license=('custom:Beer' 'GPL')
+makedepends=('libowfat' 'cvs')
+depends=('bash' 'zlib')
+backup=('etc/opentracker/config')
+source=("http://repo.parabolagnulinux.org/other/${pkgname}-${pkgver}.tar.gz"
+ 'opentracker.rc.d'
+ 'license.txt')
+md5sums=('ad992e0b7e8f84ddab391da5307e67c6'
+ '390bde9d010e79ab1309c02dcf9972e8'
+ '865211941e882c0aff5d36a22ac9efaa')
+
+_cvsroot=':pserver:anoncvs@cvs.erdgeist.org:/home/cvsroot'
+_cvsmod='opentracker'
+
+mksource() {
+ pushd "${srcdir}"
+ msg 'Connecting to CVS server....'
+ if [ -d ${_cvsmod}/CVS ]; then
+ cd ${_cvsmod}
+ cvs -z3 update -d
+ else
+ cvs -z3 -d ${_cvsroot} co -f ${_cvsmod}
+ cd ${_cvsmod}
+ fi
+
+ msg 'CVS checkout done or server timeout'
+ popd
+
+ tar czf ${pkgname}-${pkgver}.tar.gz ${_cvsmod}/
+}
+
+build() {
+ cd "${srcdir}/${_cvsmod}"
+ msg 'Starting make...'
+
+ sed -e 's#PREFIX?=..#PREFIX?=/usr#' \
+ -e 's#LIBOWFAT_HEADERS=$(PREFIX)/libowfat#LIBOWFAT_HEADERS=$(PREFIX)/include#' \
+ -e 's#LIBOWFAT_LIBRARY=$(PREFIX)/libowfat#LIBOWFAT_LIBRARY=$(PREFIX)/lib#' \
+ -e 's/#FEATURES+=-DWANT_ACCESSLIST_WHITE/FEATURES+=-DWANT_ACCESSLIST_WHITE/' \
+ -e 's/#FEATURES+=-DWANT_RESTRICT_STATS/FEATURES+=-DWANT_RESTRICT_STATS/' \
+ -e 's/FEATURES+=-DWANT_FULLSCRAPE/#FEATURES+=-DWANT_FULLSCRAPE/' \
+ -i Makefile
+ sed -e 's|# tracker.rootdir /usr/local/etc/opentracker|tracker.rootdir /etc/opentracker|' \
+ -e 's|# access.stats 192.168.0.23|access.stats 127.0.0.1|' \
+ -i opentracker.conf.sample
+
+ make || return 1
+ install -D -m 755 opentracker $pkgdir/usr/bin/opentracker
+ install -D -m 755 $srcdir/opentracker.rc.d $pkgdir/etc/rc.d/opentracker
+ install -D -m 644 opentracker.conf.sample $pkgdir/etc/opentracker/config
+ install -D -m 644 $srcdir/license.txt $pkgdir/usr/share/licenses/opentracker/license.txt
+}
diff --git a/social/opentracker/license.txt b/social/opentracker/license.txt
new file mode 100644
index 000000000..ff1bb40f5
--- /dev/null
+++ b/social/opentracker/license.txt
@@ -0,0 +1,2 @@
+This software was written by Dirk Engling <erdgeist@erdgeist.org>
+It is considered beerware. Prost. Skol. Cheers or whatever.
diff --git a/social/opentracker/opentracker.rc.d b/social/opentracker/opentracker.rc.d
new file mode 100755
index 000000000..b1aa34c14
--- /dev/null
+++ b/social/opentracker/opentracker.rc.d
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# general config
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/bin/opentracker`
+
+case "$1" in
+ start)
+ stat_busy "Starting opentracker Daemon"
+ [ -z "$PID" ] && su nobody -s /bin/sh -c "/usr/bin/opentracker -f /etc/opentracker/config&"
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon opentracker
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping opentracker Daemon"
+ [ ! -z "$PID" ] && kill $PID &>/dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon opentracker
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac