prometheus-node-exporter-lua: add dawn exporter
[feed/packages.git] / net / pdns / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=pdns
4 PKG_VERSION:=4.2.1
5 PKG_RELEASE:=3
6
7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
8 PKG_SOURCE_URL:=https://downloads.powerdns.com/releases/
9 PKG_HASH:=f65019986b8fcbb1c6fffebcded04b2b397b84395830f4c63e8d119bcfa1aa28
10
11 PKG_MAINTAINER:=James Taylor <james@jtaylor.id.au>
12 PKG_LICENCE:=GPL-2.0-only
13 PKG_LICENCE_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,lua,,lua liblua,,Lua))
166 $(eval $(call DefinePdnsBackend,lua2,,lua liblua,,Lua2))
167 $(eval $(call DefinePdnsBackend,mydns,,libmysqlclient,,MyDNS))
168 $(eval $(call DefinePdnsBackend,pipe,,,,Pipe))
169 $(eval $(call DefinePdnsBackend,remote,,,,Remote))
170
171 define Package/pdns/conffiles
172 /etc/powerdns/pdns.conf
173 /etc/init.d/pdns
174 endef
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 random" \
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 $(if $(CONFIG_PACKAGE_pdns-ixfrdist),--enable-ixfrdist,)
190
191 define Package/pdns/install
192 $(INSTALL_DIR) $(1)/etc/powerdns
193 $(INSTALL_CONF) ./files/pdns.conf-dist $(1)/etc/powerdns/pdns.conf-dist
194 $(INSTALL_DIR) $(1)/etc/init.d
195 $(INSTALL_BIN) ./files/pdns.init $(1)/etc/init.d/pdns
196 $(INSTALL_DIR) $(1)/usr/bin
197 $(CP) $(PKG_INSTALL_DIR)/usr/bin/pdns_control $(1)/usr/bin/
198 $(CP) $(PKG_INSTALL_DIR)/usr/bin/pdnsutil $(1)/usr/bin/
199 $(CP) $(PKG_INSTALL_DIR)/usr/bin/zone2sql $(1)/usr/bin/
200 $(CP) $(PKG_INSTALL_DIR)/usr/bin/zone2json $(1)/usr/bin/
201 $(INSTALL_DIR) $(1)/usr/sbin
202 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pdns_server $(1)/usr/sbin/
203 endef
204
205 define Package/pdns/Default/install
206 $(INSTALL_DIR) $(1)/usr/lib/powerdns/pdns
207 $(CP) $(PKG_INSTALL_DIR)/usr/lib/powerdns/pdns/lib$(PDNS_BACKEND_$(2)_LIB)backend.so $(1)/usr/lib/powerdns/pdns/
208 if [ "$(PDNS_BACKEND_$(2)_LIB)" == "ldap" ]; then \
209 $(INSTALL_DIR) $(1)/usr/bin; \
210 $(CP) $(PKG_INSTALL_DIR)/usr/bin/zone2ldap $(1)/usr/bin/; \
211 fi
212 endef
213
214 define Package/pdns-ixfrdist/install
215 $(INSTALL_DIR) $(1)/etc/powerdns
216 $(CP) $(PKG_INSTALL_DIR)/etc/powerdns/ixfrdist.example.yml $(1)/etc/powerdns/
217 $(INSTALL_DIR) $(1)/usr/bin
218 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ixfrdist $(1)/usr/bin/
219 endef
220
221 define Package/pdns-tools/install
222 $(INSTALL_DIR) $(1)/usr/bin
223 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsgram $(1)/usr/bin/
224 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsreplay $(1)/usr/bin/
225 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsscan $(1)/usr/bin/
226 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsscope $(1)/usr/bin/
227 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnswasher $(1)/usr/bin/
228 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dumresp $(1)/usr/bin/
229 $(CP) $(PKG_INSTALL_DIR)/usr/bin/pdns_notify $(1)/usr/bin/
230 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nproxy $(1)/usr/bin/
231 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nsec3dig $(1)/usr/bin/
232 $(CP) $(PKG_INSTALL_DIR)/usr/bin/saxfr $(1)/usr/bin/
233 $(CP) $(PKG_INSTALL_DIR)/usr/bin/stubquery $(1)/usr/bin/
234 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ixplore $(1)/usr/bin/
235 $(CP) $(PKG_INSTALL_DIR)/usr/bin/sdig $(1)/usr/bin/
236 $(CP) $(PKG_INSTALL_DIR)/usr/bin/calidns $(1)/usr/bin/
237 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsbulktest $(1)/usr/bin/
238 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnstcpbench $(1)/usr/bin/
239 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnspcap2protobuf $(1)/usr/bin/
240 endef
241
242 define BuildPdnsBackend
243 define Package/pdns-backend-$(1)/install
244 $(call Package/pdns/Default/install,$$(1),$(1))
245 endef
246
247 $$(eval $$(call BuildPackage,pdns-backend-$(1)))
248 endef
249
250 $(foreach backend,$(PDNS_BACKENDS),$(eval $(call BuildPdnsBackend,$(backend))))
251 $(eval $(call BuildPackage,pdns))
252 $(eval $(call BuildPackage,pdns-tools))
253 $(eval $(call BuildPackage,pdns-ixfrdist))