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.

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