Merge pull request #4853 from StevenHessing/noddos
[feed/packages.git] / net / bind / Makefile
1 #
2 # Copyright (C) 2006-2012 OpenWrt.org
3 # 2014-2017 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.11.2
13 PKG_RELEASE:=2
14 USERID:=bind=57:bind=57
15
16 PKG_MAINTAINER:=Noah Meyerhans <frodo@morgul.net>
17 PKG_LICENSE := BSD-3-Clause
18
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
20 PKG_SOURCE_URL:= \
21 http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION) \
22 http://ftp.isc.org/isc/bind9/$(PKG_VERSION)
23 PKG_HASH:=7f46ad8620f7c3b0ac375d7a5211b15677708fda84ce25d7aeb7222fe2e3c77a
24
25 PKG_FIXUP:=autoreconf
26 PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
27
28 PKG_INSTALL:=1
29 PKG_USE_MIPS16:=0
30
31 PKG_CONFIG_DEPENDS := \
32 CONFIG_BIND_ENABLE_FILTER_AAAA
33
34 include $(INCLUDE_DIR)/package.mk
35
36 define Package/bind/Default
37 SECTION:=net
38 CATEGORY:=Network
39 DEPENDS:=+bind-libs +@OPENSSL_WITH_EC
40 TITLE:=bind
41 URL:=https://www.isc.org/software/bind
42 SUBMENU:=IP Addresses and Names
43 endef
44
45 define Package/bind-libs
46 SECTION:=libs
47 CATEGORY:=Libraries
48 DEPENDS:=+libopenssl +zlib
49 TITLE:=bind shared libraries
50 URL:=https://www.isc.org/software/bind
51 endef
52
53 define Package/bind-server
54 $(call Package/bind/Default)
55 TITLE+= DNS server
56 DEPENDS+= +@OPENSSL_WITH_DEPRECATED
57 endef
58
59 define Package/bind-server/config
60 source "$(SOURCE)/Config.in"
61 endef
62
63 define Package/bind-client
64 $(call Package/bind/Default)
65 TITLE+= dynamic DNS client
66 endef
67
68 define Package/bind-tools
69 $(call Package/bind/Default)
70 TITLE+= administration tools (all)
71 endef
72
73 define Package/bind-rndc
74 $(call Package/bind/Default)
75 TITLE+= administration tools (rndc and rndc-confgen only)
76 endef
77
78 define Package/bind-check
79 $(call Package/bind/Default)
80 TITLE+= administration tools (named-checkconf and named-checkzone only)
81 endef
82
83 define Package/bind-dnssec
84 $(call Package/bind/Default)
85 TITLE+= administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only)
86 endef
87
88 define Package/bind-host
89 $(call Package/bind/Default)
90 TITLE+= simple DNS client
91 endef
92
93 define Package/bind-dig
94 $(call Package/bind/Default)
95 TITLE+= DNS excavation tool
96 endef
97
98 export BUILD_CC="$(TARGET_CC)"
99
100 CONFIGURE_ARGS += \
101 --enable-shared \
102 --enable-static \
103 --with-randomdev="/dev/urandom" \
104 --disable-threads \
105 --disable-linux-caps \
106 --with-openssl="$(STAGING_DIR)/usr" \
107 --with-libjson=no \
108 --with-libtool \
109 --with-libxml2=no \
110 --without-lmdb \
111 --enable-epoll=yes \
112 --with-gost=no \
113 --with-gssapi=no \
114 --with-ecdsa=$(if $(CONFIG_OPENSSL_WITH_EC),yes,no) \
115 --with-readline=no \
116 --sysconfdir=/etc/bind
117
118 ifdef CONFIG_BIND_ENABLE_FILTER_AAAA
119 CONFIGURE_ARGS += \
120 --enable-filter-aaaa
121 endif
122
123 CONFIGURE_VARS += \
124 BUILD_CC="$(TARGET_CC)" \
125
126 define Build/Compile
127 $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
128 BUILD_CC="$(HOSTCC)" \
129 CC="$(HOSTCC)" \
130 CFLAGS="-O2" \
131 LIBS="" \
132 gen
133 $(call Build/Compile/Default)
134 endef
135
136 define Package/bind-libs/install
137 $(INSTALL_DIR) $(1)/usr/lib
138 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
139 endef
140
141 define Package/bind-server/install
142 $(INSTALL_DIR) $(1)/usr/sbin
143 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
144 $(INSTALL_DIR) $(1)/etc/bind
145 $(CP) \
146 ./files/bind/db.0 \
147 ./files/bind/db.127 \
148 ./files/bind/db.255 \
149 ./files/bind/db.local \
150 ./files/bind/db.root \
151 $(1)/etc/bind/
152 $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
153 $(INSTALL_DIR) $(1)/etc/init.d
154 $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
155 find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
156 endef
157
158 define Package/bind-server/conffiles
159 /etc/bind/db.0
160 /etc/bind/db.127
161 /etc/bind/db.255
162 /etc/bind/db.local
163 /etc/bind/db.root
164 /etc/bind/named.conf
165 endef
166
167 define Package/bind-client/install
168 $(INSTALL_DIR) $(1)/usr/bin
169 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
170 endef
171
172 define Package/bind-tools/install
173 $(INSTALL_DIR) $(1)/usr/bin
174 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
175 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
176 $(INSTALL_DIR) $(1)/usr/sbin
177 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
178 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
179 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
180 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
181 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
182 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
183 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
184 endef
185
186 define Package/bind-rndc/install
187 $(INSTALL_DIR) $(1)/usr/sbin
188 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
189 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
190 endef
191
192 define Package/bind-check/install
193 $(INSTALL_DIR) $(1)/usr/sbin
194 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
195 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
196 endef
197
198 define Package/bind-dnssec/install
199 $(INSTALL_DIR) $(1)/usr/sbin
200 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
201 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
202 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
203 endef
204
205 define Package/bind-host/install
206 $(INSTALL_DIR) $(1)/usr/bin
207 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
208 endef
209
210 define Package/bind-dig/install
211 $(INSTALL_DIR) $(1)/usr/bin
212 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
213 endef
214
215 $(eval $(call BuildPackage,bind-libs))
216 $(eval $(call BuildPackage,bind-server))
217 $(eval $(call BuildPackage,bind-client))
218 $(eval $(call BuildPackage,bind-tools))
219 $(eval $(call BuildPackage,bind-rndc))
220 $(eval $(call BuildPackage,bind-check))
221 $(eval $(call BuildPackage,bind-dnssec))
222 $(eval $(call BuildPackage,bind-host))
223 $(eval $(call BuildPackage,bind-dig))