prometheus-node-exporter-lua: add dawn exporter
[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.16.3
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:=27ac6513de5f8d0db34b9f241da53baa15a14b2ad21338d0cde0826eaf564f7e
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-dnssec \
87 +bind-host \
88 +bind-rndc
89 endef
90
91 define Package/bind-rndc
92 $(call Package/bind/Default)
93 TITLE+= administration tools (rndc and rndc-confgen only)
94 endef
95
96 define Package/bind-check
97 $(call Package/bind/Default)
98 TITLE+= administration tools (named-checkconf and named-checkzone only)
99 endef
100
101 define Package/bind-dnssec
102 $(call Package/bind/Default)
103 TITLE+= administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only)
104 endef
105
106 define Package/bind-host
107 $(call Package/bind/Default)
108 TITLE+= simple DNS client
109 endef
110
111 define Package/bind-dig
112 $(call Package/bind/Default)
113 TITLE+= DNS excavation tool
114 endef
115
116 export BUILD_CC="$(TARGET_CC)"
117
118 TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
119
120 CONFIGURE_ARGS += \
121 --disable-linux-caps \
122 --with-openssl="$(STAGING_DIR)/usr" \
123 --with-libtool \
124 --without-lmdb \
125 --enable-epoll \
126 --without-gssapi \
127 --without-readline \
128 --without-python \
129 --sysconfdir=/etc/bind
130
131 ifdef CONFIG_BIND_LIBJSON
132 TARGET_CFLAGS += -DHAVE_JSON_C -UHAVE_JSON
133 CONFIGURE_ARGS += \
134 --with-json-c=yes
135 else
136 CONFIGURE_ARGS += \
137 --with-json-c=no
138 endif
139
140 ifdef CONFIG_BIND_LIBXML2
141 CONFIGURE_ARGS += \
142 --with-libxml2=yes
143 else
144 CONFIGURE_ARGS += \
145 --with-libxml2=no
146 endif
147
148 CONFIGURE_VARS += \
149 BUILD_CC="$(TARGET_CC)" \
150
151 define Build/Compile
152 $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
153 BUILD_CC="$(HOSTCC)" \
154 CC="$(HOSTCC)" \
155 CFLAGS="-O2" \
156 LIBS="" \
157 gen
158 $(call Build/Compile/Default)
159 endef
160
161 define Package/bind-libs/install
162 $(INSTALL_DIR) $(1)/usr/lib
163 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
164 endef
165
166 define Package/bind-server/install
167 $(INSTALL_DIR) $(1)/usr/sbin
168 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
169 $(INSTALL_DIR) $(1)/etc/bind
170 $(CP) \
171 ./files/bind/db.0 \
172 ./files/bind/db.127 \
173 ./files/bind/db.255 \
174 ./files/bind/db.local \
175 ./files/bind/db.root \
176 ./files/bind/bind.keys \
177 $(1)/etc/bind/
178 $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
179 $(INSTALL_DIR) $(1)/etc/init.d
180 $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
181 find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
182 endef
183
184 define Package/bind-server/conffiles
185 /etc/bind/db.0
186 /etc/bind/db.127
187 /etc/bind/db.255
188 /etc/bind/db.local
189 /etc/bind/db.root
190 /etc/bind/named.conf
191 endef
192
193 define Package/bind-server-filter-aaaa/install
194 $(INSTALL_DIR) $(1)/usr/lib/named
195 $(CP) $(PKG_INSTALL_DIR)/usr/lib/named/filter-aaaa.so $(1)/usr/lib/named
196 endef
197
198 define Package/bind-client/install
199 $(INSTALL_DIR) $(1)/usr/bin
200 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
201 endef
202
203 define Package/bind-tools/install
204 $(INSTALL_DIR) $(1)/usr/bin
205 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/delv $(1)/usr/bin/
206 endef
207
208 define Package/bind-rndc/install
209 $(INSTALL_DIR) $(1)/usr/sbin
210 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
211 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
212 endef
213
214 define Package/bind-check/install
215 $(INSTALL_DIR) $(1)/usr/sbin
216 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
217 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
218 endef
219
220 define Package/bind-dnssec/install
221 $(INSTALL_DIR) $(1)/usr/sbin
222 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
223 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
224 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
225 endef
226
227 define Package/bind-host/install
228 $(INSTALL_DIR) $(1)/usr/bin
229 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
230 endef
231
232 define Package/bind-dig/install
233 $(INSTALL_DIR) $(1)/usr/bin
234 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
235 endef
236
237 $(eval $(call BuildPackage,bind-libs))
238 $(eval $(call BuildPackage,bind-server))
239 $(eval $(call BuildPackage,bind-server-filter-aaaa))
240 $(eval $(call BuildPackage,bind-client))
241 $(eval $(call BuildPackage,bind-tools))
242 $(eval $(call BuildPackage,bind-rndc))
243 $(eval $(call BuildPackage,bind-check))
244 $(eval $(call BuildPackage,bind-dnssec))
245 $(eval $(call BuildPackage,bind-host))
246 $(eval $(call BuildPackage,bind-dig))