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.

160 lines
3.9 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=dnsdist
  3. PKG_VERSION:=1.6.0
  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:=a7783a04d8d4ad2b0168ffaaf85ef95d5f557057b0462280684dd799d0cdd292
  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_TLS
  44. depends on !DNSDIST_NOSSL
  45. bool "DNS over TLS Support"
  46. help
  47. "Enabled DNS over TLS Support for dnsdist"
  48. default y
  49. config DNSDIST_NET_SNMP
  50. bool "Net-SNMP support"
  51. help
  52. "Enable Net-SNMP support for dnsdist"
  53. default y
  54. config DNSDIST_RE2
  55. bool "RE2 support"
  56. help
  57. "Enable RE2 support for dnsdist"
  58. default y
  59. config DNSDIST_DNSTAP
  60. bool "DNSTAP support"
  61. help
  62. "Enable DNSTAP support for dnsdist"
  63. default y
  64. config DNSDIST_SODIUM
  65. bool "Build with libsodium"
  66. help
  67. "Build with libsodium - for encrypted console connections, and DNSCrypt"
  68. default y
  69. endmenu
  70. endef
  71. define Package/dnsdist
  72. SECTION:=net
  73. CATEGORY:=Network
  74. SUBMENU:=IP Addresses and Names
  75. TITLE:=dnsdist DNS-, DOS- and abuse-aware loadbalancer
  76. DEPENDS:= \
  77. +DNSDIST_DNS_OVER_HTTPS:libh2o-evloop \
  78. +DNSDIST_GNUTLS:libgnutls \
  79. +DNSDIST_OPENSSL:libopenssl \
  80. +DNSDIST_NET_SNMP:libnetsnmp \
  81. +DNSDIST_RE2:re2 \
  82. +DNSDIST_DNSTAP:libfstrm \
  83. +DNSDIST_SODIUM:libsodium \
  84. +libatomic \
  85. +libcap \
  86. +libedit \
  87. +libstdcpp \
  88. +lmdb \
  89. +liblua \
  90. +tinycdb
  91. URL:=https://dnsdist.org/
  92. endef
  93. define Package/dnsdist/description
  94. dnsdist is a highly DNS-, DoS- and abuse-aware loadbalancer. Its goal in life
  95. is to route traffic to the best server, delivering top performance to legitimate
  96. users while shunting or blocking abusive traffic.
  97. endef
  98. define Package/dnsdist/conffiles
  99. /etc/dnsdist.conf
  100. /etc/config/dnsdist
  101. /etc/init.d/dnsdist
  102. endef
  103. # not everything groks --disable-nls
  104. DISABLE_NLS:=
  105. # OpenWRT's setting of CXX destroys dnsdist's -std=c++17
  106. # --with-re2 compensates for that because it compensates for a bug in re2.pc that also destroys it
  107. # so this addition is for the --without-re2 case
  108. #
  109. # none of this is pretty
  110. TARGET_CXX+=-std=c++17
  111. CONFIGURE_ARGS+= \
  112. --with-pic \
  113. --with-lua=lua \
  114. $(if $(CONFIG_DNSDIST_SODIUM),--enable-dnscrypt --with-libsodium,--disable-dnscrypt --without-libsodium) \
  115. $(if $(CONFIG_DNSDIST_DNSTAP),--enable-dnstap=yes,--enable-dnstap=no) \
  116. $(if $(CONFIG_DNSDIST_RE2),--with,--without)-re2 \
  117. $(if $(CONFIG_DNSDIST_NET_SNMP),--with,--without)-net-snmp \
  118. $(if $(CONFIG_DNSDIST_GNUTLS),--with,--without)-gnutls \
  119. $(if $(CONFIG_DNSDIST_OPENSSL),--with,--without)-libssl \
  120. $(if $(CONFIG_DNSDIST_DNS_OVER_TLS),--enable-dns-over-tls,) \
  121. $(if $(CONFIG_DNSDIST_DNS_OVER_HTTPS),--enable-dns-over-https,)
  122. define Package/dnsdist/install
  123. $(INSTALL_DIR) $(1)/etc
  124. $(INSTALL_CONF) ./files/dnsdist.conf $(1)/etc/dnsdist.conf
  125. $(INSTALL_DIR) $(1)/etc/config
  126. $(INSTALL_CONF) ./files/dnsdist.config $(1)/etc/config/dnsdist
  127. $(INSTALL_DIR) $(1)/etc/init.d
  128. $(INSTALL_BIN) ./files/dnsdist.init $(1)/etc/init.d/dnsdist
  129. $(INSTALL_DIR) $(1)/usr/bin
  130. $(INSTALL_BIN) $(PKG_BUILD_DIR)/dnsdist $(1)/usr/bin/
  131. endef
  132. $(eval $(call BuildPackage,dnsdist))