summaryrefslogtreecommitdiffstats
path: root/distro/pkg/arch/PKGBUILD
blob: 7eea556e558b3eed3b680ccb19810e3e69c2ce90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Maintainer:	Tomas Krizek <tomas.krizek@nic.cz>
# Contributor:	Ondřej Surý <ondrej@sury.org>
# SPDX-License-Identifier: GPL-3.0-or-later

pkgname=knot-resolver
pkgver={{ version }}
pkgrel={{ release }}
pkgdesc='Caching DNSSEC-validating DNS resolver'
arch=('x86_64' 'armv7h')
url='https://www.knot-resolver.cz/'
license=('GPL3')
depends=(
    'dnssec-anchors'
    'gnutls'
    'knot'
    'libedit'
    'libuv'
    'lmdb'
    'luajit'
    'systemd'
    'libcap-ng'
    'libnghttp2'
    'jemalloc'
)
makedepends=(
    'cmocka'
    'meson'
    'systemd-libs'
)
optdepends=(
    'lua51-basexx: experimental_dot_auth module'
    'lua51-cqueues: http and dns64 module, policy.rpz() function'
    'lua51-http: http and prefill modules, trust_anchors bootstrap'
    'lua51-psl: policy.slice_randomize_psl() function'
)
backup=('etc/knot-resolver/kresd.conf')
options=(debug strip)
source=("knot-resolver-${pkgver}.tar.xz")
sha256sums=('SKIP')

build() {
    cd "${srcdir}/${pkgname}-${pkgver}"
    meson build \
        --buildtype=release \
        --prefix=/usr \
        --sbindir=bin \
        -D keyfile_default=/etc/trusted-key.key \
        -D systemd_files=enabled \
        -D client=enabled \
        -D install_kresd_conf=enabled \
        -D malloc=jemalloc \
        -D unit_tests=enabled
    ninja -C build
}

check() {
    cd "${srcdir}/${pkgname}-${pkgver}"
    meson test -C build
}

package() {
    cd "${srcdir}/${pkgname}-${pkgver}"
    DESTDIR=${pkgdir} ninja -C build install

    # add kresd.target to multi-user.target.wants to support enabling kresd services
    install -d -m 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"

    # remove modules with missing dependencies
    rm "${pkgdir}/usr/lib/knot-resolver/kres_modules/etcd.lua"
}