bind: update to version 9.18.18
[feed/packages.git] / net / bind / Makefile
1 #
2 # Copyright (C) 2006-2012 OpenWrt.org
3 # 2014-2020 Noah Meyerhans <frodo@morgul.net>
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=bind
12 PKG_VERSION:=9.18.18
13 PKG_RELEASE:=1
14 USERID:=bind=57:bind=57
15
16 PKG_MAINTAINER:=Noah Meyerhans <frodo@morgul.net>
17 PKG_LICENSE:=MPL-2.0
18 PKG_LICENSE_FILES:=LICENSE
19 PKG_CPE_ID:=cpe:/a:isc:bind
20
21 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
22 PKG_SOURCE_URL:= \
23 https://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION) \
24 https://ftp.isc.org/isc/bind9/$(PKG_VERSION)
25 PKG_HASH:=d735cdc127a6c5709bde475b5bf16fa2133f36fdba202f7c3c37d134e5192160
26
27 PKG_FIXUP:=autoreconf
28 PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
29
30 PKG_INSTALL:=1
31 PKG_BUILD_FLAGS:=no-mips16
32 PKG_BUILD_PARALLEL:=1
33
34 PKG_CONFIG_DEPENDS := \
35 CONFIG_BIND_LIBJSON \
36 CONFIG_BIND_LIBXML2 \
37 CONFIG_BIND_ENABLE_DOH \
38 CONFIG_BIND_ENABLE_GSSAPI
39
40 PKG_BUILD_DEPENDS += BIND_LIBXML2:libxml2 BIND_LIBJSON:libjson-c
41
42 include $(INCLUDE_DIR)/package.mk
43 include $(INCLUDE_DIR)/nls.mk
44
45 DISABLE_NLS:=
46
47 define Package/bind/Default
48 SECTION:=net
49 CATEGORY:=Network
50 DEPENDS:=+bind-libs +@OPENSSL_WITH_EC
51 TITLE:=bind
52 URL:=https://www.isc.org/software/bind
53 SUBMENU:=IP Addresses and Names
54 endef
55
56 define Package/bind-libs
57 SECTION:=libs
58 CATEGORY:=Libraries
59 DEPENDS:=+libopenssl \
60 +zlib \
61 +libpthread \
62 +libatomic \
63 +libuv \
64 +BIND_ENABLE_DOH:libnghttp2 \
65 +BIND_ENABLE_GSSAPI:krb5-libs \
66 +BIND_ENABLE_GSSAPI:libcomerr \
67 +BIND_LIBXML2:libxml2 \
68 +BIND_LIBJSON:libjson-c
69 TITLE:=bind shared libraries
70 URL:=https://www.isc.org/software/bind
71 endef
72
73 define Package/bind-server
74 $(call Package/bind/Default)
75 TITLE+= DNS server
76 DEPENDS+= +libcap
77 endef
78
79 define Package/bind-server/config
80 source "$(SOURCE)/Config.in"
81 endef
82
83 define Package/bind-server-filter-aaaa
84 $(call Package/bind-server)
85 DEPENDS:=bind-server
86 TITLE+= filter AAAA plugin
87 endef
88
89 define Package/bind-client
90 $(call Package/bind/Default)
91 TITLE+= dynamic DNS client
92 endef
93
94 define Package/bind-tools
95 $(call Package/bind/Default)
96 TITLE+= administration tools (all)
97 DEPENDS:= \
98 +bind-check \
99 +bind-dig \
100 +bind-nslookup \
101 +bind-dnssec \
102 +bind-host \
103 +bind-rndc \
104 +bind-ddns-confgen
105 endef
106
107 define Package/bind-rndc
108 $(call Package/bind/Default)
109 TITLE+= administration tools (rndc and rndc-confgen only)
110 endef
111
112 define Package/bind-check
113 $(call Package/bind/Default)
114 TITLE+= administration tools (named-checkconf and named-checkzone only)
115 endef
116
117 define Package/bind-dnssec
118 $(call Package/bind/Default)
119 TITLE+= administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only)
120 endef
121
122 define Package/bind-host
123 $(call Package/bind/Default)
124 TITLE+= simple DNS client
125 endef
126
127 define Package/bind-dig
128 $(call Package/bind/Default)
129 TITLE+= DNS excavation tool
130 endef
131
132 define Package/bind-nslookup
133 $(call Package/bind/Default)
134 TITLE+= nslookup utility
135 ALTERNATIVES:= \
136 200:/usr/bin/nslookup:/usr/libexec/nslookup-bind
137 endef
138
139 define Package/bind-ddns-confgen
140 $(call Package/bind/Default)
141 TITLE+= administration tools (ddns-confgen and tsig-keygen only)
142 endef
143
144 export BUILD_CC="$(TARGET_CC)"
145
146 TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
147
148 CONFIGURE_ARGS += \
149 --disable-geoip \
150 --with-openssl="$(STAGING_DIR)/usr" \
151 --without-lmdb \
152 --enable-epoll \
153 --without-readline \
154 --sysconfdir=/etc/bind
155
156 ifdef CONFIG_BIND_LIBJSON
157 TARGET_CFLAGS += -DHAVE_JSON_C -UHAVE_JSON
158 CONFIGURE_ARGS += \
159 --with-json-c=yes
160 else
161 CONFIGURE_ARGS += \
162 --with-json-c=no
163 endif
164
165 ifdef CONFIG_BIND_LIBXML2
166 CONFIGURE_ARGS += \
167 --with-libxml2=yes
168 else
169 CONFIGURE_ARGS += \
170 --with-libxml2=no
171 endif
172
173 ifdef CONFIG_BIND_ENABLE_DOH
174 CONFIGURE_ARGS += \
175 --enable-doh
176 else
177 CONFIGURE_ARGS += \
178 --disable-doh
179 endif
180
181 ifdef CONFIG_BIND_ENABLE_GSSAPI
182 CONFIGURE_ARGS += \
183 --with-gssapi
184 else
185 CONFIGURE_ARGS += \
186 --without-gssapi
187 endif
188
189 CONFIGURE_VARS += \
190 BUILD_CC="$(TARGET_CC)" \
191
192 define Build/Compile
193 $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
194 BUILD_CC="$(HOSTCC)" \
195 CC="$(HOSTCC)" \
196 CFLAGS="-O2" \
197 LIBS="" \
198 gen
199 $(call Build/Compile/Default)
200 endef
201
202 define Package/bind-libs/install
203 $(INSTALL_DIR) $(1)/usr/lib
204 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
205 endef
206
207 define Package/bind-server/install
208 $(INSTALL_DIR) $(1)/usr/sbin
209 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
210 $(INSTALL_DIR) $(1)/etc/bind
211 $(CP) \
212 ./files/bind/db.0 \
213 ./files/bind/db.127 \
214 ./files/bind/db.255 \
215 ./files/bind/db.local \
216 ./files/bind/db.root \
217 ./files/bind/bind.keys \
218 $(1)/etc/bind/
219 sed -e '1s/ broadcast / empty rfc1918 /' \
220 < ./files/bind/db.0 \
221 > $(1)/etc/bind/db.empty
222 $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
223 $(INSTALL_DIR) $(1)/etc/init.d
224 $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
225 find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
226 endef
227
228 define Package/bind-server/conffiles
229 /etc/bind/db.0
230 /etc/bind/db.127
231 /etc/bind/db.255
232 /etc/bind/db.local
233 /etc/bind/db.root
234 /etc/bind/named.conf
235 endef
236
237 define Package/bind-server-filter-aaaa/install
238 $(INSTALL_DIR) $(1)/usr/lib/bind
239 $(CP) $(PKG_INSTALL_DIR)/usr/lib/bind/filter-aaaa.so $(1)/usr/lib/bind
240 endef
241
242 define Package/bind-client/install
243 $(INSTALL_DIR) $(1)/usr/bin
244 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
245 endef
246
247 define Package/bind-tools/install
248 $(INSTALL_DIR) $(1)/usr/bin
249 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/delv $(1)/usr/bin/
250 endef
251
252 define Package/bind-rndc/install
253 $(INSTALL_DIR) $(1)/usr/sbin
254 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
255 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
256 endef
257
258 define Package/bind-check/install
259 $(INSTALL_DIR) $(1)/usr/bin
260 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/named-checkconf $(1)/usr/bin/
261 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/named-checkzone $(1)/usr/bin/
262 endef
263
264 define Package/bind-dnssec/install
265 $(INSTALL_DIR) $(1)/usr/bin
266 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-keygen $(1)/usr/bin/
267 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-settime $(1)/usr/bin/
268 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-signzone $(1)/usr/bin/
269 endef
270
271 define Package/bind-host/install
272 $(INSTALL_DIR) $(1)/usr/bin
273 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
274 endef
275
276 define Package/bind-dig/install
277 $(INSTALL_DIR) $(1)/usr/bin
278 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
279 endef
280
281 define Package/bind-nslookup/install
282 $(INSTALL_DIR) $(1)/usr/libexec
283 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nslookup $(1)/usr/libexec/nslookup-bind
284 endef
285
286 define Package/bind-ddns-confgen/install
287 $(INSTALL_DIR) $(1)/usr/sbin
288 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ddns-confgen $(1)/usr/sbin/ddns-confgen
289 $(LN) -s ddns-confgen $(1)/usr/sbin/tsig-keygen
290 endef
291
292 $(eval $(call BuildPackage,bind-libs))
293 $(eval $(call BuildPackage,bind-server))
294 $(eval $(call BuildPackage,bind-server-filter-aaaa))
295 $(eval $(call BuildPackage,bind-client))
296 $(eval $(call BuildPackage,bind-tools))
297 $(eval $(call BuildPackage,bind-rndc))
298 $(eval $(call BuildPackage,bind-check))
299 $(eval $(call BuildPackage,bind-dnssec))
300 $(eval $(call BuildPackage,bind-host))
301 $(eval $(call BuildPackage,bind-dig))
302 $(eval $(call BuildPackage,bind-nslookup))
303 $(eval $(call BuildPackage,bind-ddns-confgen))