blob: f2c3b900b1c28fc4ae49a7319a8c5185dfcc85ef (
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
# Contributor: Vince Mele <vmele@inoc.com>
# Maintainer: Vince Mele <vmele@inoc.com>
pkgname="dnsdist"
pkgver="1.3.2"
pkgrel=0
pkgdesc="dnsdist is a highly DNS-, DoS-, and abuse-aware loadbalancer."
url="https://dnsdist.org"
arch="all !s390x" #limited by fstrm
license="GPL2"
_lua_version="5.1"
depends="$pkgname-common !$pkgname-luajit"
makedepends="boost-dev fstrm-dev libedit-dev libsodium-dev lua${_lua_version}-dev net-snmp-dev protobuf-dev re2-dev"
pkgusers="dnsdist"
pkggroups="dnsdist"
install="$pkgname-common.pre-install"
subpackages="$pkgname-common::noarch $pkgname-doc"
source="https://downloads.powerdns.com/releases/$pkgname-$pkgver.tar.bz2"
builddir="$srcdir/$pkgname-$pkgver"
# luajit is not available for s390x
case "$CARCH" in
s390x) ;;
*)
makedepends="$makedepends luajit-dev"
subpackages="$subpackages $pkgname-luajit"
;;
esac
prepare() {
default_prepare
case "$subpackages" in
*-luajit*) cp -a "$builddir" "$builddir-jit";;
esac
}
_configure() {
local _arg="$1"
local _luajit
[ "$_arg" = '-jit' ] || _arg='' _luajit="lua${_lua_version}"
cd "$builddir$_arg"
./configure \
--build="$CBUILD" \
--host="$CHOST" \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--enable-unit-tests \
--enable-dnscrypt \
--enable-dns-over-tls \
--enable-fstrm \
--enable-libsodium \
--enable-re2 \
--with-protobuf \
--with-boost=/usr/include \
--with-net-snmp \
--with-lua${_luajit:+=$_luajit}
}
build() {
cd "$builddir"
_configure
make
[ -d "$builddir-jit" ] || return 0
_configure -jit
make
}
check() {
cd "$builddir"
make check
./dnsdist --version
[ -d "$builddir-jit" ] || return 0
cd "$builddir-jit"
make check
./dnsdist --version
}
package() {
cd "$builddir"
make -j1 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="af7c360d6a5255bc9588622747b8939d30669e2d7d749275b30a9be8cf306a92768327057a93bfa901c44ac8a7572c9bb801a7f6ceca6d736f3e9c71f80f5726 dnsdist-1.3.2.tar.bz2"
|