You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

248 lines
8.4 KiB

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