Merge pull request #3498 from fededim/master
[feed/packages.git] / net / bind / Makefile
1 #
2 # Copyright (C) 2006-2012 OpenWrt.org
3 # 2014-2016 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.10.4-P4
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 ftp://ftp.isc.org/isc/bind9/$(PKG_VERSION) \
22 http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION)
23 PKG_MD5SUM:=e110904a1d54f83f01d4be8bcd842927
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_OPENSSL_WITH_EC \
33 CONFIG_BIND_ENABLE_FILTER_AAAA
34
35 include $(INCLUDE_DIR)/package.mk
36
37 define Package/bind/Default
38 SECTION:=net
39 CATEGORY:=Network
40 DEPENDS:=+bind-libs
41 TITLE:=bind
42 URL:=https://www.isc.org/software/bind
43 SUBMENU:=IP Addresses and Names
44 endef
45
46 define Package/bind-libs
47 SECTION:=libs
48 CATEGORY:=Libraries
49 DEPENDS:=+libopenssl
50 TITLE:=bind shared libraries
51 URL:=https://www.isc.org/software/bind
52 endef
53
54 define Package/bind-server
55 $(call Package/bind/Default)
56 TITLE+= DNS server
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 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 --enable-epoll=yes \
111 --with-gost=no \
112 --with-gssapi=no \
113 --with-ecdsa=$(if $(CONFIG_OPENSSL_WITH_EC),yes,no) \
114 --with-readline=no \
115 --sysconfdir=/etc/bind
116
117 ifdef CONFIG_BIND_ENABLE_FILTER_AAAA
118 CONFIGURE_ARGS += \
119 --enable-filter-aaaa
120 endif
121
122 CONFIGURE_VARS += \
123 BUILD_CC="$(TARGET_CC)" \
124
125 define Build/Compile
126 $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
127 BUILD_CC="$(HOSTCC)" \
128 CC="$(HOSTCC)" \
129 CFLAGS="-O2" \
130 LIBS="" \
131 gen
132 $(call Build/Compile/Default)
133 endef
134
135 define Package/bind-libs/install
136 $(INSTALL_DIR) $(1)/usr/lib
137 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
138 endef
139
140 define Package/bind-server/install
141 $(INSTALL_DIR) $(1)/usr/sbin
142 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
143 $(INSTALL_DIR) $(1)/etc/bind
144 $(CP) \
145 ./files/bind/db.0 \
146 ./files/bind/db.127 \
147 ./files/bind/db.255 \
148 ./files/bind/db.local \
149 ./files/bind/db.root \
150 $(1)/etc/bind/
151 $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
152 $(INSTALL_DIR) $(1)/etc/init.d
153 $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
154 find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
155 endef
156
157 define Package/bind-server/conffiles
158 /etc/bind/db.0
159 /etc/bind/db.127
160 /etc/bind/db.255
161 /etc/bind/db.local
162 /etc/bind/db.root
163 /etc/bind/named.conf
164 endef
165
166 define Package/bind-client/install
167 $(INSTALL_DIR) $(1)/usr/bin
168 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
169 endef
170
171 define Package/bind-tools/install
172 $(INSTALL_DIR) $(1)/usr/bin
173 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
174 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
175 $(INSTALL_DIR) $(1)/usr/sbin
176 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
177 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
178 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
179 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
180 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
181 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
182 endef
183
184 define Package/bind-rndc/install
185 $(INSTALL_DIR) $(1)/usr/sbin
186 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
187 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
188 endef
189
190 define Package/bind-check/install
191 $(INSTALL_DIR) $(1)/usr/sbin
192 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
193 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
194 endef
195
196 define Package/bind-dnssec/install
197 $(INSTALL_DIR) $(1)/usr/sbin
198 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
199 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
200 endef
201
202 define Package/bind-host/install
203 $(INSTALL_DIR) $(1)/usr/bin
204 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
205 endef
206
207 define Package/bind-dig/install
208 $(INSTALL_DIR) $(1)/usr/bin
209 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
210 endef
211
212 $(eval $(call BuildPackage,bind-libs))
213 $(eval $(call BuildPackage,bind-server))
214 $(eval $(call BuildPackage,bind-client))
215 $(eval $(call BuildPackage,bind-tools))
216 $(eval $(call BuildPackage,bind-rndc))
217 $(eval $(call BuildPackage,bind-check))
218 $(eval $(call BuildPackage,bind-dnssec))
219 $(eval $(call BuildPackage,bind-host))
220 $(eval $(call BuildPackage,bind-dig))