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.

271 lines
8.5 KiB

  1. #
  2. # Copyright (C) 2010-2016 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=unbound
  9. PKG_VERSION:=1.16.2
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://nlnetlabs.nl/downloads/unbound
  13. PKG_HASH:=2e32f283820c24c51ca1dd8afecfdb747c7385a137abe865c99db4b257403581
  14. PKG_MAINTAINER:=Eric Luehrsen <ericluehrsen@gmail.com>
  15. PKG_LICENSE:=BSD-3-Clause
  16. PKG_LICENSE_FILES:=LICENSE
  17. PKG_CPE_ID:=cpe:/a:nlnetlabs:unbound
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_FIXUP:=autoreconf
  20. PKG_INSTALL:=1
  21. PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_libunbound_dnscrypt \
  22. CONFIG_PACKAGE_libunbound_ipset \
  23. CONFIG_PACKAGE_libunbound_libevent \
  24. CONFIG_PACKAGE_libunbound_libpthread \
  25. CONFIG_PACKAGE_libunbound_nghttp2 \
  26. CONFIG_PACKAGE_libunbound_pythonmodule \
  27. CONFIG_PACKAGE_libunbound_subnet \
  28. CONFIG_PACKAGE_libunbound_dnstap
  29. include $(INCLUDE_DIR)/package.mk
  30. define Package/unbound/Default
  31. SECTION:=net
  32. CATEGORY:=Network
  33. SUBMENU:=IP Addresses and Names
  34. USERID:=unbound:unbound
  35. TITLE:=Recursive DNS Server
  36. URL:=https://nlnetlabs.nl/projects/unbound/about
  37. DEPENDS:=+ca-bundle +libopenssl +@OPENSSL_WITH_EC
  38. endef
  39. define Package/unbound-daemon
  40. $(call Package/unbound/Default)
  41. TITLE+= (daemon)
  42. DEPENDS+= +libunbound
  43. endef
  44. define Package/unbound-daemon/description
  45. This package contains the Unbound daemon including 'libevent', 'libmnl', and
  46. 'libpthread' to better handle large networks with heavy query loads. Options
  47. are available under libraries/network/libunbound to custom trim Unbound for
  48. smaller targets.
  49. endef
  50. define Package/libunbound
  51. $(call Package/unbound/Default)
  52. SECTION:=libs
  53. CATEGORY:=Libraries
  54. SUBMENU:=Networking
  55. TITLE+= (library)
  56. DEPENDS+=+PACKAGE_libunbound_dnscrypt:libsodium \
  57. +PACKAGE_libunbound_ipset:libmnl \
  58. +PACKAGE_libunbound_libevent:libevent2 \
  59. +PACKAGE_libunbound_libpthread:libpthread \
  60. +PACKAGE_libunbound_nghttp2:libnghttp2 \
  61. +PACKAGE_libunbound_pythonmodule:python3-base \
  62. +PACKAGE_libunbound_dnstap:libprotobuf-c
  63. endef
  64. define Package/libunbound/description
  65. This package contains the Unbound library including 'libevent', 'libmnl', and
  66. 'libpthread' to better handle large networks with heavy query loads. Options
  67. are available to custom trim Unbound for smaller targets.
  68. endef
  69. define Package/unbound-anchor
  70. $(call Package/unbound/Default)
  71. TITLE+= (root DSKEY)
  72. DEPENDS+= +unbound-daemon +libexpat
  73. endef
  74. define Package/unbound-anchor/description
  75. This package contains the Unbound anchor utility.
  76. endef
  77. define Package/unbound-checkconf
  78. $(call Package/unbound/Default)
  79. TITLE+= (config checker)
  80. DEPENDS+= +unbound-daemon
  81. endef
  82. define Package/unbound-checkconf/description
  83. This package contains the Unbound DNS configuration checker utility.
  84. endef
  85. define Package/unbound-control
  86. $(call Package/unbound/Default)
  87. TITLE+= (remote control)
  88. DEPENDS+= +unbound-daemon
  89. endef
  90. define Package/unbound-control/description
  91. This package contains the Unbound control utility.
  92. endef
  93. define Package/unbound-control-setup
  94. $(call Package/unbound/Default)
  95. TITLE+= (control setup)
  96. DEPENDS+= +unbound-control +openssl-util
  97. endef
  98. define Package/unbound-control-setup/description
  99. This package contains the Unbound control setup utility.
  100. endef
  101. define Package/unbound-host
  102. $(call Package/unbound/Default)
  103. TITLE+= (DNS lookup)
  104. DEPENDS+= +libunbound
  105. endef
  106. define Package/unbound-host/description
  107. This package contains the Unbound DNS lookup utility.
  108. endef
  109. define Package/libunbound/config
  110. if PACKAGE_libunbound
  111. config PACKAGE_libunbound_dnscrypt
  112. bool "Build with DNSCRYPT support."
  113. default n
  114. config PACKAGE_libunbound_ipset
  115. bool "Build with IPSET (libmnl) support."
  116. default y
  117. config PACKAGE_libunbound_libevent
  118. bool "Build with expanded network resource (libevent) support."
  119. default y
  120. config PACKAGE_libunbound_libpthread
  121. bool "Build with POSIX threading (libpthread) support."
  122. default y
  123. config PACKAGE_libunbound_nghttp2
  124. bool "Build with DNS over HTTPS support (nghttp2 framework)."
  125. default n
  126. config PACKAGE_libunbound_pythonmodule
  127. bool "Build with PYTHON module for prototyping and data analysis."
  128. default n
  129. config PACKAGE_libunbound_subnet
  130. bool "Build with SUBNET cache module support."
  131. default n
  132. config PACKAGE_libunbound_dnstap
  133. bool "Build with dnstap support."
  134. default n
  135. endif
  136. endef
  137. CONFIGURE_VARS += UNAME=Linux
  138. CONFIGURE_ARGS += \
  139. --disable-dsa \
  140. --disable-gost \
  141. --enable-allsymbols \
  142. --enable-ecdsa \
  143. --enable-tfo-client \
  144. --enable-tfo-server \
  145. --with-libexpat="$(STAGING_DIR)/usr" \
  146. --with-ssl="$(STAGING_DIR)/usr" \
  147. --with-user=unbound \
  148. --with-run-dir=/var/lib/unbound \
  149. --with-conf-file=/var/lib/unbound/unbound.conf \
  150. --with-pidfile=/var/run/unbound.pid \
  151. $(if $(CONFIG_PACKAGE_libunbound_dnscrypt), \
  152. --enable-dnscrypt --with-libsodium="$(STAGING_DIR)/usr",) \
  153. $(if $(CONFIG_PACKAGE_libunbound_ipset), \
  154. --enable-ipset --with-libmnl="$(STAGING_DIR)/usr",) \
  155. $(if $(CONFIG_PACKAGE_libunbound_libevent), \
  156. --enable-event-api --with-libevent="$(STAGING_DIR)/usr",--without-libevent) \
  157. $(if $(CONFIG_PACKAGE_libunbound_nghttp2), \
  158. --with-libnghttp2="$(STAGING_DIR)/usr",) \
  159. $(if $(CONFIG_PACKAGE_libunbound_libpthread), \
  160. --with-pthreads,--without-pthreads --without-solaris-threads) \
  161. $(if $(CONFIG_PACKAGE_libunbound_python),--with-pythonmodule,) \
  162. $(if $(CONFIG_PACKAGE_libunbound_subnet),--enable-subnet,) \
  163. $(if $(CONFIG_PACKAGE_libunbound_dnstap),--enable-dnstap,) \
  164. define Package/unbound-daemon/conffiles
  165. /etc/config/unbound
  166. /etc/unbound/unbound.conf
  167. /etc/unbound/unbound_ext.conf
  168. /etc/unbound/unbound_srv.conf
  169. endef
  170. define Build/InstallDev
  171. $(INSTALL_DIR) $(1)/usr/lib
  172. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libunbound.{so*,a,la} $(1)/usr/lib/
  173. $(INSTALL_DIR) $(1)/usr/include
  174. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/unbound.h $(1)/usr/include/
  175. ifneq ($(CONFIG_PACKAGE_libunbound_libevent),)
  176. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/unbound-event.h $(1)/usr/include/
  177. endif
  178. endef
  179. define Package/unbound-daemon/install
  180. $(INSTALL_DIR) $(1)/usr/sbin
  181. $(INSTALL_BIN) \
  182. $(PKG_INSTALL_DIR)/usr/sbin/unbound $(1)/usr/sbin/
  183. $(INSTALL_DIR) $(1)/etc/unbound
  184. $(INSTALL_CONF) \
  185. $(PKG_INSTALL_DIR)/var/lib/unbound/unbound.conf \
  186. $(1)/etc/unbound/unbound.conf
  187. $(INSTALL_DATA) ./files/root.key $(1)/etc/unbound/root.key
  188. $(INSTALL_CONF) ./files/unbound_ext.conf $(1)/etc/unbound/unbound_ext.conf
  189. $(INSTALL_CONF) ./files/unbound_srv.conf $(1)/etc/unbound/unbound_srv.conf
  190. $(INSTALL_DIR) $(1)/etc/config
  191. $(INSTALL_CONF) ./files/unbound.uci $(1)/etc/config/unbound
  192. $(INSTALL_DIR) $(1)/etc/hotplug.d/ntp
  193. $(INSTALL_BIN) ./files/unbound.ntpd $(1)/etc/hotplug.d/ntp/25-unbound
  194. $(INSTALL_DIR) $(1)/etc/init.d
  195. $(INSTALL_BIN) ./files/unbound.init $(1)/etc/init.d/unbound
  196. $(INSTALL_DIR) $(1)/usr/lib/unbound
  197. $(INSTALL_DATA) ./files/defaults.sh $(1)/usr/lib/unbound/defaults.sh
  198. $(INSTALL_DATA) ./files/dnsmasq.sh $(1)/usr/lib/unbound/dnsmasq.sh
  199. $(INSTALL_DATA) ./files/iptools.sh $(1)/usr/lib/unbound/iptools.sh
  200. $(INSTALL_BIN) ./files/odhcpd.sh $(1)/usr/lib/unbound/odhcpd.sh
  201. $(INSTALL_DATA) ./files/odhcpd.awk $(1)/usr/lib/unbound/odhcpd.awk
  202. $(INSTALL_DATA) ./files/stopping.sh $(1)/usr/lib/unbound/stopping.sh
  203. $(INSTALL_DATA) ./files/unbound.sh $(1)/usr/lib/unbound/unbound.sh
  204. endef
  205. define Package/libunbound/install
  206. $(INSTALL_DIR) $(1)/usr/lib
  207. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunbound.so.* $(1)/usr/lib/
  208. endef
  209. define Package/unbound-anchor/install
  210. $(INSTALL_DIR) $(1)/usr/sbin
  211. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-anchor $(1)/usr/sbin/
  212. endef
  213. define Package/unbound-checkconf/install
  214. $(INSTALL_DIR) $(1)/usr/sbin
  215. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-checkconf $(1)/usr/sbin/
  216. endef
  217. define Package/unbound-control/install
  218. $(INSTALL_DIR) $(1)/usr/sbin
  219. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control $(1)/usr/sbin/
  220. endef
  221. define Package/unbound-control-setup/install
  222. $(INSTALL_DIR) $(1)/usr/sbin
  223. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control-setup $(1)/usr/sbin/
  224. endef
  225. define Package/unbound-host/install
  226. $(INSTALL_DIR) $(1)/usr/sbin
  227. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-host $(1)/usr/sbin/
  228. endef
  229. $(eval $(call BuildPackage,unbound-daemon))
  230. $(eval $(call BuildPackage,libunbound))
  231. $(eval $(call BuildPackage,unbound-anchor))
  232. $(eval $(call BuildPackage,unbound-checkconf))
  233. $(eval $(call BuildPackage,unbound-control))
  234. $(eval $(call BuildPackage,unbound-control-setup))
  235. $(eval $(call BuildPackage,unbound-host))