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
7.6 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.9.6
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://nlnetlabs.nl/downloads/unbound
  13. PKG_HASH:=1d98fc6ea99197a20b4a0e540e87022cf523085786e0fc26de6ebb2720f5aaf0
  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
  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
  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. endef
  53. define Package/libunbound
  54. $(call Package/unbound/Default)
  55. SECTION:=libs
  56. CATEGORY:=Libraries
  57. SUBMENU:=Networking
  58. TITLE+= (library, light traffic)
  59. VARIANT:=light
  60. DEFAULT_VARIANT:=1
  61. endef
  62. define Package/libunbound/description
  63. This package contains the Unbound shared library with basic includes
  64. necessary to meet the needs of UCI/LuCI configuration optoins.
  65. endef
  66. define Package/libunbound-heavy
  67. $(call Package/unbound/Default)
  68. SECTION:=libs
  69. CATEGORY:=Libraries
  70. SUBMENU:=Networking
  71. TITLE+= (library, heavy traffic)
  72. URL:=https://nlnetlabs.nl/documentation/unbound/howto-optimise
  73. DEPENDS+= +libpthread +libevent2 +libevent2-pthreads
  74. VARIANT:=heavy
  75. PROVIDES:=libunbound
  76. endef
  77. define Package/libunbound-heavy/description
  78. This package contains the Unbound shared library including 'libevent' and
  79. 'libpthread' to better handle large networks with heavy query loads.
  80. endef
  81. define Package/unbound-anchor
  82. $(call Package/unbound/Default)
  83. TITLE+= (root DSKEY)
  84. DEPENDS+= +unbound-daemon +libexpat
  85. endef
  86. define Package/unbound-anchor/description
  87. This package contains the Unbound anchor utility.
  88. endef
  89. define Package/unbound-checkconf
  90. $(call Package/unbound/Default)
  91. TITLE+= (config checker)
  92. DEPENDS+= +unbound-daemon
  93. endef
  94. define Package/unbound-checkconf/description
  95. This package contains the Unbound DNS configuration checker utility.
  96. endef
  97. define Package/unbound-control
  98. $(call Package/unbound/Default)
  99. TITLE+= (remote control)
  100. DEPENDS+= +unbound-daemon
  101. endef
  102. define Package/unbound-control/description
  103. This package contains the Unbound control utility.
  104. endef
  105. define Package/unbound-control-setup
  106. $(call Package/unbound/Default)
  107. TITLE+= (control setup)
  108. DEPENDS+= +unbound-control +openssl-util
  109. endef
  110. define Package/unbound-control-setup/description
  111. This package contains the Unbound control setup utility.
  112. endef
  113. define Package/unbound-host
  114. $(call Package/unbound/Default)
  115. TITLE+= (DNS lookup)
  116. DEPENDS+= +libunbound
  117. endef
  118. define Package/unbound-host/description
  119. This package contains the Unbound DNS lookup utility.
  120. endef
  121. CONFIGURE_ARGS += \
  122. --disable-dsa \
  123. --disable-gost \
  124. --enable-allsymbols \
  125. --enable-ecdsa \
  126. --enable-tfo-client \
  127. --enable-tfo-server \
  128. --with-libexpat="$(STAGING_DIR)/usr" \
  129. --with-ssl="$(STAGING_DIR)/usr" \
  130. --with-user=unbound \
  131. --with-run-dir=/var/lib/unbound \
  132. --with-conf-file=/var/lib/unbound/unbound.conf \
  133. --with-pidfile=/var/run/unbound.pid
  134. ifeq ($(BUILD_VARIANT),heavy)
  135. CONFIGURE_ARGS += \
  136. --with-pthreads \
  137. --with-libevent="$(STAGING_DIR)/usr" \
  138. --enable-event-api
  139. else
  140. CONFIGURE_ARGS += \
  141. --without-pthreads \
  142. --without-solaris-threads \
  143. --without-libevent
  144. endif
  145. define Package/unbound-daemon/conffiles
  146. /etc/config/unbound
  147. /etc/unbound/unbound.conf
  148. /etc/unbound/unbound_ext.conf
  149. /etc/unbound/unbound_srv.conf
  150. endef
  151. Package/unbound-daemon-heavy/conffiles = $(Package/unbound-daemon/conffiles)
  152. define Build/InstallDev
  153. $(INSTALL_DIR) $(1)/usr/lib
  154. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libunbound.{so*,a,la} $(1)/usr/lib/
  155. $(INSTALL_DIR) $(1)/usr/include
  156. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/unbound.h $(1)/usr/include/
  157. ifeq ($(BUILD_VARIANT),heavy)
  158. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/unbound-event.h $(1)/usr/include/
  159. endif
  160. endef
  161. define Package/unbound-daemon/install
  162. $(INSTALL_DIR) $(1)/usr/sbin
  163. $(INSTALL_BIN) \
  164. $(PKG_INSTALL_DIR)/usr/sbin/unbound $(1)/usr/sbin/
  165. $(INSTALL_DIR) $(1)/etc/unbound
  166. $(INSTALL_DATA) \
  167. $(PKG_INSTALL_DIR)/var/lib/unbound/unbound.conf \
  168. $(1)/etc/unbound/unbound.conf
  169. $(INSTALL_DATA) ./files/root.key $(1)/etc/unbound/root.key
  170. $(INSTALL_DATA) ./files/unbound_ext.conf $(1)/etc/unbound/unbound_ext.conf
  171. $(INSTALL_DATA) ./files/unbound_srv.conf $(1)/etc/unbound/unbound_srv.conf
  172. $(INSTALL_DIR) $(1)/etc/config
  173. $(INSTALL_DATA) ./files/unbound.uci $(1)/etc/config/unbound
  174. $(INSTALL_DIR) $(1)/etc/hotplug.d/ntp
  175. $(INSTALL_BIN) ./files/unbound.ntpd $(1)/etc/hotplug.d/ntp/25-unbound
  176. $(INSTALL_DIR) $(1)/etc/init.d
  177. $(INSTALL_BIN) ./files/unbound.init $(1)/etc/init.d/unbound
  178. $(INSTALL_DIR) $(1)/usr/lib/unbound
  179. $(INSTALL_DATA) ./files/defaults.sh $(1)/usr/lib/unbound/defaults.sh
  180. $(INSTALL_DATA) ./files/dnsmasq.sh $(1)/usr/lib/unbound/dnsmasq.sh
  181. $(INSTALL_DATA) ./files/iptools.sh $(1)/usr/lib/unbound/iptools.sh
  182. $(INSTALL_BIN) ./files/odhcpd.sh $(1)/usr/lib/unbound/odhcpd.sh
  183. $(INSTALL_DATA) ./files/odhcpd.awk $(1)/usr/lib/unbound/odhcpd.awk
  184. $(INSTALL_DATA) ./files/stopping.sh $(1)/usr/lib/unbound/stopping.sh
  185. $(INSTALL_DATA) ./files/unbound.sh $(1)/usr/lib/unbound/unbound.sh
  186. endef
  187. Package/unbound-daemon-heavy/install = $(Package/unbound-daemon/install)
  188. define Package/libunbound/install
  189. $(INSTALL_DIR) $(1)/usr/lib
  190. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunbound.so.* $(1)/usr/lib/
  191. endef
  192. Package/libunbound-heavy/install = $(Package/libunbound/install)
  193. define Package/unbound-anchor/install
  194. $(INSTALL_DIR) $(1)/usr/sbin
  195. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-anchor $(1)/usr/sbin/
  196. endef
  197. define Package/unbound-checkconf/install
  198. $(INSTALL_DIR) $(1)/usr/sbin
  199. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-checkconf $(1)/usr/sbin/
  200. endef
  201. define Package/unbound-control/install
  202. $(INSTALL_DIR) $(1)/usr/sbin
  203. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control $(1)/usr/sbin/
  204. endef
  205. define Package/unbound-control-setup/install
  206. $(INSTALL_DIR) $(1)/usr/sbin
  207. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control-setup $(1)/usr/sbin/
  208. endef
  209. define Package/unbound-host/install
  210. $(INSTALL_DIR) $(1)/usr/sbin
  211. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-host $(1)/usr/sbin/
  212. endef
  213. $(eval $(call BuildPackage,unbound-daemon))
  214. $(eval $(call BuildPackage,unbound-daemon-heavy))
  215. $(eval $(call BuildPackage,libunbound))
  216. $(eval $(call BuildPackage,libunbound-heavy))
  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))