aboutsummaryrefslogtreecommitdiffstats
path: root/community/knot
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2016-08-22 08:05:26 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2016-08-22 08:12:51 +0000
commit1b54ef361d3f88a6303bdc6f034c427d3fc340cd (patch)
tree8601d0a539998f6deda00baac6c219fbb0e72107 /community/knot
parentf735580871e2f3203fbc3acc12e330ae4a09bbe8 (diff)
downloadaports-1b54ef361d3f88a6303bdc6f034c427d3fc340cd.tar.bz2
aports-1b54ef361d3f88a6303bdc6f034c427d3fc340cd.tar.xz
community/know: moved from testing, upgrade to 2.3.0
Diffstat (limited to 'community/knot')
-rw-r--r--community/knot/APKBUILD72
-rw-r--r--community/knot/knot.post-install10
-rw-r--r--community/knot/knot.pre-install6
-rw-r--r--community/knot/knotd.confd1
-rw-r--r--community/knot/knotd.initd36
5 files changed, 125 insertions, 0 deletions
diff --git a/community/knot/APKBUILD b/community/knot/APKBUILD
new file mode 100644
index 0000000000..7684ad831e
--- /dev/null
+++ b/community/knot/APKBUILD
@@ -0,0 +1,72 @@
+# Contributor: Francesco Colista <fcolista@alpinelinux.org>
+# Contributor: Dennis Przytarski <dennis@przytarski.com>
+# Contributor: Francesco Zanini <francesco@zanini.me>
+# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
+pkgname=knot
+pkgver=2.3.0
+pkgrel=0
+pkgdesc="An high-performance authoritative-only DNS server"
+url="https://www.knot-dns.cz"
+arch="all"
+license="GPL3"
+options=""
+depends=""
+depends_dev="gnutls-dev libedit-dev jansson-dev libcap-ng-dev
+ libidn-dev openssl-dev userspace-rcu-dev zlib-dev"
+makedepends="$depends_dev m4 bison flex perl libtool"
+install="$pkgname.pre-install $pkgname.post-install"
+pkgusers="knot"
+pkggroups="knot"
+subpackages="$pkgname-dev $pkgname-doc"
+source="https://secure.nic.cz/files/knot-dns/${pkgname}-${pkgver}.tar.xz
+ knotd.confd
+ knotd.initd
+ "
+_builddir="$srcdir"/$pkgname-$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
+}
+
+build() {
+ cd "$_builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --libexecdir=/usr/lib/knot \
+ --with-rundir=/var/run/knot \
+ --with-storage=/var/lib/knot \
+ --disable-silent-rules \
+ || return 1
+ make || return 1
+ make check || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="${pkgdir}" install || return 1
+ install -Dm 644 "${srcdir}/knotd.confd" "${pkgdir}/etc/conf.d/knotd"
+ install -Dm 755 "${srcdir}/knotd.initd" "${pkgdir}/etc/init.d/knotd"
+ chown $pkgusers:$pkggroups "${pkgdir}"/var/lib/$pkgname
+ chmod 750 "${pkgdir}"/var/lib/$pkgname
+ chown $pkgusers:$pkggroups "${pkgdir}"/var/run/$pkgname
+ chmod 750 "${pkgdir}"/var/run/$pkgname
+}
+
+md5sums="7ca754f972fb07faa4f30e50d8a4385b knot-2.3.0.tar.xz
+66f3111080662280d95bc928d6ca92d5 knotd.confd
+5bdbc22866a28caae068e65d53916915 knotd.initd"
+sha256sums="8abf9a6562ecf2f7f4222d16ca6c75463399870db360eda7caa40530b469533c knot-2.3.0.tar.xz
+ff384d428c9e67139ed21b0c78eabf6a26d96f31775f6143ce0c4f9c4f6beaf3 knotd.confd
+c7690f1c4f748f436faa9e305ecbbb3d05e5cc50493eb10ca92bc73365578428 knotd.initd"
+sha512sums="28f0f6a00af3feb95ebd9af0c324ffeff1093f8e74136ce81f5a6e7f4434f22b9e371715b4b116de9b8faf39776be4d943c2ae09fb786e6061cc0394a767e8b6 knot-2.3.0.tar.xz
+471d3c639a8235ba09491c99d36c0a4f1074d6055ccfd3807be02a30d3ed5bbe69a84f0414ea7810db6bbc1e38f5837108e5744fc59f949ed78a262a7de4597e knotd.confd
+b6cd5b52ba65f9726164b21003fe0a0fc54f4f51aa7bbbcfd5b83aa4466e5224567a26c9c8ede13ac6a8090706e975e3220456112b20eb45304c9d92be7fb3d3 knotd.initd"
diff --git a/community/knot/knot.post-install b/community/knot/knot.post-install
new file mode 100644
index 0000000000..179e5fc92a
--- /dev/null
+++ b/community/knot/knot.post-install
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+echo "*" >&2
+echo "* Before running knot, you must create a knot.conf file." >&2
+echo "* There is an example in the /etc/knot directory." >&2
+echo "* You can rename the example file and make the necessary adjustment." >&2
+echo "*" >&2
+
+exit 0
+
diff --git a/community/knot/knot.pre-install b/community/knot/knot.pre-install
new file mode 100644
index 0000000000..6fc6e21461
--- /dev/null
+++ b/community/knot/knot.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S knot 2>/dev/null
+adduser -S -D -H -s /sbin/nologin -G knot -g knot knot 2>/dev/null
+
+exit 0
diff --git a/community/knot/knotd.confd b/community/knot/knotd.confd
new file mode 100644
index 0000000000..f7a0c2a47c
--- /dev/null
+++ b/community/knot/knotd.confd
@@ -0,0 +1 @@
+KNOTD_OPTS=""
diff --git a/community/knot/knotd.initd b/community/knot/knotd.initd
new file mode 100644
index 0000000000..49309869e5
--- /dev/null
+++ b/community/knot/knotd.initd
@@ -0,0 +1,36 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-dns/knot/files/knot.init,v 1.2 2013/08/21 09:23:59 scarabeus Exp $
+
+name="knotd"
+command="/usr/sbin/knotd"
+command_args="-d ${KNOTD_OPTS}"
+start_stop_daemon_args="--wait 5"
+required_files=/etc/knot/knot.conf
+extra_started_commands="reload"
+description_reload="Reload configuration and changed zones"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -d -m 0750 -o knot:knot /var/run/knot/ /var/lib/knot/
+}
+
+stop() {
+ ebegin "Stopping ${name}"
+ /usr/sbin/knotc stop >/dev/null 2>&1
+ # Mark service as stopped if remote control was successful
+ if [ 0 -eq $? ]; then
+ start-stop-daemon --stop --quiet --pidfile /var/run/knot/knot.pid
+ fi
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading knot"
+ /usr/sbin/knotc reload >/dev/null
+ eend $?
+}