pdns: unbreak bigendian builds
[feed/packages.git] / net / pdns / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=pdns
4 PKG_VERSION:=4.9.0
5 PKG_RELEASE:=2
6
7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
8 PKG_SOURCE_URL:=https://downloads.powerdns.com/releases/
9 PKG_HASH:=fe1d5433c88446ed70d931605c6ec377da99839c4e151b90b71aa211bd6eea92
10
11 PKG_MAINTAINER:=Peter van Dijk <peter.van.dijk@powerdns.com>, Remi Gacogne <remi.gacogne@powerdns.com>
12 PKG_LICENSE:=GPL-2.0-only
13 PKG_LICENSE_FILES:=COPYING
14 PKG_CPE_ID:=cpe:/a:powerdns:authoritative
15
16 PKG_FIXUP:=autoreconf
17
18 PKG_INSTALL:=1
19
20 PKG_BUILD_PARALLEL:=1
21
22 PKG_BUILD_DEPENDS:=unixodbc/host protobuf-c/host
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/pdns/Default
27 SECTION:=net
28 CATEGORY:=Network
29 SUBMENU:=IP Addresses and Names
30 TITLE:=PowerDNS Authoritative Server
31 DEPENDS:=+libatomic
32 URL:=https://www.powerdns.com/auth.html
33 endef
34
35 define Package/pdns/description
36 PowerDNS is a versatile nameserver which supports a large number
37 of different backends ranging from simple zonefiles to relational
38 databases and load balancing/failover algorithms.
39 PowerDNS tries to emphasize speed and security.
40
41 This is the authoritative nameserver that answers questions about
42 domains that it knows about. You also need at least one backend installed to
43 serve data.
44 endef
45
46 PDNS_BACKENDS =
47
48 define Package/pdns-backends
49 $(call Package/pdns/Default)
50 TITLE+= (all backends)
51 DEPENDS+= $(PDNS_DEPENDS)
52 HIDDEN:=1
53 endef
54
55 define Package/pdns-backends/description
56 This meta package contains only dependencies for PowerDNS backends.
57 endef
58
59 # Create a meta-package of dependent backends (for ALL)
60 define Package/pdns-backends/install
61 true
62 endef
63
64 define Package/pdns-tools
65 $(call Package/pdns/Default)
66 TITLE:=Tools for DNS debugging by PowerDNS
67 DEPENDS+=+boost +boost-program_options +libcurl +libmbedtls +libopenssl +p11-kit +protobuf
68 endef
69
70 define Package/pdns-tools/description
71 PowerDNS is a versatile nameserver which supports a large number
72 of different backends ranging from simple zonefiles to relational
73 databases and load balancing/failover algorithms.
74 PowerDNS tries to emphasize speed and security.
75
76 This package contains several tools to debug DNS issues. These tools do not
77 require any part of the PowerDNS server components to work.
78
79 * dnsbulktest: A resolver stress-tester
80 * dnsgram: Show per 5-second statistics to study intermittent resolver issues
81 * dnsreplay: Replay a pcap with DNS queries
82 * dnsscan: Prints the query-type amounts in a pcap
83 * dnsscope: Calculates statistics without replaying traffic
84 * dnstcpbench: Perform TCP benchmarking of DNS servers
85 * dnswasher: Clean a pcap of identifying IP information
86 * ixplore: Explore diffs from IXFRs
87 * nsec3dig: Calculate the correctness of NSEC3 proofs
88 * saxfr: AXFR zones and show extra information
89 endef
90
91 define Package/pdns-ixfrdist
92 $(call Package/pdns/Default)
93 TITLE:=Redistribute zones via AXFR and IXFR
94 DEPENDS+=+boost +boost-program_options +libopenssl +libyaml-cpp +p11-kit +protobuf
95 endef
96
97 define Package/pdns-ixfrdist/description
98 PowerDNS is a versatile nameserver which supports a large number
99 of different backends ranging from simple zonefiles to relational
100 databases and load balancing/failover algorithms.
101 PowerDNS tries to emphasize speed and security.
102
103 This package contains the ixfrdist tool that can redistribute multiple versions
104 of zones over AXFR and IXFR. This tool does not require any part of the
105 PowerDNS server components to work.
106 endef
107
108 define Package/pdns
109 $(call Package/pdns/Default)
110 DEPENDS+=+boost +boost-program_options +libcurl +liblua +libopenssl +libsqlite3 +p11-kit
111 endef
112
113 define Package/pdns/config
114 menu "Select PowerDNS backends"
115 depends on PACKAGE_pdns
116 comment "PowerDNS backends"
117
118 $(foreach backend,$(PDNS_BACKENDS), \
119 config PACKAGE_pdns-backend-$(backend)
120 prompt "$(PDNS_BACKEND_$(backend)_DESC) backend"
121 default m if ALL
122 )
123 endmenu
124 endef
125
126
127 # 1: short name
128 # 2: dependencies on other PowerDNS libraries (short name)
129 # 3: dependencies on other packages
130 # 4: conditional/inward dependencies
131 # 5: friendly display name
132 define DefinePdnsBackend
133 PDNS_DEPENDS+= +pdns-backend-$(1)
134 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_pdns-backend$(1)
135
136 PDNS_BACKENDS+= $(1)
137
138 PDNS_BACKEND_$(1)_DESC=$(if $(5),$(5),$(1))
139 PDNS_BACKEND_$(1)_LIB=$(if $(4),$(4),$(1))
140
141 define Package/pdns-backend-$(1)
142 $(call Package/pdns/Default)
143 TITLE+= ($(1))
144 DEPENDS+= pdns $$(foreach backend,$(2),+pdns-backend-$$(backend)) \
145 $$(foreach dependency,$(3),+$$(dependency))
146 HIDDEN:=1
147 endef
148
149 define Package/pdns-backend-$(1)/description
150 PowerDNS is a versatile nameserver which supports a large number
151 of different backends ranging from simple zonefiles to relational
152 databases and load balancing/failover algorithms.
153 PowerDNS tries to emphasize speed and security.
154
155 This package contains the $(if $(5),$(5),$(1)) backend for the PowerDNS nameserver.
156 endef
157 endef
158
159 $(eval $(call DefinePdnsBackend,geoip,,libmaxminddb libyaml-cpp,,GeoIP))
160 $(eval $(call DefinePdnsBackend,mysql,,libmysqlclient,gmysql,MySQL))
161 $(eval $(call DefinePdnsBackend,odbc,,unixodbc,godbc,ODBC))
162 $(eval $(call DefinePdnsBackend,pgsql,,libpq,gpgsql,PostgreSQL))
163 $(eval $(call DefinePdnsBackend,sqlite3,,libsqlite3,gsqlite3,SQLite 3))
164 $(eval $(call DefinePdnsBackend,ldap,,libopenldap krb5-libs,,OpenLDAP))
165 $(eval $(call DefinePdnsBackend,lua2,,lua liblua,,Lua2))
166 $(eval $(call DefinePdnsBackend,pipe,,,,Pipe))
167 $(eval $(call DefinePdnsBackend,remote,,,,Remote))
168
169 define Package/pdns/conffiles
170 /etc/powerdns/pdns.conf
171 /etc/init.d/pdns
172 endef
173
174 TARGET_CXX+=-std=c++17
175
176 CONFIGURE_ARGS+= \
177 --sysconfdir=/etc/powerdns \
178 --libdir=/usr/lib/powerdns \
179 --with-dynmodules="$(foreach backend,$(PDNS_BACKENDS),$(if $(CONFIG_PACKAGE_pdns-backend-$(backend)),$(PDNS_BACKEND_$(backend)_LIB),))" \
180 --with-lua="lua" \
181 --with-modules="bind" \
182 --with-mysql-lib=$(STAGING_DIR)/usr \
183 --with-mysql-includes=$(STAGING_DIR)/usr \
184 $(if $(CONFIG_PACKAGE_pdns-tools),--enable-tools,) \
185 --with-protobuf \
186 --without-libsodium \
187 --enable-experimental-pkcs11 \
188 --enable-lua-records \
189 --enable-reproducible \
190 $(if $(CONFIG_PACKAGE_pdns-ixfrdist),--enable-ixfrdist,)
191
192 define Package/pdns/install
193 $(INSTALL_DIR) $(1)/etc/powerdns
194 $(INSTALL_CONF) ./files/pdns.conf-dist $(1)/etc/powerdns/pdns.conf-dist
195 $(INSTALL_DIR) $(1)/etc/init.d
196 $(INSTALL_BIN) ./files/pdns.init $(1)/etc/init.d/pdns
197 $(INSTALL_DIR) $(1)/usr/bin
198 $(CP) $(PKG_INSTALL_DIR)/usr/bin/pdns_control $(1)/usr/bin/
199 $(CP) $(PKG_INSTALL_DIR)/usr/bin/pdnsutil $(1)/usr/bin/
200 $(CP) $(PKG_INSTALL_DIR)/usr/bin/zone2sql $(1)/usr/bin/
201 $(CP) $(PKG_INSTALL_DIR)/usr/bin/zone2json $(1)/usr/bin/
202 $(INSTALL_DIR) $(1)/usr/sbin
203 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pdns_server $(1)/usr/sbin/
204 endef
205
206 define Package/pdns/Default/install
207 $(INSTALL_DIR) $(1)/usr/lib/powerdns/pdns
208 $(CP) $(PKG_INSTALL_DIR)/usr/lib/powerdns/pdns/lib$(PDNS_BACKEND_$(2)_LIB)backend.so $(1)/usr/lib/powerdns/pdns/
209 if [ "$(PDNS_BACKEND_$(2)_LIB)" == "ldap" ]; then \
210 $(INSTALL_DIR) $(1)/usr/bin; \
211 $(CP) $(PKG_INSTALL_DIR)/usr/bin/zone2ldap $(1)/usr/bin/; \
212 fi
213 endef
214
215 define Package/pdns-ixfrdist/install
216 $(INSTALL_DIR) $(1)/etc/powerdns
217 $(CP) $(PKG_INSTALL_DIR)/etc/powerdns/ixfrdist.example.yml $(1)/etc/powerdns/
218 $(INSTALL_DIR) $(1)/usr/bin
219 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ixfrdist $(1)/usr/bin/
220 endef
221
222 define Package/pdns-tools/install
223 $(INSTALL_DIR) $(1)/usr/bin
224 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsgram $(1)/usr/bin/
225 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsreplay $(1)/usr/bin/
226 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsscan $(1)/usr/bin/
227 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsscope $(1)/usr/bin/
228 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnswasher $(1)/usr/bin/
229 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dumresp $(1)/usr/bin/
230 $(CP) $(PKG_INSTALL_DIR)/usr/bin/pdns_notify $(1)/usr/bin/
231 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nproxy $(1)/usr/bin/
232 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nsec3dig $(1)/usr/bin/
233 $(CP) $(PKG_INSTALL_DIR)/usr/bin/saxfr $(1)/usr/bin/
234 $(CP) $(PKG_INSTALL_DIR)/usr/bin/stubquery $(1)/usr/bin/
235 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ixplore $(1)/usr/bin/
236 $(CP) $(PKG_INSTALL_DIR)/usr/bin/sdig $(1)/usr/bin/
237 $(CP) $(PKG_INSTALL_DIR)/usr/bin/calidns $(1)/usr/bin/
238 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsbulktest $(1)/usr/bin/
239 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnstcpbench $(1)/usr/bin/
240 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnspcap2protobuf $(1)/usr/bin/
241 endef
242
243 define BuildPdnsBackend
244 define Package/pdns-backend-$(1)/install
245 $(call Package/pdns/Default/install,$$(1),$(1))
246 endef
247
248 $$(eval $$(call BuildPackage,pdns-backend-$(1)))
249 endef
250
251 $(foreach backend,$(PDNS_BACKENDS),$(eval $(call BuildPdnsBackend,$(backend))))
252 $(eval $(call BuildPackage,pdns))
253 $(eval $(call BuildPackage,pdns-tools))
254 $(eval $(call BuildPackage,pdns-ixfrdist))