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.

269 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.13.1
  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:=8504d97b8fc5bd897345c95d116e0ee0ddf8c8ff99590ab2b4bd13278c9f50b8
  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_ARGS += \
  138. --disable-dsa \
  139. --disable-gost \
  140. --enable-allsymbols \
  141. --enable-ecdsa \
  142. --enable-tfo-client \
  143. --enable-tfo-server \
  144. --with-libexpat="$(STAGING_DIR)/usr" \
  145. --with-ssl="$(STAGING_DIR)/usr" \
  146. --with-user=unbound \
  147. --with-run-dir=/var/lib/unbound \
  148. --with-conf-file=/var/lib/unbound/unbound.conf \
  149. --with-pidfile=/var/run/unbound.pid \
  150. $(if $(CONFIG_PACKAGE_libunbound_dnscrypt), \
  151. --enable-dnscrypt --with-libsodium="$(STAGING_DIR)/usr",) \
  152. $(if $(CONFIG_PACKAGE_libunbound_ipset), \
  153. --enable-ipset --with-libmnl="$(STAGING_DIR)/usr",) \
  154. $(if $(CONFIG_PACKAGE_libunbound_libevent), \
  155. --enable-event-api --with-libevent="$(STAGING_DIR)/usr",--without-libevent) \
  156. $(if $(CONFIG_PACKAGE_libunbound_nghttp2), \
  157. --with-libnghttp2="$(STAGING_DIR)/usr",) \
  158. $(if $(CONFIG_PACKAGE_libunbound_libpthread), \
  159. --with-pthreads,--without-pthreads --without-solaris-threads) \
  160. $(if $(CONFIG_PACKAGE_libunbound_python),--with-pythonmodule,) \
  161. $(if $(CONFIG_PACKAGE_libunbound_subnet),--enable-subnet,) \
  162. $(if $(CONFIG_PACKAGE_libunbound_dnstap),--enable-dnstap,) \
  163. define Package/unbound-daemon/conffiles
  164. /etc/config/unbound
  165. /etc/unbound/unbound.conf
  166. /etc/unbound/unbound_ext.conf
  167. /etc/unbound/unbound_srv.conf
  168. endef
  169. define Build/InstallDev
  170. $(INSTALL_DIR) $(1)/usr/lib
  171. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libunbound.{so*,a,la} $(1)/usr/lib/
  172. $(INSTALL_DIR) $(1)/usr/include
  173. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/unbound.h $(1)/usr/include/
  174. ifneq ($(CONFIG_PACKAGE_libunbound_libevent),)
  175. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/unbound-event.h $(1)/usr/include/
  176. endif
  177. endef
  178. define Package/unbound-daemon/install
  179. $(INSTALL_DIR) $(1)/usr/sbin
  180. $(INSTALL_BIN) \
  181. $(PKG_INSTALL_DIR)/usr/sbin/unbound $(1)/usr/sbin/
  182. $(INSTALL_DIR) $(1)/etc/unbound
  183. $(INSTALL_CONF) \
  184. $(PKG_INSTALL_DIR)/var/lib/unbound/unbound.conf \
  185. $(1)/etc/unbound/unbound.conf
  186. $(INSTALL_DATA) ./files/root.key $(1)/etc/unbound/root.key
  187. $(INSTALL_CONF) ./files/unbound_ext.conf $(1)/etc/unbound/unbound_ext.conf
  188. $(INSTALL_CONF) ./files/unbound_srv.conf $(1)/etc/unbound/unbound_srv.conf
  189. $(INSTALL_DIR) $(1)/etc/config
  190. $(INSTALL_CONF) ./files/unbound.uci $(1)/etc/config/unbound
  191. $(INSTALL_DIR) $(1)/etc/hotplug.d/ntp
  192. $(INSTALL_BIN) ./files/unbound.ntpd $(1)/etc/hotplug.d/ntp/25-unbound
  193. $(INSTALL_DIR) $(1)/etc/init.d
  194. $(INSTALL_BIN) ./files/unbound.init $(1)/etc/init.d/unbound
  195. $(INSTALL_DIR) $(1)/usr/lib/unbound
  196. $(INSTALL_DATA) ./files/defaults.sh $(1)/usr/lib/unbound/defaults.sh
  197. $(INSTALL_DATA) ./files/dnsmasq.sh $(1)/usr/lib/unbound/dnsmasq.sh
  198. $(INSTALL_DATA) ./files/iptools.sh $(1)/usr/lib/unbound/iptools.sh
  199. $(INSTALL_BIN) ./files/odhcpd.sh $(1)/usr/lib/unbound/odhcpd.sh
  200. $(INSTALL_DATA) ./files/odhcpd.awk $(1)/usr/lib/unbound/odhcpd.awk
  201. $(INSTALL_DATA) ./files/stopping.sh $(1)/usr/lib/unbound/stopping.sh
  202. $(INSTALL_DATA) ./files/unbound.sh $(1)/usr/lib/unbound/unbound.sh
  203. endef
  204. define Package/libunbound/install
  205. $(INSTALL_DIR) $(1)/usr/lib
  206. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunbound.so.* $(1)/usr/lib/
  207. endef
  208. define Package/unbound-anchor/install
  209. $(INSTALL_DIR) $(1)/usr/sbin
  210. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-anchor $(1)/usr/sbin/
  211. endef
  212. define Package/unbound-checkconf/install
  213. $(INSTALL_DIR) $(1)/usr/sbin
  214. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-checkconf $(1)/usr/sbin/
  215. endef
  216. define Package/unbound-control/install
  217. $(INSTALL_DIR) $(1)/usr/sbin
  218. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control $(1)/usr/sbin/
  219. endef
  220. define Package/unbound-control-setup/install
  221. $(INSTALL_DIR) $(1)/usr/sbin
  222. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control-setup $(1)/usr/sbin/
  223. endef
  224. define Package/unbound-host/install
  225. $(INSTALL_DIR) $(1)/usr/sbin
  226. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-host $(1)/usr/sbin/
  227. endef
  228. $(eval $(call BuildPackage,unbound-daemon))
  229. $(eval $(call BuildPackage,libunbound))
  230. $(eval $(call BuildPackage,unbound-anchor))
  231. $(eval $(call BuildPackage,unbound-checkconf))
  232. $(eval $(call BuildPackage,unbound-control))
  233. $(eval $(call BuildPackage,unbound-control-setup))
  234. $(eval $(call BuildPackage,unbound-host))