Merge pull request #2394 from donald-rumata/subversion
[feed/packages.git] / net / bind / Makefile
1 #
2 # Copyright (C) 2006-2012 OpenWrt.org
3 # 2014 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.9.8-P4
13 PKG_RELEASE:=3
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:=5e401f6cf024f596044d733ceb0d6415
24
25 PKG_FIXUP:=autoreconf
26 PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
27
28 PKG_INSTALL:=1
29
30 PKG_CONFIG_DEPENDS := \
31 CONFIG_OPENSSL_WITH_EC \
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
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
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 endef
57
58 define Package/bind-server/config
59 source "$(SOURCE)/Config.in"
60 endef
61
62 define Package/bind-client
63 $(call Package/bind/Default)
64 TITLE+= dynamic DNS client
65 endef
66
67 define Package/bind-tools
68 $(call Package/bind/Default)
69 TITLE+= administration tools (all)
70 endef
71
72 define Package/bind-rndc
73 $(call Package/bind/Default)
74 TITLE+= administration tools (rndc and rndc-confgen only)
75 endef
76
77 define Package/bind-check
78 $(call Package/bind/Default)
79 TITLE+= administration tools (named-checkconf and named-checkzone only)
80 endef
81
82 define Package/bind-dnssec
83 $(call Package/bind/Default)
84 TITLE+= administration tools (dnssec-keygen and dnssec-signzone only)
85 endef
86
87 define Package/bind-host
88 $(call Package/bind/Default)
89 TITLE+= simple DNS client
90 endef
91
92 define Package/bind-dig
93 $(call Package/bind/Default)
94 TITLE+= DNS excavation tool
95 endef
96
97 export BUILD_CC="$(TARGET_CC)"
98
99 CONFIGURE_ARGS += \
100 --enable-shared \
101 --enable-static \
102 --with-randomdev="/dev/urandom" \
103 --disable-threads \
104 --disable-linux-caps \
105 --with-openssl="$(STAGING_DIR)/usr" \
106 --with-libtool \
107 --with-libxml2=no \
108 --enable-epoll=yes \
109 --with-gost=no \
110 --with-gssapi=no \
111 --with-ecdsa=$(if $(CONFIG_OPENSSL_WITH_EC),yes,no) \
112 --with-readline=no
113
114 ifdef CONFIG_BIND_ENABLE_FILTER_AAAA
115 CONFIGURE_ARGS += \
116 --enable-filter-aaaa
117 endif
118
119 CONFIGURE_VARS += \
120 BUILD_CC="$(TARGET_CC)" \
121
122 define Build/Compile
123 $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
124 BUILD_CC="$(HOSTCC)" \
125 CC="$(HOSTCC)" \
126 CFLAGS="-O2" \
127 LIBS="" \
128 gen
129 $(call Build/Compile/Default)
130 endef
131
132 define Package/bind-libs/install
133 $(INSTALL_DIR) $(1)/usr/lib
134 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
135 endef
136
137 define Package/bind-server/install
138 $(INSTALL_DIR) $(1)/usr/sbin
139 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
140 $(INSTALL_DIR) $(1)/etc/bind
141 $(CP) \
142 ./files/bind/db.0 \
143 ./files/bind/db.127 \
144 ./files/bind/db.255 \
145 ./files/bind/db.local \
146 ./files/bind/db.root \
147 $(1)/etc/bind/
148 $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
149 $(INSTALL_DIR) $(1)/etc/init.d
150 $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
151 find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
152 endef
153
154 define Package/bind-server/conffiles
155 /etc/bind/db.0
156 /etc/bind/db.127
157 /etc/bind/db.255
158 /etc/bind/db.local
159 /etc/bind/db.root
160 /etc/bind/named.conf
161 endef
162
163 define Package/bind-client/install
164 $(INSTALL_DIR) $(1)/usr/bin
165 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
166 endef
167
168 define Package/bind-tools/install
169 $(INSTALL_DIR) $(1)/usr/bin
170 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
171 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
172 $(INSTALL_DIR) $(1)/usr/sbin
173 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
174 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
175 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
176 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
177 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
178 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
179 endef
180
181 define Package/bind-rndc/install
182 $(INSTALL_DIR) $(1)/usr/sbin
183 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
184 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
185 endef
186
187 define Package/bind-check/install
188 $(INSTALL_DIR) $(1)/usr/sbin
189 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
190 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
191 endef
192
193 define Package/bind-dnssec/install
194 $(INSTALL_DIR) $(1)/usr/sbin
195 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
196 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
197 endef
198
199 define Package/bind-host/install
200 $(INSTALL_DIR) $(1)/usr/bin
201 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
202 endef
203
204 define Package/bind-dig/install
205 $(INSTALL_DIR) $(1)/usr/bin
206 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
207 endef
208
209 $(eval $(call BuildPackage,bind-libs))
210 $(eval $(call BuildPackage,bind-server))
211 $(eval $(call BuildPackage,bind-client))
212 $(eval $(call BuildPackage,bind-tools))
213 $(eval $(call BuildPackage,bind-rndc))
214 $(eval $(call BuildPackage,bind-check))
215 $(eval $(call BuildPackage,bind-dnssec))
216 $(eval $(call BuildPackage,bind-host))
217 $(eval $(call BuildPackage,bind-dig))