summaryrefslogtreecommitdiff
path: root/community/tinyproxy
diff options
context:
space:
mode:
Diffstat (limited to 'community/tinyproxy')
-rw-r--r--community/tinyproxy/PKGBUILD36
-rwxr-xr-xcommunity/tinyproxy/tinyproxy54
2 files changed, 90 insertions, 0 deletions
diff --git a/community/tinyproxy/PKGBUILD b/community/tinyproxy/PKGBUILD
new file mode 100644
index 000000000..ec922d418
--- /dev/null
+++ b/community/tinyproxy/PKGBUILD
@@ -0,0 +1,36 @@
+# $Id: PKGBUILD 44216 2011-04-04 13:31:34Z lfleischer $
+# Maintainer: Lukas Fleischer <archlinux at cryptocrack dot de>
+# Contributor: Andrea Zucchelli <zukka77@gmail.com>
+
+pkgname=tinyproxy
+pkgver=1.8.2
+pkgrel=3
+pkgdesc='A light-weight HTTP proxy daemon for POSIX operating systems.'
+arch=('i686' 'x86_64')
+url='https://banu.com/tinyproxy/'
+license=('GPL')
+makedepends=('asciidoc')
+backup=('etc/tinyproxy/tinyproxy.conf')
+source=("https://banu.com/pub/${pkgname}/1.8/${pkgname}-${pkgver}.tar.bz2"
+ 'tinyproxy')
+md5sums=('edc8502193cfed4974d6a770da173755'
+ '464b5d60b1c9cbae26367fe2337c2d77')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ ./configure --prefix=/usr --sysconfdir=/etc/tinyproxy --localstatedir=/var
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make DESTDIR="${pkgdir}" install
+ install -Dm0755 "${srcdir}/tinyproxy" "${pkgdir}/etc/rc.d/tinyproxy"
+
+ install -dm0755 -o nobody -g nobody "${pkgdir}/var/log/${pkgname}"
+
+ # Provide sane defaults
+ sed -i '/^#Listen/a\Listen 127.0.0.1' "${pkgdir}/etc/tinyproxy/tinyproxy.conf"
+}
diff --git a/community/tinyproxy/tinyproxy b/community/tinyproxy/tinyproxy
new file mode 100755
index 000000000..86ba7b77c
--- /dev/null
+++ b/community/tinyproxy/tinyproxy
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=$(pidof -o %PPID /usr/sbin/tinyproxy)
+
+start() {
+ stat_busy "Starting Tinyproxy"
+
+ if [ ! -d /var/run/tinyproxy ]; then
+ mkdir -p /var/run/tinyproxy && chown nobody:nobody /var/run/tinyproxy
+ fi
+
+ [ -z "$PID" ] && rm -f /var/run/tinyproxy.pid && \
+ /usr/sbin/tinyproxy -c /etc/tinyproxy/tinyproxy.conf 2>/dev/null
+
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon tinyproxy
+ stat_done
+ fi
+}
+
+stop() {
+ stat_busy "Stopping Tinyproxy"
+
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon tinyproxy
+ stat_done
+ fi
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0