From: Tomas Krizek Date: Fri, 16 Feb 2018 11:55:56 +0000 (+0100) Subject: packaging: add files for Arch builds X-Git-Tag: v2.2.0~16^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca93ed6475f359b74f891adfe20a952b28925662;p=thirdparty%2Fknot-resolver.git packaging: add files for Arch builds --- diff --git a/distro/arch/PKGBUILD b/distro/arch/PKGBUILD new file mode 100644 index 000000000..f818c89a9 --- /dev/null +++ b/distro/arch/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: Tomas Krizek +# Contributor: Ondřej Surý + +pkgname=knot-resolver +pkgver=VERSION +pkgrel=1 +pkgdesc='full caching DNS resolver implementation' +url='https://www.knot-resolver.cz/' +arch=('x86_64') +license=('GPL3') +install=install +depends=('libuv' 'knot>=2.6.4' 'luajit' 'cmocka' 'lua51-sec' 'lua51-socket' 'hiredis' 'libmemcached' 'libsystemd') +source=("knot-resolver-${pkgver}.tar.xz" + "kresd.conf" + "root.keys") + +_makevars="PREFIX=/usr SBINDIR=/usr/bin LIBDIR=/usr/lib INCLUDEDIR=/usr/include ETCDIR=/etc/knot-resolver V=1" + +sha256sums=('SKIP' + 'SKIP' + '06c74ef5ef53344c78c9af2b29dc458a2abe93f1bff429705955c033e7a0686f') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + make ${_makevars} +} + +check() { + cd "${srcdir}/${pkgname}-${pkgver}" + make check-unit ${_makevars} +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + + make ${_makevars} DESTDIR="${pkgdir}" install + install -Dm 0644 "${srcdir}/${pkgname}-${pkgver}/systemd/kresd.socket" "${pkgdir}/usr/lib/systemd/system/kresd.socket" + install -Dm 0644 "${srcdir}/${pkgname}-${pkgver}/systemd/kresd-control@.socket" "${pkgdir}/usr/lib/systemd/system/kresd-control@.socket" + install -Dm 0644 "${srcdir}/${pkgname}-${pkgver}/systemd/kresd-tls.socket" "${pkgdir}/usr/lib/systemd/system/kresd-tls.socket" + install -Dm 0644 "${srcdir}/${pkgname}-${pkgver}/systemd/kresd@.service" "${pkgdir}/usr/lib/systemd/system/kresd@.service" + install -Dm 0644 "${srcdir}/${pkgname}-${pkgver}/doc/kresd.systemd.7" "${pkgdir}/usr/share/man/man7/kresd.systemd.7" + install -Dm 0644 "${srcdir}/${pkgname}-${pkgver}/systemd/tmpfiles/knot-resolver.conf" "${pkgdir}/usr/lib/tmpfiles.d/knot-resolver.conf" + install -dm 0775 "${pkgdir}/etc/knot-resolver" + install -Dm 0644 "${srcdir}/kresd.conf" "${pkgdir}/etc/knot-resolver/kresd.conf" + install -Dm 0664 "${srcdir}/root.keys" "${pkgdir}/etc/knot-resolver/root.keys" +} diff --git a/distro/arch/install b/distro/arch/install new file mode 100644 index 000000000..de23d593f --- /dev/null +++ b/distro/arch/install @@ -0,0 +1,15 @@ +post_install() { + getent group knot-resolver &>/dev/null || groupadd -r knot-resolver >/dev/null + getent passwd knot-resolver &>/dev/null || useradd -r -g knot-resolver -d /dev/null -s /bin/false -c knot-resolver knot-resolver >/dev/null + chown -R root:knot-resolver /etc/knot-resolver +} + +post_upgrade() { + chown -R root:knot-resolver /etc/knot-resolver +} + +post_remove() { + getent passwd knot-resolver &>/dev/null && userdel knot-resolver >/dev/null + getent group knot-resolver &>/dev/null && groupdel knot-resolver >/dev/null + true +} diff --git a/distro/arch/kresd.conf b/distro/arch/kresd.conf new file mode 120000 index 000000000..2fc64a42a --- /dev/null +++ b/distro/arch/kresd.conf @@ -0,0 +1 @@ +../common/kresd.conf \ No newline at end of file diff --git a/distro/arch/root.keys b/distro/arch/root.keys new file mode 120000 index 000000000..2d4a6bdad --- /dev/null +++ b/distro/arch/root.keys @@ -0,0 +1 @@ +../common/root.keys \ No newline at end of file diff --git a/distro/common/kresd.conf b/distro/common/kresd.conf new file mode 100644 index 000000000..81034c07e --- /dev/null +++ b/distro/common/kresd.conf @@ -0,0 +1,20 @@ +-- vim:syntax=lua: +-- Refer to manual: http://knot-resolver.readthedocs.org/en/latest/daemon.html#configuration + +-- Load useful modules +modules = { + 'policy', -- Block queries to local zones/bad sites + 'hints', -- Load /etc/hosts and allow custom root hints + 'stats', -- Track internal statistics + 'predict', -- Prefetch expiring/frequent records +} + +-- See kresd.systemd(7) about configuring network interfaces when using systemd +-- Listen on localhost (default) +-- net = { '127.0.0.1', '::1' } + +-- Enable DNSSEC validation +trust_anchors.file = '/etc/knot-resolver/root.keys' + +-- Cache size +cache.size = 100 * MB diff --git a/distro/common/root.keys b/distro/common/root.keys new file mode 100644 index 000000000..7578e0405 --- /dev/null +++ b/distro/common/root.keys @@ -0,0 +1,2 @@ +. IN DS 19036 8 2 49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5 +. IN DS 20326 8 2 E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D diff --git a/distro/fedora/kresd.conf b/distro/fedora/kresd.conf deleted file mode 100644 index 81034c07e..000000000 --- a/distro/fedora/kresd.conf +++ /dev/null @@ -1,20 +0,0 @@ --- vim:syntax=lua: --- Refer to manual: http://knot-resolver.readthedocs.org/en/latest/daemon.html#configuration - --- Load useful modules -modules = { - 'policy', -- Block queries to local zones/bad sites - 'hints', -- Load /etc/hosts and allow custom root hints - 'stats', -- Track internal statistics - 'predict', -- Prefetch expiring/frequent records -} - --- See kresd.systemd(7) about configuring network interfaces when using systemd --- Listen on localhost (default) --- net = { '127.0.0.1', '::1' } - --- Enable DNSSEC validation -trust_anchors.file = '/etc/knot-resolver/root.keys' - --- Cache size -cache.size = 100 * MB diff --git a/distro/fedora/kresd.conf b/distro/fedora/kresd.conf new file mode 120000 index 000000000..2fc64a42a --- /dev/null +++ b/distro/fedora/kresd.conf @@ -0,0 +1 @@ +../common/kresd.conf \ No newline at end of file diff --git a/distro/fedora/root.keys b/distro/fedora/root.keys deleted file mode 100644 index 7578e0405..000000000 --- a/distro/fedora/root.keys +++ /dev/null @@ -1,2 +0,0 @@ -. IN DS 19036 8 2 49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5 -. IN DS 20326 8 2 E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D diff --git a/distro/fedora/root.keys b/distro/fedora/root.keys new file mode 120000 index 000000000..2d4a6bdad --- /dev/null +++ b/distro/fedora/root.keys @@ -0,0 +1 @@ +../common/root.keys \ No newline at end of file