summaryrefslogtreecommitdiffstats
path: root/main/tinyproxy
diff options
context:
space:
mode:
Diffstat (limited to 'main/tinyproxy')
-rw-r--r--main/tinyproxy/APKBUILD40
-rw-r--r--main/tinyproxy/tinyproxy.initd45
-rwxr-xr-xmain/tinyproxy/tinyproxy.post-install6
-rwxr-xr-xmain/tinyproxy/tinyproxy.pre-install6
4 files changed, 97 insertions, 0 deletions
diff --git a/main/tinyproxy/APKBUILD b/main/tinyproxy/APKBUILD
new file mode 100644
index 000000000..046daa830
--- /dev/null
+++ b/main/tinyproxy/APKBUILD
@@ -0,0 +1,40 @@
+# Contributor: Michael Mason <ms13sp@gmail.com>
+# Maintainer: Michael Mason <ms13sp@gmail.com>
+pkgname=tinyproxy
+pkgver=1.6.3
+pkgrel=0
+pkgdesc="Lightweight HTTP proxy"
+url="https://www.banu.com/tinyproxy/"
+license="GPL"
+depends="uclibc"
+makedepends=""
+install="tinyproxy.install"
+subpackages="$pkgname-doc"
+source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
+ tinyproxy.initd
+ $install
+ "
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ # set default user to tinyproxy:tinyproxy and correct pidfile
+ sed -i -e 's:^User.*:User tinyproxy:' \
+ -e 's:^Group.*:Group tinyproxy:' \
+ -e 's:^PidFile.*:PidFile "/var/run/tinyproxy/tinyproxy.pid":' \
+ doc/tinyproxy.conf
+
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info
+
+ make || return 1
+ make DESTDIR="$pkgdir" install
+ mkdir -p "$pkgdir"/var/run/tinyproxy
+ install -Dm755 "$srcdir"/tinyproxy.initd "$pkgdir"/etc/init.d/tinyproxy
+}
+
+md5sums="bd14d029b12621bcfd7ee71b2f4893da tinyproxy-1.6.3.tar.gz
+554da6fc363fbe251f081b342541bef4 tinyproxy.initd
+2f5d9f4a8b7f4c7f1f5b9d59d99839e4 tinyproxy.install"
diff --git a/main/tinyproxy/tinyproxy.initd b/main/tinyproxy/tinyproxy.initd
new file mode 100644
index 000000000..bee5d041f
--- /dev/null
+++ b/main/tinyproxy/tinyproxy.initd
@@ -0,0 +1,45 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-proxy/tinyproxy/files/tinyproxy.initd,v 1.1 2008/02/16 07:11:25 mrness Exp $
+
+CONFFILE="/etc/tinyproxy/${SVCNAME}.conf"
+
+depend() {
+ use logger dns
+ need net
+}
+
+checkconfig() {
+ if [ ! -f "${CONFFILE}" ]; then
+ eerror "Configuration file ${CONFFILE} not found!"
+ return 1
+ fi
+
+ PIDFILE=$(sed -n -e 's/^[[:space:]]*PidFile[[:space:]]\+"\(.*\)"[[:space:]]*$/\1/p' "${CONFFILE}")
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting tinyproxy"
+ if [ -n "${PIDFILE}" ]; then
+ start-stop-daemon --start --pidfile "${PIDFILE}" --startas /usr/sbin/tinyproxy -- -c "${CONFFILE}"
+ else
+ start-stop-daemon --start --exec /usr/sbin/tinyproxy -- -c "${CONFFILE}"
+ fi
+ eend $?
+}
+
+stop() {
+ checkconfig || return 1
+
+ ebegin "Stopping tinyproxy"
+ if [ -n "${PIDFILE}" ]; then
+ start-stop-daemon --stop --pidfile "${PIDFILE}"
+ else
+ start-stop-daemon --stop --exec /usr/sbin/tinyproxy
+ fi
+ eend $?
+}
diff --git a/main/tinyproxy/tinyproxy.post-install b/main/tinyproxy/tinyproxy.post-install
new file mode 100755
index 000000000..ef518c616
--- /dev/null
+++ b/main/tinyproxy/tinyproxy.post-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+chown tinyproxy:tinyproxy /var/run/tinyproxy
+
+# return with success even if user already exist
+exit 0
diff --git a/main/tinyproxy/tinyproxy.pre-install b/main/tinyproxy/tinyproxy.pre-install
new file mode 100755
index 000000000..d324b044e
--- /dev/null
+++ b/main/tinyproxy/tinyproxy.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+adduser -h /dev/null -s /bin/false -D tinyproxy 2>/dev/null
+
+# return with success even if user already exist
+exit 0