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