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.

216 lines
7.2 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=pdns
  3. PKG_VERSION:=4.1.10
  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:=5a46cfde92caaaa2e85af9a15acb9ad81b56f4c8a8255c457e6938d8c0cb15c7
  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_server
  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 +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
  72. $(call Package/pdns/Default)
  73. DEPENDS+=+boost +boost-program_options +liblua +libopenssl +libsodium +libsqlite3 +p11-kit
  74. endef
  75. define Package/pdns/config
  76. menu "Select PowerDNS backends"
  77. depends on PACKAGE_pdns
  78. comment "PowerDNS backends"
  79. $(foreach backend,$(PDNS_BACKENDS), \
  80. config PACKAGE_pdns-backend-$(backend)
  81. prompt "$(PDNS_BACKEND_$(backend)_DESC) backend"
  82. default m if ALL
  83. )
  84. endmenu
  85. endef
  86. # 1: short name
  87. # 2: dependencies on other PowerDNS libraries (short name)
  88. # 3: dependencies on other packages
  89. # 4: conditional/inward dependencies
  90. define DefinePdnsBackend
  91. PDNS_DEPENDS+= +pdns-backend-$(1)
  92. PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_pdns-backend$(1)
  93. PDNS_BACKENDS+= $(1)
  94. PDNS_BACKEND_$(1)_DESC=$(if $(5),$(5),$(1))
  95. PDNS_BACKEND_$(1)_LIB=$(if $(4),$(4),$(1))
  96. define Package/pdns-backend-$(1)
  97. $(call Package/pdns/Default)
  98. TITLE+= ($(1))
  99. DEPENDS+= pdns $$(foreach backend,$(2),+pdns-backend-$$(backend)) $(3)
  100. HIDDEN:=1
  101. endef
  102. define Package/pdns-backend-$(1)/description
  103. PowerDNS is a versatile nameserver which supports a large number
  104. of different backends ranging from simple zonefiles to relational
  105. databases and load balancing/failover algorithms.
  106. PowerDNS tries to emphasize speed and security.
  107. This package contains the $(if $(5),$(5),$(1)) backend for the PowerDNS nameserver.
  108. endef
  109. endef
  110. $(eval $(call DefinePdnsBackend,mysql,,libmysqlclient,gmysql,MySQL))
  111. $(eval $(call DefinePdnsBackend,odbc,,unixodbc,godbc,ODBC))
  112. $(eval $(call DefinePdnsBackend,pgsql,,libpq,gpgsql,PostgreSQL))
  113. $(eval $(call DefinePdnsBackend,sqlite3,,libsqlite3,gsqlite3,SQLite 3))
  114. $(eval $(call DefinePdnsBackend,ldap,,libopenldap krb5-libs,,OpenLDAP))
  115. $(eval $(call DefinePdnsBackend,lua,,lua liblua,,Lua))
  116. $(eval $(call DefinePdnsBackend,mydns,,libmysqlclient,,MyDNS))
  117. $(eval $(call DefinePdnsBackend,pipe,,,,Pipe))
  118. $(eval $(call DefinePdnsBackend,remote,,,,Remote))
  119. define Package/pdns/conffiles
  120. /etc/powerdns/pdns.conf
  121. /etc/init.d/pdns
  122. endef
  123. CONFIGURE_ARGS+= \
  124. --sysconfdir=/etc/powerdns \
  125. --libdir=/usr/lib/powerdns \
  126. --with-dynmodules="$(foreach backend,$(PDNS_BACKENDS),$(if $(CONFIG_PACKAGE_pdns-backend-$(backend)),$(PDNS_BACKEND_$(backend)_LIB),))" \
  127. --with-modules="bind random" \
  128. --with-mysql-lib=$(STAGING_DIR)/usr \
  129. --with-mysql-includes=$(STAGING_DIR)/usr \
  130. $(if $(CONFIG_PACKAGE_pdns-tools),--enable-tools,) \
  131. --with-protobuf \
  132. --enable-libsodium \
  133. --enable-experimental-pkcs11
  134. define Package/pdns/install
  135. $(INSTALL_DIR) $(1)/etc/powerdns
  136. $(INSTALL_CONF) ./files/pdns.conf-dist $(1)/etc/powerdns/pdns.conf-dist
  137. $(INSTALL_DIR) $(1)/etc/init.d
  138. $(INSTALL_BIN) ./files/pdns.init $(1)/etc/init.d/pdns
  139. $(INSTALL_DIR) $(1)/usr/bin
  140. $(CP) $(PKG_INSTALL_DIR)/usr/bin/pdns_control $(1)/usr/bin/
  141. $(CP) $(PKG_INSTALL_DIR)/usr/bin/pdnsutil $(1)/usr/bin/
  142. $(CP) $(PKG_INSTALL_DIR)/usr/bin/zone2sql $(1)/usr/bin/
  143. $(CP) $(PKG_INSTALL_DIR)/usr/bin/zone2json $(1)/usr/bin/
  144. $(INSTALL_DIR) $(1)/usr/sbin
  145. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pdns_server $(1)/usr/sbin/
  146. endef
  147. define Package/pdns/Default/install
  148. $(INSTALL_DIR) $(1)/usr/lib/powerdns/pdns
  149. $(CP) $(PKG_INSTALL_DIR)/usr/lib/powerdns/pdns/lib$(PDNS_BACKEND_$(2)_LIB)backend.so $(1)/usr/lib/powerdns/pdns/
  150. endef
  151. define Package/pdns-tools/install
  152. $(INSTALL_DIR) $(1)/usr/bin
  153. $(CP) $(PKG_INSTALL_DIR)/usr/bin/calidns $(1)/usr/bin/
  154. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsbulktest $(1)/usr/bin/
  155. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsgram $(1)/usr/bin/
  156. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnspcap2protobuf $(1)/usr/bin/
  157. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsreplay $(1)/usr/bin/
  158. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsscan $(1)/usr/bin/
  159. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnsscope $(1)/usr/bin/
  160. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnstcpbench $(1)/usr/bin/
  161. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnswasher $(1)/usr/bin/
  162. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dumresp $(1)/usr/bin/
  163. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ixplore $(1)/usr/bin/
  164. $(CP) $(PKG_INSTALL_DIR)/usr/bin/nproxy $(1)/usr/bin/
  165. $(CP) $(PKG_INSTALL_DIR)/usr/bin/nsec3dig $(1)/usr/bin/
  166. $(CP) $(PKG_INSTALL_DIR)/usr/bin/pdns_notify $(1)/usr/bin/
  167. $(CP) $(PKG_INSTALL_DIR)/usr/bin/saxfr $(1)/usr/bin/
  168. $(CP) $(PKG_INSTALL_DIR)/usr/bin/sdig $(1)/usr/bin/
  169. endef
  170. define BuildPdnsBackend
  171. define Package/pdns-backend-$(1)/install
  172. $(call Package/pdns/Default/install,$$(1),$(1))
  173. endef
  174. $$(eval $$(call BuildPackage,pdns-backend-$(1)))
  175. endef
  176. $(foreach backend,$(PDNS_BACKENDS),$(eval $(call BuildPdnsBackend,$(backend))))
  177. $(eval $(call BuildPackage,pdns))
  178. $(eval $(call BuildPackage,pdns-tools))