diff options
author | Leonardo Arena <rnalrd@alpinelinux.org> | 2015-03-27 07:47:54 +0000 |
---|---|---|
committer | Leonardo Arena <rnalrd@alpinelinux.org> | 2015-03-27 07:48:00 +0000 |
commit | 988c6a37d6cecd49029f81d727ad65b8b15eeb7f (patch) | |
tree | 42ce4735403e329ccbc1f037c30c232935fdb7b5 /main | |
parent | 2d684f542e8d85e64165d4d0345bef89ad9dbe5b (diff) | |
download | aports-988c6a37d6cecd49029f81d727ad65b8b15eeb7f.tar.bz2 aports-988c6a37d6cecd49029f81d727ad65b8b15eeb7f.tar.xz |
testing/sniproxy: move to main
Diffstat (limited to 'main')
-rw-r--r-- | main/sniproxy/APKBUILD | 63 | ||||
-rw-r--r-- | main/sniproxy/sniproxy.conf | 26 | ||||
-rw-r--r-- | main/sniproxy/sniproxy.initd | 19 | ||||
-rw-r--r-- | main/sniproxy/sniproxy.pre-install | 4 |
4 files changed, 112 insertions, 0 deletions
diff --git a/main/sniproxy/APKBUILD b/main/sniproxy/APKBUILD new file mode 100644 index 0000000000..a119e287f5 --- /dev/null +++ b/main/sniproxy/APKBUILD @@ -0,0 +1,63 @@ +# Contributor: Leonardo Arena <rnalrd@alpinelinux.org> +# Maintainer: +pkgname=sniproxy +pkgver=0.3.6 +pkgrel=3 +pkgdesc="Proxies incoming HTTP and TLS connections based on the hostname + contained in the initial request of the TCP session." +url="https://github.com/dlundquist/sniproxy" +arch="all" +license="GPL" +depends= +depends_dev= +makedepends="$depends_dev autoconf automake bsd-compat-headers gettext-dev + libev-dev libtool pcre-dev udns-dev + " +install="${pkgname}.pre-install" +subpackages="$pkgname-doc" +pkgusers="sniproxy" +pkggroups="sniproxy" +source="https://github.com/dlundquist/$pkgname/archive/$pkgver.tar.gz + $pkgname.initd + $pkgname.conf + " + +_builddir="$srcdir"/$pkgname-$pkgver + +prepare() { + cd "$_builddir" + # apply patches here +} + +build() { + cd "$_builddir" + ./autogen.sh && ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install || return 1 + install -Dm755 "$srcdir"/$pkgname.initd \ + "$pkgdir"/etc/init.d/$pkgname || return 1 + install -Dm644 "$srcdir"/$pkgname.conf \ + "$pkgdir"/etc/$pkgname/$pkgname.conf || return 1 + for dir in /var/log /etc /var/run; do + mkdir -p "$pkgdir"/$dir/$pkgname + chown $pkgusers:$pkggroups "$pkgdir"/$dir/$pkgname + done +} + +md5sums="52a01eb55ac7712de2dd13f1ba6260e4 0.3.6.tar.gz +05affd59cfc21d9c9cad78fc886c075b sniproxy.initd +8f21930affabea377c0443059d94f3f7 sniproxy.conf" +sha256sums="90183ea5a380f1f946a9e0286334c916c2315bf005677ddc72f0afeed84a544c 0.3.6.tar.gz +8ecb624c3a12fa73980cd66d043b96cc31f34da20e1ed6ad060f832f49f897a0 sniproxy.initd +23ee2894715f834f0708182e93cee30535bd0d58b5aa600a2b45b799deaf64e1 sniproxy.conf" +sha512sums="5d2a3b181c3a710a5443c21d3c6181354e473c134e99a258b4d10dc452d449507d057ef65ad0586ecc43800b271fc03635f3d27a043855846248ca14e807781c 0.3.6.tar.gz +e4a39bcaf3a0766fda3087c512c7838835c4bb2990fa3cf334c5def0ae009fbf72fff004cf7aa3a89a32f3bf47f29424cc571efc1df11109166adac94b78eb56 sniproxy.initd +f7423cfd48e9333d5db857b4eb61b747664221607e2d47a55167493159b7b838580f101427e98252468c0be9c42693f7f0689ac8bd1acdcd1dfb75638a8f49fb sniproxy.conf" diff --git a/main/sniproxy/sniproxy.conf b/main/sniproxy/sniproxy.conf new file mode 100644 index 0000000000..7252e312f3 --- /dev/null +++ b/main/sniproxy/sniproxy.conf @@ -0,0 +1,26 @@ +user sniproxy +pidfile /var/run/sniproxy/sniproxy.pid + +error_log { + filename /var/log/sniproxy/error.log + priority notice +} + +listener 127.0.0.1 80 { + proto http + access_log { + filename /var/log/sniproxy/access.log + } +} + +listener 127.0.0.1 443 { + proto tls + access_log { + filename /var/log/sniproxy/access.log + } +} + +table { + mydomain\.com * +} + diff --git a/main/sniproxy/sniproxy.initd b/main/sniproxy/sniproxy.initd new file mode 100644 index 0000000000..fcaa28c697 --- /dev/null +++ b/main/sniproxy/sniproxy.initd @@ -0,0 +1,19 @@ +#!/sbin/runscript + +pidfile="/var/run/${SVCNAME}/${SVCNAME}.pid" +command="/usr/sbin/${SVCNAME}" +: ${conf_file:="/etc/sniproxy/sniproxy.conf"} + +depend() { + need net + after firewall +} + +start() { + ebegin "Starting $SVCNAME" + start-stop-daemon --start \ + --quiet --pidfile $pidfile --exec $command \ + -- -c "$conf_file" "$@" + eend +} + diff --git a/main/sniproxy/sniproxy.pre-install b/main/sniproxy/sniproxy.pre-install new file mode 100644 index 0000000000..596dad6fb9 --- /dev/null +++ b/main/sniproxy/sniproxy.pre-install @@ -0,0 +1,4 @@ +#!/bin/sh +addgroup -S sniproxy 2>/dev/null +adduser -h /var/log/sniproxy -s /bin/false -S -D sniproxy 2>/dev/null +exit 0 |