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.

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