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