71886db91279073f8981e43cea86349bf34ee80c
[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:=1
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 include $(INCLUDE_DIR)/package.mk
32
33 define Package/bind/Default
34 SECTION:=net
35 CATEGORY:=Network
36 DEPENDS:=+bind-libs
37 TITLE:=bind
38 URL:=https://www.isc.org/software/bind
39 SUBMENU:=IP Addresses and Names
40 endef
41
42 define Package/bind-libs
43 SECTION:=libs
44 CATEGORY:=Libraries
45 DEPENDS:=+libopenssl
46 TITLE:=bind shared libraries
47 URL:=https://www.isc.org/software/bind
48 endef
49
50 define Package/bind-server
51 $(call Package/bind/Default)
52 TITLE+= DNS server
53 endef
54
55 define Package/bind-client
56 $(call Package/bind/Default)
57 TITLE+= dynamic DNS client
58 endef
59
60 define Package/bind-tools
61 $(call Package/bind/Default)
62 TITLE+= administration tools (all)
63 endef
64
65 define Package/bind-rndc
66 $(call Package/bind/Default)
67 TITLE+= administration tools (rndc and rndc-confgen only)
68 endef
69
70 define Package/bind-check
71 $(call Package/bind/Default)
72 TITLE+= administration tools (named-checkconf and named-checkzone only)
73 endef
74
75 define Package/bind-dnssec
76 $(call Package/bind/Default)
77 TITLE+= administration tools (dnssec-keygen and dnssec-signzone only)
78 endef
79
80 define Package/bind-host
81 $(call Package/bind/Default)
82 TITLE+= simple DNS client
83 endef
84
85 define Package/bind-dig
86 $(call Package/bind/Default)
87 TITLE+= DNS excavation tool
88 endef
89
90 export BUILD_CC="$(TARGET_CC)"
91
92 CONFIGURE_ARGS += \
93 --enable-shared \
94 --enable-static \
95 --with-randomdev="/dev/urandom" \
96 --disable-threads \
97 --disable-linux-caps \
98 --with-openssl="$(STAGING_DIR)/usr" \
99 --with-libtool \
100 --with-libxml2=no \
101 --enable-epoll=yes \
102 --with-gost=no \
103 --with-gssapi=no \
104 --with-ecdsa=no \
105 --with-readline=no
106
107 CONFIGURE_VARS += \
108 BUILD_CC="$(TARGET_CC)" \
109
110 define Build/Compile
111 $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
112 BUILD_CC="$(HOSTCC)" \
113 CC="$(HOSTCC)" \
114 CFLAGS="-O2" \
115 LIBS="" \
116 gen
117 $(call Build/Compile/Default)
118 endef
119
120 define Package/bind-libs/install
121 $(INSTALL_DIR) $(1)/usr/lib
122 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
123 endef
124
125 define Package/bind-server/install
126 $(INSTALL_DIR) $(1)/usr/sbin
127 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
128 $(INSTALL_DIR) $(1)/etc/bind
129 $(CP) \
130 ./files/bind/db.0 \
131 ./files/bind/db.127 \
132 ./files/bind/db.255 \
133 ./files/bind/db.local \
134 ./files/bind/db.root \
135 $(1)/etc/bind/
136 $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
137 $(INSTALL_DIR) $(1)/etc/init.d
138 $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
139 find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
140 endef
141
142 define Package/bind-server/conffiles
143 /etc/bind/db.0
144 /etc/bind/db.127
145 /etc/bind/db.255
146 /etc/bind/db.local
147 /etc/bind/db.root
148 /etc/bind/named.conf
149 endef
150
151 define Package/bind-client/install
152 $(INSTALL_DIR) $(1)/usr/bin
153 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
154 endef
155
156 define Package/bind-tools/install
157 $(INSTALL_DIR) $(1)/usr/bin
158 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
159 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
160 $(INSTALL_DIR) $(1)/usr/sbin
161 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
162 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
163 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
164 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
165 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
166 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
167 endef
168
169 define Package/bind-rndc/install
170 $(INSTALL_DIR) $(1)/usr/sbin
171 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
172 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
173 endef
174
175 define Package/bind-check/install
176 $(INSTALL_DIR) $(1)/usr/sbin
177 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
178 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
179 endef
180
181 define Package/bind-dnssec/install
182 $(INSTALL_DIR) $(1)/usr/sbin
183 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
184 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
185 endef
186
187 define Package/bind-host/install
188 $(INSTALL_DIR) $(1)/usr/bin
189 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
190 endef
191
192 define Package/bind-dig/install
193 $(INSTALL_DIR) $(1)/usr/bin
194 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
195 endef
196
197 $(eval $(call BuildPackage,bind-libs))
198 $(eval $(call BuildPackage,bind-server))
199 $(eval $(call BuildPackage,bind-client))
200 $(eval $(call BuildPackage,bind-tools))
201 $(eval $(call BuildPackage,bind-rndc))
202 $(eval $(call BuildPackage,bind-check))
203 $(eval $(call BuildPackage,bind-dnssec))
204 $(eval $(call BuildPackage,bind-host))
205 $(eval $(call BuildPackage,bind-dig))