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.

169 lines
4.2 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=dnsdist
  3. PKG_VERSION:=1.7.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:=273a8212be2ddfaf754f752bcda4c2abc671ca5d42f776263312eb4661ea2d66
  8. PKG_MAINTAINER:=Peter van Dijk <peter.van.dijk@powerdns.com>
  9. PKG_LICENSE:=GPL-2.0-only
  10. PKG_LICENSE_FILES:=COPYING
  11. PKG_CPE_ID:=cpe:/a:powerdns:dnsdist
  12. PKG_INSTALL:=1
  13. PKG_BUILD_PARALLEL:=1
  14. PKG_ASLR_PIE:=0
  15. PKG_BUILD_DEPENDS:=boost
  16. PKG_CONFIG_DEPENDS:= \
  17. CONFIG_DNSDIST_GNUTLS \
  18. CONFIG_DNSDIST_OPENSSL
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/dnsdist/config
  21. menu "Configuration"
  22. depends on PACKAGE_dnsdist
  23. comment "SSL Support"
  24. choice
  25. prompt "Selected SSL library"
  26. default DNSDIST_OPENSSL
  27. config DNSDIST_OPENSSL
  28. bool "OpenSSL"
  29. config DNSDIST_GNUTLS
  30. bool "GnuTLS"
  31. config DNSDIST_NOSSL
  32. bool "No SSL support"
  33. endchoice
  34. comment "DNS over HTTPS/TLS Support"
  35. depends on !DNSDIST_NOSSL
  36. config DNSDIST_DNS_OVER_HTTPS
  37. depends on DNSDIST_OPENSSL
  38. depends on !DNSDIST_NOSSL
  39. bool "DNS over HTTPS Support"
  40. help
  41. "Enables DNS over HTTPS Support for dnsdist"
  42. default y
  43. config DNSDIST_DNS_OVER_HTTPS_OUTGOING
  44. depends on !DNSDIST_NOSSL
  45. bool "Outgoing DNS over HTTPS Support"
  46. help
  47. "Enables Outgoing DNS over HTTPS Support for dnsdist"
  48. default y
  49. config DNSDIST_DNS_OVER_TLS
  50. depends on !DNSDIST_NOSSL
  51. bool "DNS over TLS Support"
  52. help
  53. "Enabled DNS over TLS Support for dnsdist"
  54. default y
  55. config DNSDIST_NET_SNMP
  56. bool "Net-SNMP support"
  57. help
  58. "Enable Net-SNMP support for dnsdist"
  59. default y
  60. config DNSDIST_RE2
  61. bool "RE2 support"
  62. help
  63. "Enable RE2 support for dnsdist"
  64. default y
  65. config DNSDIST_DNSTAP
  66. bool "DNSTAP support"
  67. help
  68. "Enable DNSTAP support for dnsdist"
  69. default y
  70. config DNSDIST_SODIUM
  71. bool "Build with libsodium"
  72. help
  73. "Build with libsodium - for encrypted console connections, and DNSCrypt"
  74. default y
  75. endmenu
  76. endef
  77. define Package/dnsdist
  78. SECTION:=net
  79. CATEGORY:=Network
  80. SUBMENU:=IP Addresses and Names
  81. TITLE:=dnsdist DNS-, DOS- and abuse-aware loadbalancer
  82. DEPENDS:= \
  83. +DNSDIST_DNS_OVER_HTTPS:libh2o-evloop \
  84. +DNSDIST_DNS_OVER_HTTPS_OUTGOING:libnghttp2 \
  85. +DNSDIST_GNUTLS:libgnutls \
  86. +DNSDIST_OPENSSL:libopenssl \
  87. +DNSDIST_NET_SNMP:libnetsnmp \
  88. +DNSDIST_RE2:re2 \
  89. +DNSDIST_DNSTAP:libfstrm \
  90. +DNSDIST_SODIUM:libsodium \
  91. +libatomic \
  92. +libcap \
  93. +libedit \
  94. +libstdcpp \
  95. +lmdb \
  96. +liblua \
  97. +tinycdb
  98. URL:=https://dnsdist.org/
  99. endef
  100. define Package/dnsdist/description
  101. dnsdist is a highly DNS-, DoS- and abuse-aware loadbalancer. Its goal in life
  102. is to route traffic to the best server, delivering top performance to legitimate
  103. users while shunting or blocking abusive traffic.
  104. endef
  105. define Package/dnsdist/conffiles
  106. /etc/dnsdist.conf
  107. /etc/config/dnsdist
  108. /etc/init.d/dnsdist
  109. endef
  110. # not everything groks --disable-nls
  111. DISABLE_NLS:=
  112. # OpenWRT's setting of CXX destroys dnsdist's -std=c++17
  113. # --with-re2 compensates for that because it compensates for a bug in re2.pc that also destroys it
  114. # so this addition is for the --without-re2 case
  115. #
  116. # none of this is pretty
  117. TARGET_CXX+=-std=c++17
  118. CONFIGURE_ARGS+= \
  119. --with-pic \
  120. --with-lua=lua \
  121. $(if $(CONFIG_DNSDIST_SODIUM),--enable-dnscrypt --with-libsodium,--disable-dnscrypt --without-libsodium) \
  122. $(if $(CONFIG_DNSDIST_DNSTAP),--enable-dnstap=yes,--enable-dnstap=no) \
  123. $(if $(CONFIG_DNSDIST_RE2),--with,--without)-re2 \
  124. $(if $(CONFIG_DNSDIST_NET_SNMP),--with,--without)-net-snmp \
  125. $(if $(CONFIG_DNSDIST_GNUTLS),--with,--without)-gnutls \
  126. $(if $(CONFIG_DNSDIST_OPENSSL),--with,--without)-libssl \
  127. $(if $(CONFIG_DNSDIST_DNS_OVER_TLS),--enable-dns-over-tls,) \
  128. $(if $(CONFIG_DNSDIST_DNS_OVER_HTTPS),--enable-dns-over-https,) \
  129. $(if $(CONFIG_DNSDIST_DNS_OVER_HTTPS_OUTGOING),--with,--without)-nghttp2
  130. define Package/dnsdist/install
  131. $(INSTALL_DIR) $(1)/etc
  132. $(INSTALL_CONF) ./files/dnsdist.conf $(1)/etc/dnsdist.conf
  133. $(INSTALL_DIR) $(1)/etc/config
  134. $(INSTALL_CONF) ./files/dnsdist.config $(1)/etc/config/dnsdist
  135. $(INSTALL_DIR) $(1)/etc/init.d
  136. $(INSTALL_BIN) ./files/dnsdist.init $(1)/etc/init.d/dnsdist
  137. $(INSTALL_DIR) $(1)/usr/bin
  138. $(INSTALL_BIN) $(PKG_BUILD_DIR)/dnsdist $(1)/usr/bin/
  139. endef
  140. $(eval $(call BuildPackage,dnsdist))