Merge pull request #19372 from cotequeiroz/libgd
[feed/packages.git] / net / unbound / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=unbound
11 PKG_VERSION:=1.16.3
12 PKG_RELEASE:=$(AUTORELEASE)
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://nlnetlabs.nl/downloads/unbound
16 PKG_HASH:=ea0c6665e2c3325b769eac1dfccd60fe1828d5fcf662650039eccb3f67edb28e
17
18 PKG_MAINTAINER:=Eric Luehrsen <ericluehrsen@gmail.com>
19 PKG_LICENSE:=BSD-3-Clause
20 PKG_LICENSE_FILES:=LICENSE
21 PKG_CPE_ID:=cpe:/a:nlnetlabs:unbound
22
23 PKG_BUILD_PARALLEL:=1
24 PKG_FIXUP:=autoreconf
25 PKG_INSTALL:=1
26
27 PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_libunbound_dnscrypt \
28 CONFIG_PACKAGE_libunbound_ipset \
29 CONFIG_PACKAGE_libunbound_libevent \
30 CONFIG_PACKAGE_libunbound_libpthread \
31 CONFIG_PACKAGE_libunbound_nghttp2 \
32 CONFIG_PACKAGE_libunbound_pythonmodule \
33 CONFIG_PACKAGE_libunbound_subnet \
34 CONFIG_PACKAGE_libunbound_dnstap
35
36 include $(INCLUDE_DIR)/package.mk
37
38 define Package/unbound/Default
39 SECTION:=net
40 CATEGORY:=Network
41 SUBMENU:=IP Addresses and Names
42 USERID:=unbound:unbound
43 TITLE:=Recursive DNS Server
44 URL:=https://nlnetlabs.nl/projects/unbound/about
45 DEPENDS:=+ca-bundle +libopenssl +@OPENSSL_WITH_EC
46 endef
47
48 define Package/unbound-daemon
49 $(call Package/unbound/Default)
50 TITLE+= (daemon)
51 DEPENDS+= +libunbound
52 endef
53
54 define Package/unbound-daemon/description
55 This package contains the Unbound daemon including 'libevent', 'libmnl', and
56 'libpthread' to better handle large networks with heavy query loads. Options
57 are available under libraries/network/libunbound to custom trim Unbound for
58 smaller targets.
59 endef
60
61 define Package/libunbound
62 $(call Package/unbound/Default)
63 SECTION:=libs
64 CATEGORY:=Libraries
65 SUBMENU:=Networking
66 TITLE+= (library)
67 DEPENDS+=+PACKAGE_libunbound_dnscrypt:libsodium \
68 +PACKAGE_libunbound_ipset:libmnl \
69 +PACKAGE_libunbound_libevent:libevent2 \
70 +PACKAGE_libunbound_libpthread:libpthread \
71 +PACKAGE_libunbound_nghttp2:libnghttp2 \
72 +PACKAGE_libunbound_pythonmodule:python3-base \
73 +PACKAGE_libunbound_dnstap:libprotobuf-c
74 endef
75
76 define Package/libunbound/description
77 This package contains the Unbound library including 'libevent', 'libmnl', and
78 'libpthread' to better handle large networks with heavy query loads. Options
79 are available to custom trim Unbound for smaller targets.
80 endef
81
82 define Package/unbound-anchor
83 $(call Package/unbound/Default)
84 TITLE+= (root DSKEY)
85 DEPENDS+= +unbound-daemon +libexpat
86 endef
87
88 define Package/unbound-anchor/description
89 This package contains the Unbound anchor utility.
90 endef
91
92 define Package/unbound-checkconf
93 $(call Package/unbound/Default)
94 TITLE+= (config checker)
95 DEPENDS+= +unbound-daemon
96 endef
97
98 define Package/unbound-checkconf/description
99 This package contains the Unbound DNS configuration checker utility.
100 endef
101
102 define Package/unbound-control
103 $(call Package/unbound/Default)
104 TITLE+= (remote control)
105 DEPENDS+= +unbound-daemon
106 endef
107
108 define Package/unbound-control/description
109 This package contains the Unbound control utility.
110 endef
111
112 define Package/unbound-control-setup
113 $(call Package/unbound/Default)
114 TITLE+= (control setup)
115 DEPENDS+= +unbound-control +openssl-util
116 endef
117
118 define Package/unbound-control-setup/description
119 This package contains the Unbound control setup utility.
120 endef
121
122 define Package/unbound-host
123 $(call Package/unbound/Default)
124 TITLE+= (DNS lookup)
125 DEPENDS+= +libunbound
126 endef
127
128 define Package/unbound-host/description
129 This package contains the Unbound DNS lookup utility.
130 endef
131
132 define Package/libunbound/config
133 if PACKAGE_libunbound
134 config PACKAGE_libunbound_dnscrypt
135 bool "Build with DNSCRYPT support."
136 default n
137 config PACKAGE_libunbound_ipset
138 bool "Build with IPSET (libmnl) support."
139 default y
140 config PACKAGE_libunbound_libevent
141 bool "Build with expanded network resource (libevent) support."
142 default y
143 config PACKAGE_libunbound_libpthread
144 bool "Build with POSIX threading (libpthread) support."
145 default y
146 config PACKAGE_libunbound_nghttp2
147 bool "Build with DNS over HTTPS support (nghttp2 framework)."
148 default n
149 config PACKAGE_libunbound_pythonmodule
150 bool "Build with PYTHON module for prototyping and data analysis."
151 default n
152 config PACKAGE_libunbound_subnet
153 bool "Build with SUBNET cache module support."
154 default n
155 config PACKAGE_libunbound_dnstap
156 bool "Build with dnstap support."
157 default n
158 endif
159 endef
160
161 CONFIGURE_VARS += UNAME=Linux
162
163 CONFIGURE_ARGS += \
164 --disable-dsa \
165 --disable-gost \
166 --enable-allsymbols \
167 --enable-ecdsa \
168 --enable-tfo-client \
169 --enable-tfo-server \
170 --with-libexpat="$(STAGING_DIR)/usr" \
171 --with-ssl="$(STAGING_DIR)/usr" \
172 --with-user=unbound \
173 --with-run-dir=/var/lib/unbound \
174 --with-conf-file=/var/lib/unbound/unbound.conf \
175 --with-pidfile=/var/run/unbound.pid \
176 $(if $(CONFIG_PACKAGE_libunbound_dnscrypt), \
177 --enable-dnscrypt --with-libsodium="$(STAGING_DIR)/usr",) \
178 $(if $(CONFIG_PACKAGE_libunbound_ipset), \
179 --enable-ipset --with-libmnl="$(STAGING_DIR)/usr",) \
180 $(if $(CONFIG_PACKAGE_libunbound_libevent), \
181 --enable-event-api --with-libevent="$(STAGING_DIR)/usr",--without-libevent) \
182 $(if $(CONFIG_PACKAGE_libunbound_nghttp2), \
183 --with-libnghttp2="$(STAGING_DIR)/usr",) \
184 $(if $(CONFIG_PACKAGE_libunbound_libpthread), \
185 --with-pthreads,--without-pthreads --without-solaris-threads) \
186 $(if $(CONFIG_PACKAGE_libunbound_python),--with-pythonmodule,) \
187 $(if $(CONFIG_PACKAGE_libunbound_subnet),--enable-subnet,) \
188 $(if $(CONFIG_PACKAGE_libunbound_dnstap),--enable-dnstap,) \
189
190 define Package/unbound-daemon/conffiles
191 /etc/config/unbound
192 /etc/unbound/unbound.conf
193 /etc/unbound/unbound_ext.conf
194 /etc/unbound/unbound_srv.conf
195 endef
196
197 define Build/InstallDev
198 $(INSTALL_DIR) $(1)/usr/lib
199 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libunbound.{so*,a,la} $(1)/usr/lib/
200 $(INSTALL_DIR) $(1)/usr/include
201 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/unbound.h $(1)/usr/include/
202 ifneq ($(CONFIG_PACKAGE_libunbound_libevent),)
203 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/unbound-event.h $(1)/usr/include/
204 endif
205 endef
206
207 define Package/unbound-daemon/install
208 $(INSTALL_DIR) $(1)/usr/sbin
209 $(INSTALL_BIN) \
210 $(PKG_INSTALL_DIR)/usr/sbin/unbound $(1)/usr/sbin/
211 $(INSTALL_DIR) $(1)/etc/unbound
212 $(INSTALL_CONF) \
213 $(PKG_INSTALL_DIR)/var/lib/unbound/unbound.conf \
214 $(1)/etc/unbound/unbound.conf
215 $(INSTALL_DATA) ./files/root.key $(1)/etc/unbound/root.key
216 $(INSTALL_CONF) ./files/unbound_ext.conf $(1)/etc/unbound/unbound_ext.conf
217 $(INSTALL_CONF) ./files/unbound_srv.conf $(1)/etc/unbound/unbound_srv.conf
218 $(INSTALL_DIR) $(1)/etc/config
219 $(INSTALL_CONF) ./files/unbound.uci $(1)/etc/config/unbound
220 $(INSTALL_DIR) $(1)/etc/hotplug.d/ntp
221 $(INSTALL_BIN) ./files/unbound.ntpd $(1)/etc/hotplug.d/ntp/25-unbound
222 $(INSTALL_DIR) $(1)/etc/init.d
223 $(INSTALL_BIN) ./files/unbound.init $(1)/etc/init.d/unbound
224 $(INSTALL_DIR) $(1)/usr/lib/unbound
225 $(INSTALL_DATA) ./files/defaults.sh $(1)/usr/lib/unbound/defaults.sh
226 $(INSTALL_DATA) ./files/dnsmasq.sh $(1)/usr/lib/unbound/dnsmasq.sh
227 $(INSTALL_DATA) ./files/iptools.sh $(1)/usr/lib/unbound/iptools.sh
228 $(INSTALL_BIN) ./files/odhcpd.sh $(1)/usr/lib/unbound/odhcpd.sh
229 $(INSTALL_DATA) ./files/odhcpd.awk $(1)/usr/lib/unbound/odhcpd.awk
230 $(INSTALL_DATA) ./files/stopping.sh $(1)/usr/lib/unbound/stopping.sh
231 $(INSTALL_DATA) ./files/unbound.sh $(1)/usr/lib/unbound/unbound.sh
232 endef
233
234 define Package/libunbound/install
235 $(INSTALL_DIR) $(1)/usr/lib
236 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunbound.so.* $(1)/usr/lib/
237 endef
238
239 define Package/unbound-anchor/install
240 $(INSTALL_DIR) $(1)/usr/sbin
241 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-anchor $(1)/usr/sbin/
242 endef
243
244 define Package/unbound-checkconf/install
245 $(INSTALL_DIR) $(1)/usr/sbin
246 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-checkconf $(1)/usr/sbin/
247 endef
248
249 define Package/unbound-control/install
250 $(INSTALL_DIR) $(1)/usr/sbin
251 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control $(1)/usr/sbin/
252 endef
253
254 define Package/unbound-control-setup/install
255 $(INSTALL_DIR) $(1)/usr/sbin
256 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control-setup $(1)/usr/sbin/
257 endef
258
259 define Package/unbound-host/install
260 $(INSTALL_DIR) $(1)/usr/sbin
261 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-host $(1)/usr/sbin/
262 endef
263
264 $(eval $(call BuildPackage,unbound-daemon))
265 $(eval $(call BuildPackage,libunbound))
266 $(eval $(call BuildPackage,unbound-anchor))
267 $(eval $(call BuildPackage,unbound-checkconf))
268 $(eval $(call BuildPackage,unbound-control))
269 $(eval $(call BuildPackage,unbound-control-setup))
270 $(eval $(call BuildPackage,unbound-host))
271