# Maintainer: Peter van Dijk pkgname=dnsdist pkgver=1.8.0 pkgrel=5 pkgdesc="dnsdist is a highly DNS-, DoS-, and abuse-aware loadbalancer." url="https://dnsdist.org/" # s390x blocked by h2o # riscv64: for some reason, gcc segfaults arch="all !s390x !riscv64" license="GPL-2.0-only WITH OpenSSL-Exception" depends="$pkgname-common !$pkgname-luajit" checkdepends="findutils" makedepends=" boost-dev fstrm-dev h2o-dev libedit-dev libsodium-dev lmdb-dev net-snmp-dev nghttp2-dev openssl-dev re2-dev wslay-dev " pkgusers="dnsdist" pkggroups="dnsdist" install="$pkgname-common.pre-install" subpackages="$pkgname-common::noarch $pkgname-doc" source="https://downloads.powerdns.com/releases/dnsdist-${pkgver//_/-}.tar.bz2" builddir="$srcdir/$pkgname-${pkgver//_/-}" [ "$CARCH" = "ppc64le" ] && options="!check" # failing tests case "$CARCH" in ppc64le|riscv64) makedepends="$makedepends lua5.4-dev" _luajit=OFF ;; *) makedepends="$makedepends lua5.4-dev luajit-dev" subpackages="$subpackages $pkgname-luajit" _luajit=ON ;; esac prepare() { default_prepare if [ "$_luajit" = "ON" ]; then cp -a "$builddir" "$builddir-jit" fi } _configure() { local arg="$1" local lua if [ "$arg" = '-jit' ]; then lua="luajit" else lua="lua5.4" fi cd "$builddir$arg" ./configure \ --build="$CBUILD" \ --host="$CHOST" \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --enable-dnscrypt \ --enable-dns-over-tls \ --enable-dns-over-https \ --enable-unit-tests \ --with-re2 \ --with-boost=/usr/include \ --with-net-snmp \ --with-lua=$lua } build() { _configure make [ -d "$builddir-jit" ] || return 0 _configure -jit make } _cat_found_file() { local _rc="$?" find . -name "$1" -type f -ls -printf '%P {{{\n' -exec cat -v -n '{}' ';' -printf '}}} %P\n' return "$_rc" } check() { make check || _cat_found_file 'test-suite.log' ./dnsdist --version if cd "$builddir-jit"; then make check || _cat_found_file 'test-suite.log' ./dnsdist --version fi } package() { make DESTDIR="$pkgdir" install mv "$pkgdir/usr/bin/$pkgname" "$pkgdir/usr/bin/$pkgname-lua" if cd "$builddir-jit"; then make -j1 DESTDIR="$pkgdir" install-exec mv "$pkgdir/usr/bin/$pkgname" "$pkgdir/usr/bin/$pkgname-luajit" fi mv "$pkgdir/usr/bin/$pkgname-lua" "$pkgdir/usr/bin/$pkgname" } common() { pkgdesc="$pkgname common files" depends="" mkdir -p "$subpkgdir" } luajit() { pkgdesc="$pkgname with luajit bindings" depends="$pkgname-common !$pkgname" mkdir -p "$subpkgdir/usr/bin" mv "$pkgdir/usr/bin/$pkgname-luajit" "$subpkgdir/usr/bin/$pkgname" } sha512sums=" 426db3e83729bd2f8a8c8b1c02d719c6618acc0aec09d1f2670c159d441c1cad2fdc85c5ffe919e76d1b1e8e24198bf29133802cb857dfacde2dfed2532001f1 dnsdist-1.8.0.tar.bz2 "