Subject: [alpine-aports] [PATCH] testing/3proxy: new aport

From: sillysausage <[email-masked]>
Date: Sat, 28 Nov 2015 22:39:54 +1030

http://3proxy.ru/
Really tiny cross-platform proxy servers set.
---
 testing/3proxy/3proxy.initd       | 29 +++++++++++++++++++++
 testing/3proxy/3proxy.pre-install |  6 +++++
 testing/3proxy/APKBUILD           | 55 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 90 insertions(+)
 create mode 100644 testing/3proxy/3proxy.initd
 create mode 100644 testing/3proxy/3proxy.pre-install
 create mode 100644 testing/3proxy/APKBUILD

diff --git a/testing/3proxy/3proxy.initd b/testing/3proxy/3proxy.initd
new file mode 100644
index 0000000..5c55b05
--- /dev/null
+++ b/testing/3proxy/3proxy.initd
@@ -0,0 +1,29 @@
+#!/sbin/runscript
+#
+# Start 3proxy tiny proxy server.
+#
+
+CONFFILE=/etc/${SVCNAME}/${SVCNAME}.cfg
+PIDFILE=/var/run/${SVCNAME}.pid
+
+depend() {
+	need net
+}
+
+start() {
+	if [ ! -f "${CONFFILE}" ]; then
+		eerror "Configuration file ${CONFFILE} not found!"
+		return 1
+	fi
+
+	ebegin "Starting 3proxy"
+	start-stop-daemon --start --quiet --exec /usr/bin/3proxy --pidfile "${PIDFILE}" \
+		-- --pidfile "${PIDFILE}" --user 3proxy.3proxy "${CONFFILE}" #2>/dev/null
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping 3proxy"
+	start-stop-daemon --stop --quiet --pidfile "${PIDFILE}"
+	eend $?
+}
diff --git a/testing/3proxy/3proxy.pre-install b/testing/3proxy/3proxy.pre-install
new file mode 100644
index 0000000..b1e227a
--- /dev/null
+++ b/testing/3proxy/3proxy.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup 3proxy 2>/dev/null
+adduser -S -G 3proxy -h /var/log/3proxy -s /sbin/nologin -D 3proxy 2>/dev/null
+exit 0
+
diff --git a/testing/3proxy/APKBUILD b/testing/3proxy/APKBUILD
new file mode 100644
index 0000000..775d934
--- /dev/null
+++ b/testing/3proxy/APKBUILD
@@ -0,0 +1,55 @@
+# Contributor: sillysausage <[email-masked]>
+# Maintainer:
+pkgname=3proxy
+pkgver=0.7.1.3
+pkgrel=0
+pkgdesc="Really tiny cross-platform proxy servers set"
+url="http://3proxy.ru"
+arch="all"
+license="3proxy"
+pkgusers="3proxy"
+pkggroups="3proxy"
+depends=
+makedepends="linux-headers"
+install="3proxy.pre-install"
+subpackages="$pkgname-doc"
+source="https://github.com/z3APA3A/$pkgname/archive/$pkgname-$pkgver.tar.gz
+        $pkgname.initd"
+
+_builddir=$srcdir/$pkgname-$pkgname-$pkgver
+
+prepare() {
+	cd "$srcdir/$pkgname-$pkgname-$pkgver"
+	for i in $source; do
+		case $i in
+		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
+}
+
+build() {
+	cd "$_builddir"
+	make -f Makefile.Linux prefix="/usr" || return 1
+}
+
+package() {
+	cd "$_builddir"
+	make -f Makefile.Linux DESTDIR="$pkgdir" prefix="/usr" install || return 1
+	install -Dm755 "$srcdir"/3proxy.initd "$pkgdir"/etc/init.d/3proxy || return 1
+	mv "$pkgdir"/usr/etc/3proxy "$pkgdir"/etc/3proxy || return 1
+	chown -R 3proxy:3proxy "$pkgdir"/etc/3proxy || return 1
+	install -Dm644 copying "$pkgdir"/usr/share/licenses/$pkgname/COPYING || return 1
+	
+}
+
+doc() {
+	mkdir -p "$subpkgdir"/usr/share || return 1
+	mv "$pkgdir"/usr/share/licenses "$subpkgdir"/usr/share/licenses || return 1
+	mv "$pkgdir"/usr/share/man "$subpkgdir"/usr/share/man || return 1
+}
+md5sums="4754d5cf7071db9eb8013bbd739836f8  3proxy-0.7.1.3.tar.gz
+debcf0b8c2a6827e438ad3addec5fbc4  3proxy.initd"
+sha256sums="4d1f3cf539c8a32f5845b54e8a3fdbabef6fe8a6bbb06dfc80f7361804f6cb60  3proxy-0.7.1.3.tar.gz
+b7837c5817cbb45a96c92fa119ba623f3a1a5ca6849dfd85518bbea163baefe8  3proxy.initd"
+sha512sums="d72e5ca79a55ad9cde6c9becfc1674aa7a38fb52ee73b479aee8747d52bb9966c8cf73f348f2a2c8319afcbedb9e7ba8bea485a785204d7ee1a9ab21e3a1d9ef  3proxy-0.7.1.3.tar.gz
+5425792d0babc75221b5a35996a1fa47a6d0b9a435edde7b63e0344b7d58ab96b18f1c5fb28e798df36cb342d9793d530dbcdd0102cc5fb04a70ca525c924576  3proxy.initd"
-- 
2.4.1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---