diff options
author | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
---|---|---|
committer | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
commit | 415856bdd4f48ab4f2732996f0bae58595092bbe (patch) | |
tree | ede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/dante |
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/dante')
-rw-r--r-- | community/dante/PKGBUILD | 38 | ||||
-rwxr-xr-x | community/dante/sockd.rc | 68 |
2 files changed, 106 insertions, 0 deletions
diff --git a/community/dante/PKGBUILD b/community/dante/PKGBUILD new file mode 100644 index 000000000..176fdafa7 --- /dev/null +++ b/community/dante/PKGBUILD @@ -0,0 +1,38 @@ +# $Id: PKGBUILD 42958 2011-03-22 21:15:35Z spupykin $ +# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Contributor: Guillem Rieu <guillemr@gmx.net> + +pkgname=dante +pkgver=1.2.3 +pkgrel=1 +pkgdesc="SOCKS v4 and v5 compatible proxy server and client" +url="http://www.inet.no/dante" +arch=(i686 x86_64) +license=('custom') +depends=('tcp_wrappers' 'pam') +backup=('etc/socks.conf' + 'etc/sockd.conf') +options=(!libtool) +source=(ftp://ftp.inet.no/pub/socks/${pkgname}-${pkgver}.tar.gz + sockd.rc) +md5sums=('b2874e53f5d8fe418cd40cb829536669' + '5110dfd78a2b38fff27a886ee88b58a6') + +build() { + cd ${srcdir}/${pkgname}-${pkgver} + + [ $NOEXTRACT -eq 1 ] || ./configure --prefix=/usr --sysconfdir=/etc + make + make DESTDIR=${pkgdir} install + + # Config files + mkdir -p ${pkgdir}/etc/conf.d + cp example/{socks,sockd}.conf ${pkgdir}/etc + + # License + install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE + + # rc-script + install -D -m755 ${srcdir}/sockd.rc ${pkgdir}/etc/rc.d/sockd + echo 'SOCKD_OPTS="-D"' >${pkgdir}/etc/conf.d/sockd.conf +} diff --git a/community/dante/sockd.rc b/community/dante/sockd.rc new file mode 100755 index 000000000..00ea5a7d4 --- /dev/null +++ b/community/dante/sockd.rc @@ -0,0 +1,68 @@ +#!/bin/bash + +daemon_name=sockd + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/sockd.conf + +get_pid() { + cat /var/run/sockd.pid 2>/dev/null +} + +case "$1" in + start) + stat_busy "Starting $daemon_name daemon" + + PID=$(get_pid) + if [ -z "$PID" ]; then + [ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid + # RUN + $daemon_name $SOCKD_OPTS 1>/dev/null 2>/dev/null + # + if [ $? -gt 0 ]; then + stat_fail + exit 1 + else + echo $(get_pid) > /var/run/$daemon_name.pid + add_daemon $daemon_name + stat_done + fi + else + stat_fail + exit 1 + fi + ;; + + stop) + stat_busy "Stopping $daemon_name daemon" + PID=$(get_pid) + # KILL + [ ! -z "$PID" ] && kill $PID &> /dev/null + # + if [ $? -gt 0 ]; then + stat_fail + exit 1 + else + rm -f /var/run/$daemon_name.pid &> /dev/null + rm_daemon $daemon_name + stat_done + fi + ;; + + restart) + $0 stop + sleep 3 + $0 start + ;; + + status) + stat_busy "Checking $daemon_name status"; + ck_status $daemon_name + ;; + + *) + echo "usage: $0 {start|stop|restart|status}" +esac + +exit 0 |