libgd: avoid recursive and redundant dependencies
[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.4
13 PKG_RELEASE:=$(AUTORELEASE)
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:=f277ae50159a00c300eb926a9c5d51953038a936bd8242d6913dfb6eac42761d
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 --with-openssl="$(STAGING_DIR)/usr" \
147 --without-lmdb \
148 --enable-epoll \
149 --without-gssapi \
150 --without-readline \
151 --sysconfdir=/etc/bind
152
153 ifdef CONFIG_BIND_LIBJSON
154 TARGET_CFLAGS += -DHAVE_JSON_C -UHAVE_JSON
155 CONFIGURE_ARGS += \
156 --with-json-c=yes
157 else
158 CONFIGURE_ARGS += \
159 --with-json-c=no
160 endif
161
162 ifdef CONFIG_BIND_LIBXML2
163 CONFIGURE_ARGS += \
164 --with-libxml2=yes
165 else
166 CONFIGURE_ARGS += \
167 --with-libxml2=no
168 endif
169
170 ifdef CONFIG_BIND_ENABLE_DOH
171 CONFIGURE_ARGS += \
172 --enable-doh
173 else
174 CONFIGURE_ARGS += \
175 --disable-doh
176 endif
177
178 CONFIGURE_VARS += \
179 BUILD_CC="$(TARGET_CC)" \
180
181 define Build/Compile
182 $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
183 BUILD_CC="$(HOSTCC)" \
184 CC="$(HOSTCC)" \
185 CFLAGS="-O2" \
186 LIBS="" \
187 gen
188 $(call Build/Compile/Default)
189 endef
190
191 define Package/bind-libs/install
192 $(INSTALL_DIR) $(1)/usr/lib
193 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
194 endef
195
196 define Package/bind-server/install
197 $(INSTALL_DIR) $(1)/usr/sbin
198 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
199 $(INSTALL_DIR) $(1)/etc/bind
200 $(CP) \
201 ./files/bind/db.0 \
202 ./files/bind/db.127 \
203 ./files/bind/db.255 \
204 ./files/bind/db.local \
205 ./files/bind/db.root \
206 ./files/bind/bind.keys \
207 $(1)/etc/bind/
208 sed -e '1s/ broadcast / empty rfc1918 /' \
209 < ./files/bind/db.0 \
210 > $(1)/etc/bind/db.empty
211 $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
212 $(INSTALL_DIR) $(1)/etc/init.d
213 $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
214 find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
215 endef
216
217 define Package/bind-server/conffiles
218 /etc/bind/db.0
219 /etc/bind/db.127
220 /etc/bind/db.255
221 /etc/bind/db.local
222 /etc/bind/db.root
223 /etc/bind/named.conf
224 endef
225
226 define Package/bind-server-filter-aaaa/install
227 $(INSTALL_DIR) $(1)/usr/lib/bind
228 $(CP) $(PKG_INSTALL_DIR)/usr/lib/bind/filter-aaaa.so $(1)/usr/lib/bind
229 endef
230
231 define Package/bind-client/install
232 $(INSTALL_DIR) $(1)/usr/bin
233 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
234 endef
235
236 define Package/bind-tools/install
237 $(INSTALL_DIR) $(1)/usr/bin
238 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/delv $(1)/usr/bin/
239 endef
240
241 define Package/bind-rndc/install
242 $(INSTALL_DIR) $(1)/usr/sbin
243 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
244 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
245 endef
246
247 define Package/bind-check/install
248 $(INSTALL_DIR) $(1)/usr/bin
249 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/named-checkconf $(1)/usr/bin/
250 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/named-checkzone $(1)/usr/bin/
251 endef
252
253 define Package/bind-dnssec/install
254 $(INSTALL_DIR) $(1)/usr/bin
255 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-keygen $(1)/usr/bin/
256 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-settime $(1)/usr/bin/
257 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-signzone $(1)/usr/bin/
258 endef
259
260 define Package/bind-host/install
261 $(INSTALL_DIR) $(1)/usr/bin
262 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
263 endef
264
265 define Package/bind-dig/install
266 $(INSTALL_DIR) $(1)/usr/bin
267 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
268 endef
269
270 define Package/bind-nslookup/install
271 $(INSTALL_DIR) $(1)/usr/libexec
272 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nslookup $(1)/usr/libexec/nslookup-bind
273 endef
274
275 define Package/bind-ddns-confgen/install
276 $(INSTALL_DIR) $(1)/usr/sbin
277 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ddns-confgen $(1)/usr/sbin/ddns-confgen
278 $(LN) -s ddns-confgen $(1)/usr/sbin/tsig-keygen
279 endef
280
281 $(eval $(call BuildPackage,bind-libs))
282 $(eval $(call BuildPackage,bind-server))
283 $(eval $(call BuildPackage,bind-server-filter-aaaa))
284 $(eval $(call BuildPackage,bind-client))
285 $(eval $(call BuildPackage,bind-tools))
286 $(eval $(call BuildPackage,bind-rndc))
287 $(eval $(call BuildPackage,bind-check))
288 $(eval $(call BuildPackage,bind-dnssec))
289 $(eval $(call BuildPackage,bind-host))
290 $(eval $(call BuildPackage,bind-dig))
291 $(eval $(call BuildPackage,bind-nslookup))
292 $(eval $(call BuildPackage,bind-ddns-confgen))