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