summaryrefslogtreecommitdiffstats
path: root/distro/arch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 00:55:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 00:55:53 +0000
commit3d0386f27ca66379acf50199e1d1298386eeeeb8 (patch)
treef87bd4a126b3a843858eb447e8fd5893c3ee3882 /distro/arch
parentInitial commit. (diff)
downloadknot-resolver-upstream.tar.xz
knot-resolver-upstream.zip
Adding upstream version 3.2.1.upstream/3.2.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'distro/arch')
-rw-r--r--distro/arch/PKGBUILD56
-rw-r--r--distro/arch/install15
2 files changed, 71 insertions, 0 deletions
diff --git a/distro/arch/PKGBUILD b/distro/arch/PKGBUILD
new file mode 100644
index 0000000..87f8aa7
--- /dev/null
+++ b/distro/arch/PKGBUILD
@@ -0,0 +1,56 @@
+# Maintainer: Tomas Krizek <tomas.krizek@mailbox.org>
+# Contributor: Ondřej Surý <ondrej@sury.org>
+
+pkgname=knot-resolver
+pkgver=__VERSION__
+pkgrel=1
+pkgdesc='full caching DNS resolver implementation'
+url='https://www.knot-resolver.cz/'
+arch=('x86_64' 'armv7h')
+license=('GPL3')
+backup=('etc/knot-resolver/kresd.conf')
+options=(debug strip)
+install=install
+depends=('cmocka'
+ 'dnssec-anchors'
+ 'gnutls'
+ 'knot>=2.7.2'
+ 'libedit'
+ 'libsystemd'
+ 'libuv'
+ 'lmdb'
+ 'lua51-sec'
+ 'lua51-socket'
+ 'luajit')
+source=("knot-resolver_${pkgver}.orig.tar.xz")
+
+_makevars="PREFIX=/usr SBINDIR=/usr/bin LIBDIR=/usr/lib INCLUDEDIR=/usr/include ETCDIR=/etc/knot-resolver KEYFILE_DEFAULT=/etc/trusted-key.key V=1"
+
+sha256sums=('SKIP')
+
+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}/distro/common/systemd/kresd.socket" "${pkgdir}/usr/lib/systemd/system/kresd.socket"
+ install -Dm 0644 "${srcdir}/${pkgname}-${pkgver}/distro/common/systemd/kresd-control@.socket" "${pkgdir}/usr/lib/systemd/system/kresd-control@.socket"
+ install -Dm 0644 "${srcdir}/${pkgname}-${pkgver}/distro/common/systemd/kresd-tls.socket" "${pkgdir}/usr/lib/systemd/system/kresd-tls.socket"
+ install -Dm 0644 "${srcdir}/${pkgname}-${pkgver}/distro/common/systemd/kresd@.service" "${pkgdir}/usr/lib/systemd/system/kresd@.service"
+ install -Dm 0644 "${srcdir}/${pkgname}-${pkgver}/distro/common/systemd/kresd.target" "${pkgdir}/usr/lib/systemd/system/kresd.target"
+ install -dm 0755 "${pkgdir}/usr/lib/systemd/system/multi-user.target.wants"
+ ln -s ../kresd.target "${pkgdir}/usr/lib/systemd/system/multi-user.target.wants/kresd.target"
+ install -Dm 0644 "${srcdir}/${pkgname}-${pkgver}/distro/common/systemd/kresd.systemd.7" "${pkgdir}/usr/share/man/man7/kresd.systemd.7"
+ install -Dm 0644 "${srcdir}/${pkgname}-${pkgver}/distro/common/tmpfiles/knot-resolver.conf" "${pkgdir}/usr/lib/tmpfiles.d/knot-resolver.conf"
+ install -dm 0775 "${pkgdir}/etc/knot-resolver"
+ install -Dm 0644 "${srcdir}/${pkgname}-${pkgver}/distro/common/kresd.no_ta.conf" "${pkgdir}/etc/knot-resolver/kresd.conf"
+}
diff --git a/distro/arch/install b/distro/arch/install
new file mode 100644
index 0000000..de23d59
--- /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
+}