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