aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2015-10-06 07:19:06 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2015-10-06 07:19:06 +0000
commitfc787e8f39e919ca99c1912a63642c4ee9947408 (patch)
tree5035e7c551afd4e222add87411793a0a58a153f6 /community
parente3c14b289b1ffb4d886227bbd00295afb23eb51b (diff)
downloadaports-fc787e8f39e919ca99c1912a63642c4ee9947408.tar.gz
aports-fc787e8f39e919ca99c1912a63642c4ee9947408.tar.bz2
aports-fc787e8f39e919ca99c1912a63642c4ee9947408.tar.xz
community/sniproxy: moved from main
Diffstat (limited to 'community')
-rw-r--r--community/sniproxy/APKBUILD68
-rw-r--r--community/sniproxy/sniproxy.conf26
-rw-r--r--community/sniproxy/sniproxy.initd19
-rw-r--r--community/sniproxy/sniproxy.logrotate9
-rw-r--r--community/sniproxy/sniproxy.pre-install4
5 files changed, 126 insertions, 0 deletions
diff --git a/community/sniproxy/APKBUILD b/community/sniproxy/APKBUILD
new file mode 100644
index 0000000000..d4ab3fd58c
--- /dev/null
+++ b/community/sniproxy/APKBUILD
@@ -0,0 +1,68 @@
+# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
+pkgname=sniproxy
+pkgver=0.4.0
+pkgrel=0
+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="sniproxy-$pkgver.tar.gz::https://github.com/dlundquist/$pkgname/archive/$pkgver.tar.gz
+ $pkgname.initd
+ $pkgname.conf
+ $pkgname.logrotate
+ "
+
+_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
+ install -Dm644 "$srcdir"/$pkgname.logrotate \
+ "$pkgdir"/etc/logrotate.d/$pkgname || return 1
+ for dir in /var/log /etc /var/run; do
+ mkdir -p "$pkgdir"/$dir/$pkgname
+ chown $pkgusers:$pkggroups "$pkgdir"/$dir/$pkgname
+ done
+}
+
+md5sums="5cf9afd2701f8c45157ea2a4557f5f0b sniproxy-0.4.0.tar.gz
+0b1f2078a3829df4754d99d5539b0e6c sniproxy.initd
+8f21930affabea377c0443059d94f3f7 sniproxy.conf
+636f8fe717a29983b910af1d730b22c9 sniproxy.logrotate"
+sha256sums="d842a428480c7cdd7354080869e4ed3c8bb35a6c1b2124ce832378119774e4d8 sniproxy-0.4.0.tar.gz
+6464fecf6011541014a4974b3e83cadc55114aeecc727574034c948d3eb00e77 sniproxy.initd
+23ee2894715f834f0708182e93cee30535bd0d58b5aa600a2b45b799deaf64e1 sniproxy.conf
+5b5bcb5f0e1639b455468755b9d6f733aa07d47fd55a35ab780700108740802e sniproxy.logrotate"
+sha512sums="a8f165a87fe0a9564e918d54237b7bb8ef5b5b6ced7d20ca2b52d46afd994925c007ebb955d7a9b2e4b35ece9c88ed585a5bf7c12fdbfd018c002ada9ca8421c sniproxy-0.4.0.tar.gz
+57f4997f8a96516b4622105c024708bf39002a83d7f3eb76dd857ee0202598309b51d585f6b25b5e72e9710b79c36a3e4f21bc2effcead16dd2c032137c704f3 sniproxy.initd
+f7423cfd48e9333d5db857b4eb61b747664221607e2d47a55167493159b7b838580f101427e98252468c0be9c42693f7f0689ac8bd1acdcd1dfb75638a8f49fb sniproxy.conf
+8c026af5ed23620776ef5a9a08f09236d30fc5152c9f95de2b95eb7ac48ad001c21010922d74dc7c78071f9e6ef8f794c2a59c11677d8e12be8d57e94bac2b5e sniproxy.logrotate"
diff --git a/community/sniproxy/sniproxy.conf b/community/sniproxy/sniproxy.conf
new file mode 100644
index 0000000000..7252e312f3
--- /dev/null
+++ b/community/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/community/sniproxy/sniproxy.initd b/community/sniproxy/sniproxy.initd
new file mode 100644
index 0000000000..0fcb5acf1a
--- /dev/null
+++ b/community/sniproxy/sniproxy.initd
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+
+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/community/sniproxy/sniproxy.logrotate b/community/sniproxy/sniproxy.logrotate
new file mode 100644
index 0000000000..f524c27a13
--- /dev/null
+++ b/community/sniproxy/sniproxy.logrotate
@@ -0,0 +1,9 @@
+/var/log/sniproxy/*.log {
+ daily
+ copytruncate
+ missingok
+ rotate 5
+ compress
+ notifempty
+ create 660 root sniproxy
+}
diff --git a/community/sniproxy/sniproxy.pre-install b/community/sniproxy/sniproxy.pre-install
new file mode 100644
index 0000000000..596dad6fb9
--- /dev/null
+++ b/community/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