1
0

Makefile 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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.18.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:=3da95490a85cff6420f26fae0b84a49f5112df1bf1b7fc34f8724f02082cb712
  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_nghttp2 \
  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:=+ca-bundle +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_nghttp2:libnghttp2 \
  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_nghttp2
  122. bool "Build with DNS over HTTPS support (nghttp2 framework)."
  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_VARS += UNAME=Linux
  133. CONFIGURE_ARGS += \
  134. --disable-dsa \
  135. --disable-gost \
  136. --enable-allsymbols \
  137. --enable-ecdsa \
  138. --enable-tfo-client \
  139. --enable-tfo-server \
  140. --with-libexpat="$(STAGING_DIR)/usr" \
  141. --with-ssl="$(STAGING_DIR)/usr" \
  142. --with-user=unbound \
  143. --with-run-dir=/var/lib/unbound \
  144. --with-conf-file=/var/lib/unbound/unbound.conf \
  145. --with-pidfile=/var/run/unbound.pid \
  146. $(if $(CONFIG_PACKAGE_libunbound_dnscrypt), \
  147. --enable-dnscrypt --with-libsodium="$(STAGING_DIR)/usr",) \
  148. $(if $(CONFIG_PACKAGE_libunbound_ipset), \
  149. --enable-ipset --with-libmnl="$(STAGING_DIR)/usr",) \
  150. $(if $(CONFIG_PACKAGE_libunbound_libevent), \
  151. --enable-event-api --with-libevent="$(STAGING_DIR)/usr",--without-libevent) \
  152. $(if $(CONFIG_PACKAGE_libunbound_nghttp2), \
  153. --with-libnghttp2="$(STAGING_DIR)/usr",) \
  154. $(if $(CONFIG_PACKAGE_libunbound_libpthread), \
  155. --with-pthreads,--without-pthreads --without-solaris-threads) \
  156. $(if $(CONFIG_PACKAGE_libunbound_subnet),--enable-subnet,) \
  157. $(if $(CONFIG_PACKAGE_libunbound_dnstap),--enable-dnstap,) \
  158. define Package/unbound-daemon/conffiles
  159. /etc/config/unbound
  160. /etc/unbound/unbound.conf
  161. /etc/unbound/unbound_ext.conf
  162. /etc/unbound/unbound_srv.conf
  163. endef
  164. define Build/InstallDev
  165. $(INSTALL_DIR) $(1)/usr/lib
  166. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libunbound.{so*,a,la} $(1)/usr/lib/
  167. $(INSTALL_DIR) $(1)/usr/include
  168. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/unbound.h $(1)/usr/include/
  169. ifneq ($(CONFIG_PACKAGE_libunbound_libevent),)
  170. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/unbound-event.h $(1)/usr/include/
  171. endif
  172. endef
  173. define Package/unbound-daemon/install
  174. $(INSTALL_DIR) $(1)/usr/sbin
  175. $(INSTALL_BIN) \
  176. $(PKG_INSTALL_DIR)/usr/sbin/unbound $(1)/usr/sbin/
  177. $(INSTALL_DIR) $(1)/etc/unbound
  178. $(INSTALL_CONF) \
  179. $(PKG_INSTALL_DIR)/var/lib/unbound/unbound.conf \
  180. $(1)/etc/unbound/unbound.conf
  181. $(INSTALL_DATA) ./files/root.key $(1)/etc/unbound/root.key
  182. $(INSTALL_CONF) ./files/unbound_ext.conf $(1)/etc/unbound/unbound_ext.conf
  183. $(INSTALL_CONF) ./files/unbound_srv.conf $(1)/etc/unbound/unbound_srv.conf
  184. $(INSTALL_DIR) $(1)/etc/config
  185. $(INSTALL_CONF) ./files/unbound.uci $(1)/etc/config/unbound
  186. $(INSTALL_DIR) $(1)/etc/hotplug.d/ntp
  187. $(INSTALL_BIN) ./files/unbound.ntpd $(1)/etc/hotplug.d/ntp/25-unbound
  188. $(INSTALL_DIR) $(1)/etc/init.d
  189. $(INSTALL_BIN) ./files/unbound.init $(1)/etc/init.d/unbound
  190. $(INSTALL_DIR) $(1)/usr/lib/unbound
  191. $(INSTALL_DATA) ./files/defaults.sh $(1)/usr/lib/unbound/defaults.sh
  192. $(INSTALL_DATA) ./files/dnsmasq.sh $(1)/usr/lib/unbound/dnsmasq.sh
  193. $(INSTALL_DATA) ./files/iptools.sh $(1)/usr/lib/unbound/iptools.sh
  194. $(INSTALL_BIN) ./files/odhcpd.sh $(1)/usr/lib/unbound/odhcpd.sh
  195. $(INSTALL_DATA) ./files/odhcpd.awk $(1)/usr/lib/unbound/odhcpd.awk
  196. $(INSTALL_DATA) ./files/stopping.sh $(1)/usr/lib/unbound/stopping.sh
  197. $(INSTALL_DATA) ./files/unbound.sh $(1)/usr/lib/unbound/unbound.sh
  198. endef
  199. define Package/libunbound/install
  200. $(INSTALL_DIR) $(1)/usr/lib
  201. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunbound.so.* $(1)/usr/lib/
  202. endef
  203. define Package/unbound-anchor/install
  204. $(INSTALL_DIR) $(1)/usr/sbin
  205. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-anchor $(1)/usr/sbin/
  206. endef
  207. define Package/unbound-checkconf/install
  208. $(INSTALL_DIR) $(1)/usr/sbin
  209. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-checkconf $(1)/usr/sbin/
  210. endef
  211. define Package/unbound-control/install
  212. $(INSTALL_DIR) $(1)/usr/sbin
  213. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control $(1)/usr/sbin/
  214. endef
  215. define Package/unbound-control-setup/install
  216. $(INSTALL_DIR) $(1)/usr/sbin
  217. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control-setup $(1)/usr/sbin/
  218. endef
  219. define Package/unbound-host/install
  220. $(INSTALL_DIR) $(1)/usr/sbin
  221. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-host $(1)/usr/sbin/
  222. endef
  223. $(eval $(call BuildPackage,unbound-daemon))
  224. $(eval $(call BuildPackage,libunbound))
  225. $(eval $(call BuildPackage,unbound-anchor))
  226. $(eval $(call BuildPackage,unbound-checkconf))
  227. $(eval $(call BuildPackage,unbound-control))
  228. $(eval $(call BuildPackage,unbound-control-setup))
  229. $(eval $(call BuildPackage,unbound-host))