summaryrefslogtreecommitdiff
path: root/net-dns/knot
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-dns/knot
reinit the tree, so we can have metadata
Diffstat (limited to 'net-dns/knot')
-rw-r--r--net-dns/knot/Manifest14
-rw-r--r--net-dns/knot/files/2.5.3-link-with-libatomic.patch117
-rw-r--r--net-dns/knot/files/knot-1.service17
-rw-r--r--net-dns/knot/files/knot.init41
-rw-r--r--net-dns/knot/files/knot.service14
-rw-r--r--net-dns/knot/knot-2.4.5.ebuild78
-rw-r--r--net-dns/knot/knot-2.5.3-r1.ebuild105
-rw-r--r--net-dns/knot/knot-2.5.3.ebuild77
-rw-r--r--net-dns/knot/knot-2.5.4.ebuild101
-rw-r--r--net-dns/knot/metadata.xml56
10 files changed, 620 insertions, 0 deletions
diff --git a/net-dns/knot/Manifest b/net-dns/knot/Manifest
new file mode 100644
index 000000000000..8974ddbbc3a5
--- /dev/null
+++ b/net-dns/knot/Manifest
@@ -0,0 +1,14 @@
+AUX 2.5.3-link-with-libatomic.patch 3837 SHA256 a615313865f527af1ef3e1fe8aaf272b77d80b3c33a2500edf7330cffd28f422 SHA512 8e3eac0cce77971a5c2357cc9fc8729f072363fcd160f5dec8ceb1b4b5ed938826bcfbabc7b78f81f21ff4b95aa38dcfc887470242589dd7684e79820a83a01a WHIRLPOOL 82216a015131ee04f21581b5e86afff1b40d44f4fac1f4898d2e0503f39cf81fd88c2a2e34a2da8b2ff98df48f5c717ee32ebcec2b932141d9120a1a90432284
+AUX knot-1.service 337 SHA256 5140fd96b54c3ecf79e9f386ce27159fa5c9d85c60fea11eb3d46a1b98e17b1d SHA512 58c4186e57ebd00b86dae34d5d208ed8801c0376da40cccb23b3d4542a7ee04a1003a12a4b89347b76a384b50eae4a61f96164bf22ec987ce05b1c65691659e7 WHIRLPOOL 03d9fd28f19d7c4a5a17fce6944560e01a4f95dc67a6a6385900f407c638b13c6f2908c619e652a7cfa08cea823bccc39de7cd939c152811a05240b14751192c
+AUX knot.init 861 SHA256 ec5c5aef42aaf7b0e47be6ea7dd94abdb38605f6e64b251184e381e2d490daf3 SHA512 e5faa96cbee618e9042bdfd0628f06c4bc4d23c7295521771e16f6eae715835a240799e8425317b03b1ea162966defb5d6b6592139cb1d9d61b47a24961ec9b9 WHIRLPOOL 5c102cf9ca93757a98be1e41f04027b6072b27e3e5e55d24c26040c94bcf6ac96cf5684ba639d3c65f9f46745a50981ac28a40bd50d432f04f83c5f84217ab60
+AUX knot.service 275 SHA256 3b091f61652f7d91189659e1d297e5ead76c79f4b0515c9eb4c7f054894e6810 SHA512 37c4700320a2781aa93ca92bc2634c3e080c87337b7d632d0e2fa23f6e2e8fa1985d1d8e2516fed02b612da4d340472d5f8d0ae37c5b323ac17bbd61ca243a86 WHIRLPOOL 39623f669bf141e785b630cd5caa71f47e67d6aa923cbfda074a4644faf83f05214484d133618a2c3731342f5bb44ef942d7559f36e7e2cade3c2318e8461dcb
+DIST knot-2.4.5.tar.xz 1111536 SHA256 87ce8ccc83511c5a1f4eadd3f0122f2f5ae86fb68e9b72f0700c6f5340ba95cb SHA512 db4919dbe2dc688f401e6611d784d47e1d40a0f8ec8c8cd6240d89ab9dd2ce7dd1976ac7cb24c712ed8aa074e0026ff0a10e9d6d5e685929d271ae554d9a1cff WHIRLPOOL cdfdf0bc2591df8436f8ab0959581129cb1a4d86138f6bb75b507d83280c7d567eb794e3b76b8374d4087721de53e4afd7566411b8e51fa2655e9e5462357ef4
+DIST knot-2.5.3.tar.xz 1073372 SHA256 d78ae231a68ace264f5738c8e57481923bcad7413f3f440c06fa6cc0aded9d8e SHA512 c93bfdd42c3f1e5b74de7a5bb46841bee75d5153b4c72eb876f11e193a290484620ea8f877bd039c40fc665a9d5d07905a712e8e085c3267da5db5208aa71f08 WHIRLPOOL c6fa2cd7dde2cd0ee54a7fc68fdd441d6af03777c788adaf2534bc944a0a5f8f0445b2cc1f80502c905e1f55baf0f65db37b66a097e46ec9fa0c960767398278
+DIST knot-2.5.4.tar.xz 1071596 SHA256 3fde76e9084b75df374709cb73a8289f77c6a95b7ccff8584d7423566faa24f0 SHA512 8b41a1ef0f9633815c38267130eba8c30c8c543ad6d74e0f63db42975d419938aa9cf4a921a7af966944fbd582f0e1364c6a05c79bc01a19674ed7ce0e66ef30 WHIRLPOOL 2f26b03837c59fb28294d6fabd658fef2527bbe118f6ffd299fde16d8af9d6dbd16209207f912cab51fc3319ba7733eb27594f54006bf534cdfcfaea54664777
+EBUILD knot-2.4.5.ebuild 1531 SHA256 d84eb720f2939a2b18a11d68b53203814407859dfa258e8ac6e5f9188db3a943 SHA512 908ebfce7b6ecd87171efe02b39ac43b8fd91aabf17da072fddd270b8bb10063e161dad188036dcf68d21046b56c8611fc9f443ebea39949747e1d4403a94405 WHIRLPOOL 9fe1f25b139fb3286eca4e9e03dfb6bf321249c2140b088d3abc451baa5a329678a171a534fa3d233a2114411d5d1afd77bfba109d7e1039d0c5a64fcd1b9b68
+EBUILD knot-2.5.3-r1.ebuild 1963 SHA256 d6172203b7b11341ae4a8af0a96000ce1ada597e582f34dcf2ce12d182eec2e0 SHA512 b406018a1e23f33a9a7eac49794feb8df79d8d406fbceddde634bff9b23f2875bd8371a96dc9c6b5d643fdf53468744efaba35aad6662965aba0ae1e599a31b8 WHIRLPOOL 75f53864bf28bfb1d2c340f59c0a46052bfd02a23d7bfaa01de50dd6be16280c2f544e020799da1953a50bb662117c53b22160b5ee13b6f497219b4a504ce07b
+EBUILD knot-2.5.3.ebuild 1538 SHA256 d6fd2bb305cb59c4062a1d24a88c3ea3335d3eb671b9930801da7f81890ea839 SHA512 80617cc5c2ffc5e4cc2397436d6d834b67d5f61a512088fece8706b53574a49854bcc451d3b4b717d94e2b59d62bb9aa750dcde3b92f05d86026e7d7dba00677 WHIRLPOOL 33f649edb555c2873bba78064c91c4a980c1ccb5d8fe84653cb0b9e6938b74f4f19188cb2426d8b4f1c604ae94c3ff90b02db3a515691325c4f8a6488307c9a0
+EBUILD knot-2.5.4.ebuild 1904 SHA256 065f189fd48ab1b9017a7b793a02b26787993c2b4b4f94aedbbd941ecaee1df8 SHA512 e43fa17ceb2199b0eb8bf989ab6b10663b21a5de094dc9fb6aa1b7b2db4e2d4edc8e1c0f2097f357646b8a45f7b65b603dde630ce17496090c348ec427dcbfbe WHIRLPOOL dc7b37a17b06d227fad6c4687715387a770ed2e2be34a84fb49f4987d5718fdafede56704e08b5900aa1784e674770c7880fc1add69a7c7c6ed93103694f6fcb
+MISC ChangeLog 5135 SHA256 9150cf67baa485c42361fd8ca7cecc178aaf19f69c5f5b0633c2fce1f9346631 SHA512 f97db80651483493f902dfd37880e783d9c1a16ce0610a3134c99db2ea257f2453ada405a07359a0c89e17eaed16cdb41b84e7caf61c633febbdd56f4bbdd937 WHIRLPOOL c30e56530e61b1fc1a24c0be9a5f6ade64dee3c6d2b3e25fbaff2cc4f2bacefcd3e099a767ac7231db1dc1ce518a224855e4229adf00da0a11bf75d535564a26
+MISC ChangeLog-2015 6004 SHA256 78cf50c9a8661021396add7cef8436d81ffd773c52a492b2f50c045a07aae84e SHA512 2d591dea2c45fdbb789f325369b2f01ad8c54ff375676342aade271808902c56c7d16409e35e64a754101c305bc400c9a7bc289e49fa4b079dbb1adb98f76a54 WHIRLPOOL 43b175454e358b7a96f56882451f1c5c897e0ac06b59e4562244f6690cfa037cddb28922d84823052f67e90069b459e9a8ecd435ff06aa2ffd03ef52c660e53f
+MISC metadata.xml 1539 SHA256 c17766d9e8d1b7121ba58acf02ade924eb3f14d4aef61b530b6b337ce12a6f30 SHA512 8b39c687fb8b9fb4bf25e0baa8c851ffb4980c0028bf0f64a3c642146139429e292c6ca3fbd01b7bb311ecbbe7bf1df128885b53971b836f541fe97bedf6f056 WHIRLPOOL 54cf2ffe6c96b25698448ea6dfc6a44efcb1e6bfe5f712ad9e43d9847e670c7711c7b4273e649d8284ebcc6a8b9401eb735380f0d13b38f2475372884371a68d
diff --git a/net-dns/knot/files/2.5.3-link-with-libatomic.patch b/net-dns/knot/files/2.5.3-link-with-libatomic.patch
new file mode 100644
index 000000000000..14e5366f7d94
--- /dev/null
+++ b/net-dns/knot/files/2.5.3-link-with-libatomic.patch
@@ -0,0 +1,117 @@
+From 5cf2d1acf87fa0ab18375534ca210f1cabf212b3 Mon Sep 17 00:00:00 2001
+From: Pierre-Olivier Mercier <nemunaire@nemunai.re>
+Date: Wed, 2 Aug 2017 23:16:43 +0200
+Subject: [PATCH] Link with libatomic on architectures that requires it
+
+---
+ configure.ac | 10 +++++++++-
+ src/Makefile.am | 2 +-
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2a28214..5bd1798 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -504,8 +504,16 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sched.h>]], [[cpuset_t* set = cpuset
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <stdint.h>]],
+ [[uint64_t val = 0; __atomic_add_fetch(&val, 1, __ATOMIC_RELAXED);]])],
+- [AC_DEFINE(HAVE_ATOMIC, 1, [Define to 1 if you have '__atomic' functions.])]
++ [AC_DEFINE(HAVE_ATOMIC, 1, [Define to 1 if you have '__atomic' functions.])
++ AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM([[#include <stdint.h>]],
++ [[uint64_t val = 0; __atomic_add_fetch(&val, 1, __ATOMIC_RELAXED);]])],
++ [atomic_LIBS=""],
++ [atomic_LIBS="-latomic"]
++ )],
++ [atomic_LIBS=""]
+ )
++AC_SUBST([atomic_LIBS])
+
+ # Prepare CFLAG_VISIBILITY to be used where needed
+ gl_VISIBILITY()
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 948912e..bf28013 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -399,7 +399,7 @@ libknotd_la_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAG_VISIBILITY) $(systemd_CFLAGS) \
+ $(liburcu_CFLAGS) -DKNOTD_MOD_STATIC
+ libknotd_la_LDFLAGS = $(AM_LDFLAGS) -export-symbols-regex '^knotd_'
+ libknotd_la_LIBADD = libknot.la zscanner/libzscanner.la $(systemd_LIBS) \
+- $(liburcu_LIBS)
++ $(liburcu_LIBS) $(atomic_LIBS)
+
+ ###################
+ # Knot DNS Daemon #
+--- a/src/Makefile.in 2017-08-05 18:09:14.029882010 +0200
++++ b/src/Makefile.in 2017-08-05 18:12:43.541190937 +0200
+@@ -379,7 +379,7 @@
+ @STATIC_MODULE_dnstap_TRUE@ contrib/dnstap/libdnstap.la
+ libknotd_la_DEPENDENCIES = libknot.la zscanner/libzscanner.la \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+- $(am__DEPENDENCIES_2)
++ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
+ am__libknotd_la_SOURCES_DIST = knot/conf/base.c knot/conf/base.h \
+ knot/conf/conf.c knot/conf/conf.h knot/conf/confdb.c \
+ knot/conf/confdb.h knot/conf/confio.c knot/conf/confio.h \
+@@ -937,6 +937,7 @@
+ am__quote = @am__quote@
+ am__tar = @am__tar@
+ am__untar = @am__untar@
++atomic_LIBS = @atomic_LIBS@
+ bindir = @bindir@
+ build = @build@
+ build_alias = @build_alias@
+@@ -1275,7 +1276,8 @@
+ $(am__append_11)
+ libknotd_la_LDFLAGS = $(AM_LDFLAGS) -export-symbols-regex '^knotd_'
+ libknotd_la_LIBADD = libknot.la zscanner/libzscanner.la \
+- $(systemd_LIBS) $(liburcu_LIBS) $(am__append_12)
++ $(systemd_LIBS) $(liburcu_LIBS) $(atomic_LIBS) \
++ $(am__append_12)
+ @HAVE_DAEMON_TRUE@sbin_SCRIPTS = utils/pykeymgr/pykeymgr
+ @HAVE_DAEMON_TRUE@CLEAN_FILES = $(sbin_SCRIPTS)
+ @HAVE_DAEMON_TRUE@knotddir = $(includedir)/knot
+--- a/configure 2017-08-05 18:09:14.039882551 +0200
++++ b/configure 2017-08-05 18:12:18.779857706 +0200
+@@ -655,6 +655,7 @@
+ CODE_COVERAGE_ENABLED_TRUE
+ HAVE_VISIBILITY
+ CFLAG_VISIBILITY
++atomic_LIBS
+ libidn_LIBS
+ libidn_CFLAGS
+ libidn2_LIBS
+@@ -16347,10 +16358,32 @@
+
+ $as_echo "#define HAVE_ATOMIC 1" >>confdefs.h
+
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++#include <stdint.h>
++int
++main ()
++{
++uint64_t val = 0; __atomic_add_fetch(&val, 1, __ATOMIC_RELAXED);
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ atomic_LIBS=""
++else
++ atomic_LIBS="-latomic"
++
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++else
++ atomic_LIBS=""
+
+ fi
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
++
+ # Prepare CFLAG_VISIBILITY to be used where needed
+
+
diff --git a/net-dns/knot/files/knot-1.service b/net-dns/knot/files/knot-1.service
new file mode 100644
index 000000000000..14a34a2b211f
--- /dev/null
+++ b/net-dns/knot/files/knot-1.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Knot high-performance DNS Server
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/knotd
+ExecReload=/usr/sbin/knotc reload
+ExecStop=/usr/sbin/knotc stop
+PrivateTmp=true
+User=knot
+Group=knot
+RuntimeDirectory=knot
+RuntimeDirectoryMode=750
+AmbientCapabilities=CAP_NET_BIND_SERVICE
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-dns/knot/files/knot.init b/net-dns/knot/files/knot.init
new file mode 100644
index 000000000000..8dc460c31cd4
--- /dev/null
+++ b/net-dns/knot/files/knot.init
@@ -0,0 +1,41 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command=/usr/sbin/knotd
+command_args="-d"
+pidfile=/var/run/knot/knot.pid
+required_files=/etc/knot/knot.conf
+extra_started_commands="reload"
+description_reload="Reload configuration and changed zones."
+
+depend() {
+ need net
+}
+
+start() {
+ checkpath -d -m 0750 -o knot:knot /var/run/knot/ /var/lib/knot/
+
+ ebegin "Starting knot"
+ start-stop-daemon --start \
+ --pidfile $pidfile --exec $command -- $command_args
+ eend $?
+}
+
+stop() {
+ ebegin "Stoping knot"
+ /usr/sbin/knotc stop >/dev/null 2>&1
+ # In case remote control is not working
+ if [ "$?" != 0 ]; then
+ if [ -f $pidfile ]; then
+ start-stop-daemon --stop --pidfile $pidfile
+ fi
+ fi
+ ewend $?
+}
+
+reload() {
+ ebegin "Reloading knot"
+ /usr/sbin/knotc reload >/dev/null
+ eend $?
+}
diff --git a/net-dns/knot/files/knot.service b/net-dns/knot/files/knot.service
new file mode 100644
index 000000000000..4684f9c858e2
--- /dev/null
+++ b/net-dns/knot/files/knot.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Knot high-performance DNS Server
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/knotd
+ExecReload=/usr/sbin/knotc reload
+ExecStop=/usr/sbin/knotc stop
+PrivateTmp=true
+RuntimeDirectory=knot
+RuntimeDirectoryMode=750
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-dns/knot/knot-2.4.5.ebuild b/net-dns/knot/knot-2.4.5.ebuild
new file mode 100644
index 000000000000..50af785a49d1
--- /dev/null
+++ b/net-dns/knot/knot-2.4.5.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit bash-completion-r1 eutils systemd user
+
+DESCRIPTION="High-performance authoritative-only DNS server"
+HOMEPAGE="http://www.knot-dns.cz/"
+SRC_URI="https://secure.nic.cz/files/knot-dns/${P/_/-}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="dnstap doc caps +fastparser idn systemd"
+
+RDEPEND="
+ >=net-libs/gnutls-3.3:=
+ >=dev-libs/jansson-2.3
+ >=dev-db/lmdb-0.9.15
+ >=dev-libs/userspace-rcu-0.5.4
+ caps? ( >=sys-libs/libcap-ng-0.6.4 )
+ dnstap? (
+ dev-libs/fstrm
+ dev-libs/protobuf-c
+ )
+ idn? ( net-dns/libidn )
+ dev-libs/libedit
+ systemd? ( sys-apps/systemd )
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( dev-python/sphinx )
+"
+
+S="${WORKDIR}/${P/_/-}"
+
+src_configure() {
+ econf \
+ --with-storage="${EPREFIX}/var/lib/${PN}" \
+ --with-rundir="${EPREFIX}/var/run/${PN}" \
+ --with-lmdb \
+ --with-bash-completions="$(get_bashcompdir)" \
+ $(use_enable fastparser) \
+ $(use_enable dnstap) \
+ $(use_enable doc documentation) \
+ $(use_with idn libidn) \
+ --enable-systemd=$(usex systemd)
+}
+
+src_compile() {
+ default
+
+ if use doc; then
+ emake -C doc html
+ HTML_DOCS=( doc/_build/html/{*.html,*.js,_sources,_static} )
+ fi
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ default
+
+ keepdir /var/lib/${PN}
+
+ newinitd "${FILESDIR}/knot.init" knot
+ systemd_dounit "${FILESDIR}/knot.service"
+
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ enewgroup knot 53
+ enewuser knot 53 -1 /var/lib/knot knot
+}
diff --git a/net-dns/knot/knot-2.5.3-r1.ebuild b/net-dns/knot/knot-2.5.3-r1.ebuild
new file mode 100644
index 000000000000..1c8e08233e89
--- /dev/null
+++ b/net-dns/knot/knot-2.5.3-r1.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit systemd user
+
+DESCRIPTION="High-performance authoritative-only DNS server"
+HOMEPAGE="http://www.knot-dns.cz/"
+SRC_URI="https://secure.nic.cz/files/knot-dns/${P/_/-}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+KNOT_MODULES=(
+ "+dnsproxy"
+ "dnstap"
+ "+noudp"
+ "+onlinesign"
+ "rosedb"
+ "+rrl"
+ "+stats"
+ "+synthrecord"
+ "+whoami"
+)
+IUSE="doc caps +fastparser idn libidn2 systemd +utils ${KNOT_MODULES[@]}"
+
+RDEPEND="
+ >=net-libs/gnutls-3.3:=
+ >=dev-db/lmdb-0.9.15
+ dev-python/lmdb
+ >=dev-libs/userspace-rcu-0.5.4
+ caps? ( >=sys-libs/libcap-ng-0.6.4 )
+ dnstap? (
+ dev-libs/fstrm
+ dev-libs/protobuf-c
+ )
+ idn? (
+ !libidn2? ( net-dns/libidn )
+ libidn2? ( >=net-dns/libidn2-2.0.0 )
+ )
+ dev-libs/libedit
+ systemd? ( >=sys-apps/systemd-229 )
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( dev-python/sphinx )
+"
+
+S="${WORKDIR}/${P/_/-}"
+
+PATCHES=(
+ "${FILESDIR}/${PV}-link-with-libatomic.patch"
+)
+
+src_configure() {
+ local my_conf=()
+ for u in "${KNOT_MODULES[@]#+}"; do
+ my_conf+=("$(use_with $u module-$u)")
+ done
+
+ econf \
+ --with-storage="${EPREFIX}/var/lib/${PN}" \
+ --with-rundir="${EPREFIX}/var/run/${PN}" \
+ $(use_enable fastparser) \
+ $(use_enable dnstap) \
+ $(use_enable doc documentation) \
+ $(use_enable utils utilities) \
+ --enable-systemd=$(usex systemd) \
+ $(use_with idn libidn) \
+ "${my_conf[@]}"
+}
+
+src_compile() {
+ default
+
+ if use doc; then
+ emake -C doc html
+ HTML_DOCS=( doc/_build/html/{*.html,*.js,_sources,_static} )
+ fi
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ default
+
+ rmdir "${D}var/run/${PN}" "${D}var/run/" || die
+ keepdir /var/lib/${PN}
+
+ newinitd "${FILESDIR}/knot.init" knot
+ if use systemd; then
+ systemd_newunit "${FILESDIR}/knot-1.service" knot
+ fi
+
+ find "${D}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ enewgroup knot 53
+ enewuser knot 53 -1 /var/lib/knot knot
+}
diff --git a/net-dns/knot/knot-2.5.3.ebuild b/net-dns/knot/knot-2.5.3.ebuild
new file mode 100644
index 000000000000..4644120da23f
--- /dev/null
+++ b/net-dns/knot/knot-2.5.3.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit bash-completion-r1 eutils systemd user
+
+DESCRIPTION="High-performance authoritative-only DNS server"
+HOMEPAGE="http://www.knot-dns.cz/"
+SRC_URI="https://secure.nic.cz/files/knot-dns/${P/_/-}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="dnstap doc caps +fastparser idn systemd"
+
+RDEPEND="
+ >=net-libs/gnutls-3.3:=
+ >=dev-db/lmdb-0.9.15
+ >=dev-libs/userspace-rcu-0.5.4
+ caps? ( >=sys-libs/libcap-ng-0.6.4 )
+ dnstap? (
+ dev-libs/fstrm
+ dev-libs/protobuf-c
+ )
+ idn? ( || ( net-dns/libidn >=net-dns/libidn2-2.0.0 ) )
+ dev-libs/libedit
+ systemd? ( sys-apps/systemd )
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( dev-python/sphinx )
+"
+
+S="${WORKDIR}/${P/_/-}"
+
+src_configure() {
+ econf \
+ --with-storage="${EPREFIX}/var/lib/${PN}" \
+ --with-rundir="${EPREFIX}/var/run/${PN}" \
+ --with-lmdb \
+ --with-bash-completions="$(get_bashcompdir)" \
+ $(use_enable fastparser) \
+ $(use_enable dnstap) \
+ $(use_enable doc documentation) \
+ $(use_with idn libidn) \
+ --enable-systemd=$(usex systemd)
+}
+
+src_compile() {
+ default
+
+ if use doc; then
+ emake -C doc html
+ HTML_DOCS=( doc/_build/html/{*.html,*.js,_sources,_static} )
+ fi
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ default
+
+ keepdir /var/lib/${PN}
+
+ newinitd "${FILESDIR}/knot.init" knot
+ systemd_dounit "${FILESDIR}/knot.service"
+
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ enewgroup knot 53
+ enewuser knot 53 -1 /var/lib/knot knot
+}
diff --git a/net-dns/knot/knot-2.5.4.ebuild b/net-dns/knot/knot-2.5.4.ebuild
new file mode 100644
index 000000000000..ce1ab4d0f5d9
--- /dev/null
+++ b/net-dns/knot/knot-2.5.4.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit systemd user
+
+DESCRIPTION="High-performance authoritative-only DNS server"
+HOMEPAGE="https://www.knot-dns.cz/"
+SRC_URI="https://secure.nic.cz/files/knot-dns/${P/_/-}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+KNOT_MODULES=(
+ "+dnsproxy"
+ "dnstap"
+ "+noudp"
+ "+onlinesign"
+ "rosedb"
+ "+rrl"
+ "+stats"
+ "+synthrecord"
+ "+whoami"
+)
+IUSE="doc caps +fastparser idn libidn2 systemd +utils ${KNOT_MODULES[@]}"
+
+RDEPEND="
+ >=dev-db/lmdb-0.9.15
+ dev-libs/libedit
+ >=dev-libs/userspace-rcu-0.5.4
+ dev-python/lmdb
+ >=net-libs/gnutls-3.3:=
+ caps? ( >=sys-libs/libcap-ng-0.6.4 )
+ dnstap? (
+ dev-libs/fstrm
+ dev-libs/protobuf-c
+ )
+ idn? (
+ !libidn2? ( net-dns/libidn )
+ libidn2? ( >=net-dns/libidn2-2.0.0 )
+ )
+ systemd? ( >=sys-apps/systemd-229 )
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( dev-python/sphinx )
+"
+
+S="${WORKDIR}/${P/_/-}"
+
+src_configure() {
+ local my_conf=()
+ for u in "${KNOT_MODULES[@]#+}"; do
+ my_conf+=("$(use_with $u module-$u)")
+ done
+
+ econf \
+ --with-storage="${EPREFIX}/var/lib/${PN}" \
+ --with-rundir="${EPREFIX}/var/run/${PN}" \
+ $(use_enable fastparser) \
+ $(use_enable dnstap) \
+ $(use_enable doc documentation) \
+ $(use_enable utils utilities) \
+ --enable-systemd=$(usex systemd) \
+ $(use_with idn libidn) \
+ "${my_conf[@]}"
+}
+
+src_compile() {
+ default
+
+ if use doc; then
+ emake -C doc html
+ HTML_DOCS=( doc/_build/html/{*.html,*.js,_sources,_static} )
+ fi
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ default
+
+ rmdir "${D}var/run/${PN}" "${D}var/run/" || die
+ keepdir /var/lib/${PN}
+
+ newinitd "${FILESDIR}/knot.init" knot
+ if use systemd; then
+ systemd_newunit "${FILESDIR}/knot-1.service" knot
+ fi
+
+ find "${D}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ enewgroup knot 53
+ enewuser knot 53 -1 /var/lib/knot knot
+}
diff --git a/net-dns/knot/metadata.xml b/net-dns/knot/metadata.xml
new file mode 100644
index 000000000000..9245494df34e
--- /dev/null
+++ b/net-dns/knot/metadata.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>nemunaire@nemunai.re</email>
+ <name>Pierre-Olivier Mercier</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <use>
+ <flag name="dnsproxy">
+ Enable the tiny DNS proxy module
+ </flag>
+ <flag name="dnstap">
+ Include support for the dnstap binary log format
+ (http://dnstap.info/)
+ </flag>
+ <flag name="fastparser">
+ Use a zone file parser that is faster, but requires
+ more memory and CPU time to compile
+ </flag>
+ <flag name="libidn2">
+ If IDN support is enabled, use net-dns/libidn2 instead
+ of net-dns/libidn
+ </flag>
+ <flag name="noudp">
+ Enable the module which can send empty truncated
+ responses to UDP queries
+ </flag>
+ <flag name="onlinesign">
+ Enable the module that sign zones on the fly instead of
+ pre-signing zone
+ </flag>
+ <flag name="rosedb">
+ Enable the module that staticaly override certain
+ responses
+ </flag>
+ <flag name="rrl">
+ Enable the response rate limiting module
+ </flag>
+ <flag name="stats">
+ Enable the server statistics module
+ </flag>
+ <flag name="synthrecord">
+ Enable the automatic forward/reverse records module
+ </flag>
+ <flag name="utils">
+ Install Knot utilities, such as kdig, kzonecheck, ...
+ </flag>
+ <flag name="whoami">
+ Enable the whoami response module
+ </flag>
+ </use>
+</pkgmetadata>