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.

267 lines
7.8 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.10.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:=152f486578242fe5c36e89995d0440b78d64c05123990aae16246b7f776ce955
  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. include $(INCLUDE_DIR)/package.mk
  22. define Package/unbound/Default
  23. SECTION:=net
  24. CATEGORY:=Network
  25. SUBMENU:=IP Addresses and Names
  26. USERID:=unbound:unbound
  27. TITLE:=Recursive DNS Server
  28. URL:=https://nlnetlabs.nl/projects/unbound/about
  29. DEPENDS:=+libopenssl +@OPENSSL_WITH_EC
  30. endef
  31. define Package/unbound-daemon
  32. $(call Package/unbound/Default)
  33. TITLE+= (daemon, light traffic)
  34. DEPENDS+= +libunbound-light
  35. VARIANT:=light
  36. endef
  37. define Package/unbound-daemon/description
  38. This package contains the Unbound daemon with basic includes
  39. necessary to meet the needs of UCI/LuCI configuration optoins.
  40. endef
  41. define Package/unbound-daemon-heavy
  42. $(call Package/unbound/Default)
  43. TITLE+= (daemon, heavy traffic)
  44. URL:=https://nlnetlabs.nl/documentation/unbound/howto-optimise
  45. DEPENDS+= +libunbound-heavy +libpthread +libevent2 +libevent2-pthreads +libmnl
  46. VARIANT:=heavy
  47. PROVIDES:=unbound-daemon
  48. endef
  49. define Package/unbound-daemon-heavy/description
  50. This package contains the Unbound daemon including 'libevent' and
  51. 'libpthread' to better handle large networks with heavy query loads.
  52. It also offers ipset support.
  53. endef
  54. define Package/libunbound-light
  55. $(call Package/unbound/Default)
  56. SECTION:=libs
  57. CATEGORY:=Libraries
  58. SUBMENU:=Networking
  59. TITLE+= (library, light traffic)
  60. VARIANT:=light
  61. PROVIDES:=libunbound
  62. DEFAULT_VARIANT:=1
  63. endef
  64. define Package/libunbound-light/description
  65. This package contains the Unbound shared library with basic includes
  66. necessary to meet the needs of UCI/LuCI configuration options.
  67. endef
  68. define Package/libunbound-heavy
  69. $(call Package/unbound/Default)
  70. SECTION:=libs
  71. CATEGORY:=Libraries
  72. SUBMENU:=Networking
  73. TITLE+= (library, heavy traffic)
  74. URL:=https://nlnetlabs.nl/documentation/unbound/howto-optimise
  75. DEPENDS+= +libpthread +libevent2 +libevent2-pthreads +libmnl
  76. VARIANT:=heavy
  77. PROVIDES:=libunbound
  78. endef
  79. define Package/libunbound-heavy/description
  80. This package contains the Unbound shared library including 'libevent' and
  81. 'libpthread' to better handle large networks with heavy query loads. It
  82. also offers ipset support.
  83. endef
  84. define Package/unbound-anchor
  85. $(call Package/unbound/Default)
  86. TITLE+= (root DSKEY)
  87. DEPENDS+= +unbound-daemon +libexpat
  88. endef
  89. define Package/unbound-anchor/description
  90. This package contains the Unbound anchor utility.
  91. endef
  92. define Package/unbound-checkconf
  93. $(call Package/unbound/Default)
  94. TITLE+= (config checker)
  95. DEPENDS+= +unbound-daemon
  96. endef
  97. define Package/unbound-checkconf/description
  98. This package contains the Unbound DNS configuration checker utility.
  99. endef
  100. define Package/unbound-control
  101. $(call Package/unbound/Default)
  102. TITLE+= (remote control)
  103. DEPENDS+= +unbound-daemon
  104. endef
  105. define Package/unbound-control/description
  106. This package contains the Unbound control utility.
  107. endef
  108. define Package/unbound-control-setup
  109. $(call Package/unbound/Default)
  110. TITLE+= (control setup)
  111. DEPENDS+= +unbound-control +openssl-util
  112. endef
  113. define Package/unbound-control-setup/description
  114. This package contains the Unbound control setup utility.
  115. endef
  116. define Package/unbound-host
  117. $(call Package/unbound/Default)
  118. TITLE+= (DNS lookup)
  119. DEPENDS+= +libunbound
  120. endef
  121. define Package/unbound-host/description
  122. This package contains the Unbound DNS lookup utility.
  123. endef
  124. CONFIGURE_ARGS += \
  125. --disable-dsa \
  126. --disable-gost \
  127. --enable-allsymbols \
  128. --enable-ecdsa \
  129. --enable-tfo-client \
  130. --enable-tfo-server \
  131. --with-libexpat="$(STAGING_DIR)/usr" \
  132. --with-ssl="$(STAGING_DIR)/usr" \
  133. --with-user=unbound \
  134. --with-run-dir=/var/lib/unbound \
  135. --with-conf-file=/var/lib/unbound/unbound.conf \
  136. --with-pidfile=/var/run/unbound.pid
  137. ifeq ($(BUILD_VARIANT),heavy)
  138. CONFIGURE_ARGS += \
  139. --enable-ipset \
  140. --with-pthreads \
  141. --with-libevent="$(STAGING_DIR)/usr" \
  142. --with-libmnl="$(STAGING_DIR)/usr" \
  143. --enable-event-api
  144. else
  145. CONFIGURE_ARGS += \
  146. --without-pthreads \
  147. --without-solaris-threads \
  148. --without-libevent
  149. endif
  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. Package/unbound-daemon-heavy/conffiles = $(Package/unbound-daemon/conffiles)
  157. define Build/InstallDev
  158. $(INSTALL_DIR) $(1)/usr/lib
  159. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libunbound.{so*,a,la} $(1)/usr/lib/
  160. $(INSTALL_DIR) $(1)/usr/include
  161. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/unbound.h $(1)/usr/include/
  162. ifeq ($(BUILD_VARIANT),heavy)
  163. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/unbound-event.h $(1)/usr/include/
  164. endif
  165. endef
  166. define Package/unbound-daemon/install
  167. $(INSTALL_DIR) $(1)/usr/sbin
  168. $(INSTALL_BIN) \
  169. $(PKG_INSTALL_DIR)/usr/sbin/unbound $(1)/usr/sbin/
  170. $(INSTALL_DIR) $(1)/etc/unbound
  171. $(INSTALL_DATA) \
  172. $(PKG_INSTALL_DIR)/var/lib/unbound/unbound.conf \
  173. $(1)/etc/unbound/unbound.conf
  174. $(INSTALL_DATA) ./files/root.key $(1)/etc/unbound/root.key
  175. $(INSTALL_DATA) ./files/unbound_ext.conf $(1)/etc/unbound/unbound_ext.conf
  176. $(INSTALL_DATA) ./files/unbound_srv.conf $(1)/etc/unbound/unbound_srv.conf
  177. $(INSTALL_DIR) $(1)/etc/config
  178. $(INSTALL_DATA) ./files/unbound.uci $(1)/etc/config/unbound
  179. $(INSTALL_DIR) $(1)/etc/hotplug.d/ntp
  180. $(INSTALL_BIN) ./files/unbound.ntpd $(1)/etc/hotplug.d/ntp/25-unbound
  181. $(INSTALL_DIR) $(1)/etc/init.d
  182. $(INSTALL_BIN) ./files/unbound.init $(1)/etc/init.d/unbound
  183. $(INSTALL_DIR) $(1)/usr/lib/unbound
  184. $(INSTALL_DATA) ./files/defaults.sh $(1)/usr/lib/unbound/defaults.sh
  185. $(INSTALL_DATA) ./files/dnsmasq.sh $(1)/usr/lib/unbound/dnsmasq.sh
  186. $(INSTALL_DATA) ./files/iptools.sh $(1)/usr/lib/unbound/iptools.sh
  187. $(INSTALL_BIN) ./files/odhcpd.sh $(1)/usr/lib/unbound/odhcpd.sh
  188. $(INSTALL_DATA) ./files/odhcpd.awk $(1)/usr/lib/unbound/odhcpd.awk
  189. $(INSTALL_DATA) ./files/stopping.sh $(1)/usr/lib/unbound/stopping.sh
  190. $(INSTALL_DATA) ./files/unbound.sh $(1)/usr/lib/unbound/unbound.sh
  191. endef
  192. Package/unbound-daemon-heavy/install = $(Package/unbound-daemon/install)
  193. define Package/libunbound-light/install
  194. $(INSTALL_DIR) $(1)/usr/lib
  195. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunbound.so.* $(1)/usr/lib/
  196. endef
  197. Package/libunbound-heavy/install = $(Package/libunbound-light/install)
  198. define Package/unbound-anchor/install
  199. $(INSTALL_DIR) $(1)/usr/sbin
  200. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-anchor $(1)/usr/sbin/
  201. endef
  202. define Package/unbound-checkconf/install
  203. $(INSTALL_DIR) $(1)/usr/sbin
  204. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-checkconf $(1)/usr/sbin/
  205. endef
  206. define Package/unbound-control/install
  207. $(INSTALL_DIR) $(1)/usr/sbin
  208. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control $(1)/usr/sbin/
  209. endef
  210. define Package/unbound-control-setup/install
  211. $(INSTALL_DIR) $(1)/usr/sbin
  212. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control-setup $(1)/usr/sbin/
  213. endef
  214. define Package/unbound-host/install
  215. $(INSTALL_DIR) $(1)/usr/sbin
  216. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-host $(1)/usr/sbin/
  217. endef
  218. $(eval $(call BuildPackage,unbound-daemon))
  219. $(eval $(call BuildPackage,unbound-daemon-heavy))
  220. $(eval $(call BuildPackage,libunbound-light))
  221. $(eval $(call BuildPackage,libunbound-heavy))
  222. $(eval $(call BuildPackage,unbound-anchor))
  223. $(eval $(call BuildPackage,unbound-checkconf))
  224. $(eval $(call BuildPackage,unbound-control))
  225. $(eval $(call BuildPackage,unbound-control-setup))
  226. $(eval $(call BuildPackage,unbound-host))