aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testing/gdnsd/APKBUILD56
-rwxr-xr-xtesting/gdnsd/gdnsd.initd46
-rw-r--r--testing/gdnsd/gdnsd.pre-install5
3 files changed, 107 insertions, 0 deletions
diff --git a/testing/gdnsd/APKBUILD b/testing/gdnsd/APKBUILD
new file mode 100644
index 0000000000..b083811d64
--- /dev/null
+++ b/testing/gdnsd/APKBUILD
@@ -0,0 +1,56 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Timo Teräs <timo.teras@iki.fi>
+pkgname=gdnsd
+pkgver=2.2.2
+pkgrel=0
+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 0000000000..7a4c2ee5f7
--- /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 0000000000..dc6e44b9cb
--- /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