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.

252 lines
8.6 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=pdns
  3. PKG_VERSION:=4.4.1
  4. PKG_RELEASE:=$(AUTORELEASE)
  5. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  6. PKG_SOURCE_URL:=https://downloads.powerdns.com/releases/
  7. PKG_HASH:=03fa7c181c666a5fc44a49affe7666bd385d46c1fe15088caff175967e85ab6c
  8. PKG_MAINTAINER:=Peter van Dijk <peter.van.dijk@powerdns.com>
  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 protobuf-c/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. # 5: friendly display name
  105. define DefinePdnsBackend
  106. PDNS_DEPENDS+= +pdns-backend-$(1)
  107. PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_pdns-backend$(1)
  108. PDNS_BACKENDS+= $(1)
  109. PDNS_BACKEND_$(1)_DESC=$(if $(5),$(5),$(1))
  110. PDNS_BACKEND_$(1)_LIB=$(if $(4),$(4),$(1))
  111. define Package/pdns-backend-$(1)
  112. $(call Package/pdns/Default)
  113. TITLE+= ($(1))
  114. DEPENDS+= pdns $$(foreach backend,$(2),+pdns-backend-$$(backend)) \
  115. $$(foreach dependency,$(3),+$$(dependency))
  116. HIDDEN:=1
  117. endef
  118. define Package/pdns-backend-$(1)/description
  119. PowerDNS is a versatile nameserver which supports a large number
  120. of different backends ranging from simple zonefiles to relational
  121. databases and load balancing/failover algorithms.
  122. PowerDNS tries to emphasize speed and security.
  123. This package contains the $(if $(5),$(5),$(1)) backend for the PowerDNS nameserver.
  124. endef
  125. endef
  126. $(eval $(call DefinePdnsBackend,geoip,,libmaxminddb libyaml-cpp,,GeoIP))
  127. $(eval $(call DefinePdnsBackend,mysql,,libmysqlclient,gmysql,MySQL))
  128. $(eval $(call DefinePdnsBackend,odbc,,unixodbc,godbc,ODBC))
  129. $(eval $(call DefinePdnsBackend,pgsql,,libpq,gpgsql,PostgreSQL))
  130. $(eval $(call DefinePdnsBackend,sqlite3,,libsqlite3,gsqlite3,SQLite 3))
  131. $(eval $(call DefinePdnsBackend,ldap,,libopenldap krb5-libs,,OpenLDAP))
  132. $(eval $(call DefinePdnsBackend,lua2,,lua liblua,,Lua2))
  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. --enable-reproducible \
  153. $(if $(CONFIG_PACKAGE_pdns-ixfrdist),--enable-ixfrdist,)
  154. define Package/pdns/install
  155. $(INSTALL_DIR) $(1)/etc/powerdns
  156. $(INSTALL_CONF) ./files/pdns.conf-dist $(1)/etc/powerdns/pdns.conf-dist
  157. $(INSTALL_DIR) $(1)/etc/init.d
  158. $(INSTALL_BIN) ./files/pdns.init $(1)/etc/init.d/pdns
  159. $(INSTALL_DIR) $(1)/usr/bin
  160. $(CP) $(PKG_INSTALL_DIR)/usr/bin/pdns_control $(1)/usr/bin/
  161. $(CP) $(PKG_INSTALL_DIR)/usr/bin/pdnsutil $(1)/usr/bin/
  162. $(CP) $(PKG_INSTALL_DIR)/usr/bin/zone2sql $(1)/usr/bin/
  163. $(CP) $(PKG_INSTALL_DIR)/usr/bin/zone2json $(1)/usr/bin/
  164. $(INSTALL_DIR) $(1)/usr/sbin
  165. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pdns_server $(1)/usr/sbin/
  166. endef
  167. define Package/pdns/Default/install
  168. $(INSTALL_DIR) $(1)/usr/lib/powerdns/pdns
  169. $(CP) $(PKG_INSTALL_DIR)/usr/lib/powerdns/pdns/lib$(PDNS_BACKEND_$(2)_LIB)backend.so $(1)/usr/lib/powerdns/pdns/
  170. if [ "$(PDNS_BACKEND_$(2)_LIB)" == "ldap" ]; then \
  171. $(INSTALL_DIR) $(1)/usr/bin; \
  172. $(CP) $(PKG_INSTALL_DIR)/usr/bin/zone2ldap $(1)/usr/bin/; \
  173. fi
  174. endef
  175. define Package/pdns-ixfrdist/install
  176. $(INSTALL_DIR) $(1)/etc/powerdns
  177. $(CP) $(PKG_INSTALL_DIR)/etc/powerdns/ixfrdist.example.yml $(1)/etc/powerdns/
  178. $(INSTALL_DIR) $(1)/usr/bin
  179. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ixfrdist $(1)/usr/bin/
  180. endef
  181. define Package/pdns-tools/install
  182. $(INSTALL_DIR) $(1)/usr/bin
  183. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsgram $(1)/usr/bin/
  184. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsreplay $(1)/usr/bin/
  185. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsscan $(1)/usr/bin/
  186. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsscope $(1)/usr/bin/
  187. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnswasher $(1)/usr/bin/
  188. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dumresp $(1)/usr/bin/
  189. $(CP) $(PKG_INSTALL_DIR)/usr/bin/pdns_notify $(1)/usr/bin/
  190. $(CP) $(PKG_INSTALL_DIR)/usr/bin/nproxy $(1)/usr/bin/
  191. $(CP) $(PKG_INSTALL_DIR)/usr/bin/nsec3dig $(1)/usr/bin/
  192. $(CP) $(PKG_INSTALL_DIR)/usr/bin/saxfr $(1)/usr/bin/
  193. $(CP) $(PKG_INSTALL_DIR)/usr/bin/stubquery $(1)/usr/bin/
  194. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ixplore $(1)/usr/bin/
  195. $(CP) $(PKG_INSTALL_DIR)/usr/bin/sdig $(1)/usr/bin/
  196. $(CP) $(PKG_INSTALL_DIR)/usr/bin/calidns $(1)/usr/bin/
  197. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsbulktest $(1)/usr/bin/
  198. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnstcpbench $(1)/usr/bin/
  199. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnspcap2protobuf $(1)/usr/bin/
  200. endef
  201. define BuildPdnsBackend
  202. define Package/pdns-backend-$(1)/install
  203. $(call Package/pdns/Default/install,$$(1),$(1))
  204. endef
  205. $$(eval $$(call BuildPackage,pdns-backend-$(1)))
  206. endef
  207. $(foreach backend,$(PDNS_BACKENDS),$(eval $(call BuildPdnsBackend,$(backend))))
  208. $(eval $(call BuildPackage,pdns))
  209. $(eval $(call BuildPackage,pdns-tools))
  210. $(eval $(call BuildPackage,pdns-ixfrdist))