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