Makefile 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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.5
  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:=8a8d400f697c61d73d109c250743a1b6b79848297848026d82b43e831045db57
  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))