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.

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