hidapi: remove now obsolete iconv patch
[feed/packages.git] / net / dnsdist / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=dnsdist
4 PKG_VERSION:=1.7.3
5 PKG_RELEASE:=$(AUTORELEASE)
6
7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
8 PKG_SOURCE_URL:=https://downloads.powerdns.com/releases/
9 PKG_HASH:=7eaf6fac2f26565c5d8658d42a213799e05f4d3bc68e7c716e7174df41315886
10
11 PKG_MAINTAINER:=Peter van Dijk <peter.van.dijk@powerdns.com>
12 PKG_LICENSE:=GPL-2.0-only
13 PKG_LICENSE_FILES:=COPYING
14 PKG_CPE_ID:=cpe:/a:powerdns:dnsdist
15
16 PKG_INSTALL:=1
17 PKG_BUILD_PARALLEL:=1
18
19 PKG_ASLR_PIE:=0
20 PKG_BUILD_DEPENDS:=boost
21
22 PKG_CONFIG_DEPENDS:= \
23 CONFIG_DNSDIST_GNUTLS \
24 CONFIG_DNSDIST_OPENSSL
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/dnsdist/config
29 menu "Configuration"
30 depends on PACKAGE_dnsdist
31
32 comment "SSL Support"
33 choice
34 prompt "Selected SSL library"
35 default DNSDIST_OPENSSL
36
37 config DNSDIST_OPENSSL
38 bool "OpenSSL"
39
40 config DNSDIST_GNUTLS
41 bool "GnuTLS"
42
43 config DNSDIST_NOSSL
44 bool "No SSL support"
45
46 endchoice
47
48 comment "DNS over HTTPS/TLS Support"
49 depends on !DNSDIST_NOSSL
50
51 config DNSDIST_DNS_OVER_HTTPS
52 depends on DNSDIST_OPENSSL
53 depends on !DNSDIST_NOSSL
54 bool "DNS over HTTPS Support"
55 help
56 "Enables DNS over HTTPS Support for dnsdist"
57 default y
58
59 config DNSDIST_DNS_OVER_HTTPS_OUTGOING
60 depends on !DNSDIST_NOSSL
61 bool "Outgoing DNS over HTTPS Support"
62 help
63 "Enables Outgoing DNS over HTTPS Support for dnsdist"
64 default y
65
66 config DNSDIST_DNS_OVER_TLS
67 depends on !DNSDIST_NOSSL
68 bool "DNS over TLS Support"
69 help
70 "Enabled DNS over TLS Support for dnsdist"
71 default y
72
73 config DNSDIST_NET_SNMP
74 bool "Net-SNMP support"
75 help
76 "Enable Net-SNMP support for dnsdist"
77 default y
78
79 config DNSDIST_RE2
80 bool "RE2 support"
81 help
82 "Enable RE2 support for dnsdist"
83 default y
84
85 config DNSDIST_DNSTAP
86 bool "DNSTAP support"
87 help
88 "Enable DNSTAP support for dnsdist"
89 default y
90
91 config DNSDIST_SODIUM
92 bool "Build with libsodium"
93 help
94 "Build with libsodium - for encrypted console connections, and DNSCrypt"
95 default y
96 endmenu
97 endef
98
99 define Package/dnsdist
100 SECTION:=net
101 CATEGORY:=Network
102 SUBMENU:=IP Addresses and Names
103 TITLE:=dnsdist DNS-, DOS- and abuse-aware loadbalancer
104 DEPENDS:= \
105 +DNSDIST_DNS_OVER_HTTPS:libh2o-evloop \
106 +DNSDIST_DNS_OVER_HTTPS_OUTGOING:libnghttp2 \
107 +DNSDIST_GNUTLS:libgnutls \
108 +DNSDIST_OPENSSL:libopenssl \
109 +DNSDIST_NET_SNMP:libnetsnmp \
110 +DNSDIST_RE2:re2 \
111 +DNSDIST_DNSTAP:libfstrm \
112 +DNSDIST_SODIUM:libsodium \
113 +libatomic \
114 +libcap \
115 +libedit \
116 +libstdcpp \
117 +lmdb \
118 +luajit \
119 +tinycdb
120 URL:=https://dnsdist.org/
121 endef
122
123 define Package/dnsdist/description
124 dnsdist is a highly DNS-, DoS- and abuse-aware loadbalancer. Its goal in life
125 is to route traffic to the best server, delivering top performance to legitimate
126 users while shunting or blocking abusive traffic.
127 endef
128
129 define Package/dnsdist/conffiles
130 /etc/dnsdist.conf
131 /etc/config/dnsdist
132 /etc/init.d/dnsdist
133 endef
134
135 # not everything groks --disable-nls
136 DISABLE_NLS:=
137
138 # OpenWRT's setting of CXX destroys dnsdist's -std=c++17
139 # --with-re2 compensates for that because it compensates for a bug in re2.pc that also destroys it
140 # so this addition is for the --without-re2 case
141 #
142 # none of this is pretty
143 TARGET_CXX+=-std=c++17
144
145 CONFIGURE_ARGS+= \
146 --with-pic \
147 --with-lua=luajit \
148 $(if $(CONFIG_DNSDIST_SODIUM),--enable-dnscrypt --with-libsodium,--disable-dnscrypt --without-libsodium) \
149 $(if $(CONFIG_DNSDIST_DNSTAP),--enable-dnstap=yes,--enable-dnstap=no) \
150 $(if $(CONFIG_DNSDIST_RE2),--with,--without)-re2 \
151 $(if $(CONFIG_DNSDIST_NET_SNMP),--with,--without)-net-snmp \
152 $(if $(CONFIG_DNSDIST_GNUTLS),--with,--without)-gnutls \
153 $(if $(CONFIG_DNSDIST_OPENSSL),--with,--without)-libssl \
154 $(if $(CONFIG_DNSDIST_DNS_OVER_TLS),--enable-dns-over-tls,) \
155 $(if $(CONFIG_DNSDIST_DNS_OVER_HTTPS),--enable-dns-over-https,) \
156 $(if $(CONFIG_DNSDIST_DNS_OVER_HTTPS_OUTGOING),--with,--without)-nghttp2
157
158 define Package/dnsdist/install
159 $(INSTALL_DIR) $(1)/etc
160 $(INSTALL_CONF) ./files/dnsdist.conf $(1)/etc/dnsdist.conf
161 $(INSTALL_DIR) $(1)/etc/config
162 $(INSTALL_CONF) ./files/dnsdist.config $(1)/etc/config/dnsdist
163 $(INSTALL_DIR) $(1)/etc/init.d
164 $(INSTALL_BIN) ./files/dnsdist.init $(1)/etc/init.d/dnsdist
165 $(INSTALL_DIR) $(1)/usr/bin
166 $(INSTALL_BIN) $(PKG_BUILD_DIR)/dnsdist $(1)/usr/bin/
167 endef
168
169 $(eval $(call BuildPackage,dnsdist))