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

From: [email-masked]
Date: Mon, 22 Feb 2016 13:43:26 +0000

From: Konstantin Shcherban <[email-masked]>

https://github.com/gdnsd/gdnsd/
Geographic Authoritative DNS server
---
 testing/gdnsd/APKBUILD          | 56 +++++++++++++++++++++++++++++++++++++++++
 testing/gdnsd/gdnsd.initd       | 46 +++++++++++++++++++++++++++++++++
 testing/gdnsd/gdnsd.pre-install |  5 ++++
 3 files changed, 107 insertions(+)
 create mode 100644 testing/gdnsd/APKBUILD
 create mode 100755 testing/gdnsd/gdnsd.initd
 create mode 100644 testing/gdnsd/gdnsd.pre-install

diff --git a/testing/gdnsd/APKBUILD b/testing/gdnsd/APKBUILD
new file mode 100644
index 0000000..fbd1bb5
--- /dev/null
+++ b/testing/gdnsd/APKBUILD
@@ -0,0 +1,56 @@
+# Contributor: Natanael Copa <[email-masked]>
+# Maintainer: Timo Teräs <[email-masked]>
+pkgname=gdnsd
+pkgver=2.2.2
+pkgrel=1
+pkgdesc="Geographic Authoritative DNS server"
+url="https://github.com/gdnsd/gdnsd/"
+arch="all"
+license="GPL3"
+depends=""
+depends_dev=""
+makedepends="userspace-rcu-dev libev-dev libcap-dev ragel autoconf automake libtool"
+install="$pkgname.pre-install"
+subpackages="$pkgname-dev $pkgname-doc"
+source="saveas-https://github.com/blblack/gdnsd/archive/v$pkgver.tar.gz/gdnsd-$pkgver.tar.gz
+	gdnsd.initd"
+
+_builddir="$srcdir"/gdnsd-$pkgver
+prepare() {
+	local i
+	cd "$_builddir"
+	for i in $source; do
+		case $i in
+		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
+	autoreconf -vif
+}
+
+build() {
+	cd "$_builddir"
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--prefix=/usr \
+		--sysconfdir=/etc \
+		--localstatedir=/var \
+		--enable-fast-install \
+		|| return 1
+	make || return 1
+	install -Dm755 "$srcdir"/gdnsd.initd \
+		"$pkgdir"/etc/init.d/gdnsd || return 1
+}
+
+package() {
+	cd "$_builddir"
+	make DESTDIR="$pkgdir" install || return 1
+        install -Dm755 "$srcdir"/gdnsd.initd \
+		"$pkgdir"/etc/init.d/gdnsd || return 1
+}
+md5sums="67714ffdd04c6c15bc5f9dc492794b80  gdnsd-2.2.2.tar.gz
+ddb2591fdeac1c0c0f04f6d7c6e0af2c  gdnsd.initd"
+sha256sums="e951f29f2710886f2bec089a34acb2857c000eb90565a70b2b96b94534b9c3eb  gdnsd-2.2.2.tar.gz
+f6304d3dc49cced580ad30f450887d3daaa98685b901332b62b8c6ec9798ce99  gdnsd.initd"
+sha512sums="056f4976fb5e0ae7b7cef649e0b7be43fbcf85331781240c63b508367aa71d32c2cd2e12075fd520738ab313366cdd3bf79edd86950993e8fa2274f6a3ee64b0  gdnsd-2.2.2.tar.gz
+9abfeb63156828f98b9a96ddb51c3828311331e56c98f17f0a3bdbd261d351549aef55c6cbcf351fdf2ac0a22f2be7b8e8930e3a0d89d74b6b5bec90bc422f16  gdnsd.initd"
diff --git a/testing/gdnsd/gdnsd.initd b/testing/gdnsd/gdnsd.initd
new file mode 100755
index 0000000..7a4c2ee
--- /dev/null
+++ b/testing/gdnsd/gdnsd.initd
@@ -0,0 +1,46 @@
+#!/sbin/openrc-run
+
+name="gdnsd daemon"
+extra_commands="configtest"
+extra_started_commands="reload fastrestart"
+description="Geographic Authoritative DNS server"
+description_configtest="Run syntax tests for configuration files only."
+description_reload="Signal running gdnsd to reload configuration files"
+description_fastrestart="Optimized restart sequence (minimizes down time)"
+
+
+depend() {
+	need net
+	use logger
+	after firewall
+	provide auth-dns
+}
+
+act() {
+	ebegin "$1 ${SVCNAME}"
+	/usr/sbin/gdnsd $2
+	eend $?
+}
+
+configtest() {
+	act "Checking configuration" checkconf
+}
+
+start() {
+	act "Starting" start
+}
+
+stop () {
+	if [ "${RC_CMD}" = "restart" ]; then
+		configtest || return 1
+	fi
+	act "Stopping" stop
+}
+
+restart() {
+	act "Restarting" restart
+}
+
+reload-zones() {
+	act "Reloading" reload-zones
+}
diff --git a/testing/gdnsd/gdnsd.pre-install b/testing/gdnsd/gdnsd.pre-install
new file mode 100644
index 0000000..dc6e44b
--- /dev/null
+++ b/testing/gdnsd/gdnsd.pre-install
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+addgroup gdnsd 2>/dev/null
+adduser -S -H -h /dev/null -s /sbin/nologin -D -G gdnsd gdnsd 2>/dev/null
+exit 0
-- 
2.6.4

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