[packages] bind: update to 9.9.1, use PKG_INSTALL
[openwrt/svn-archive/archive.git] / net / bind / Makefile
1 #
2 # Copyright (C) 2006-2012 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=bind
11 PKG_VERSION:=9.9.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:= \
16 ftp://ftp.isc.org/isc/bind9/$(PKG_VERSION) \
17 http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION)
18 PKG_MD5SUM:=bb37c88f81e03b1d5208d238c6aa51fa
19
20 PKG_FIXUP:=libtool
21 PKG_INSTALL:=1
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/bind/Default
26 SECTION:=net
27 CATEGORY:=Network
28 DEPENDS:=+bind-libs +libopenssl
29 TITLE:=bind
30 URL:=https://www.isc.org/software/bind
31 SUBMENU:=IP Addresses and Names
32 endef
33
34 define Package/bind-libs
35 SECTION:=libs
36 CATEGORY:=Libraries
37 TITLE:=bind shared libraries
38 URL:=https://www.isc.org/software/bind
39 endef
40
41 define Package/bind-server
42 $(call Package/bind/Default)
43 TITLE+= DNS server
44 endef
45
46 define Package/bind-client
47 $(call Package/bind/Default)
48 TITLE+= dynamic DNS client
49 endef
50
51 define Package/bind-tools
52 $(call Package/bind/Default)
53 TITLE+= administration tools (all)
54 endef
55
56 define Package/bind-rndc
57 $(call Package/bind/Default)
58 TITLE+= administration tools (rndc and rndc-confgen only)
59 endef
60
61 define Package/bind-check
62 $(call Package/bind/Default)
63 TITLE+= administration tools (named-checkconf and named-checkzone only)
64 endef
65
66 define Package/bind-dnssec
67 $(call Package/bind/Default)
68 TITLE+= administration tools (dnssec-keygen and dnssec-signzone only)
69 endef
70
71 define Package/bind-host
72 $(call Package/bind/Default)
73 TITLE+= simple DNS client
74 endef
75
76 define Package/bind-dig
77 $(call Package/bind/Default)
78 TITLE+= DNS excavation tool
79 endef
80
81 export BUILD_CC="$(TARGET_CC)"
82
83 CONFIGURE_ARGS += \
84 --enable-shared \
85 --enable-static \
86 --with-randomdev="/dev/urandom" \
87 --disable-threads \
88 --with-openssl="$(STAGING_DIR)/usr" \
89 --with-libtool \
90 --with-libxml2=no \
91 --enable-epoll=yes \
92 --with-gost=no \
93 --with-gssapi=no \
94 --with-readline=no
95
96 CONFIGURE_VARS += \
97 BUILD_CC="$(TARGET_CC)" \
98
99 define Build/Compile
100 $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
101 BUILD_CC="$(HOSTCC)" \
102 CC="$(HOSTCC)" \
103 CFLAGS="-O2" \
104 LIBS="" \
105 gen
106 $(call Build/Compile/Default)
107 endef
108
109 define Package/bind-libs/install
110 $(INSTALL_DIR) $(1)/usr/lib
111 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
112 endef
113
114 define Package/bind-server/install
115 $(INSTALL_DIR) $(1)/usr/sbin
116 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
117 $(INSTALL_DIR) $(1)/etc/bind
118 $(CP) \
119 ./files/bind/db.0 \
120 ./files/bind/db.127 \
121 ./files/bind/db.255 \
122 ./files/bind/db.local \
123 ./files/bind/db.root \
124 $(1)/etc/bind/
125 $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
126 $(INSTALL_DIR) $(1)/etc/init.d
127 $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
128 find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
129 endef
130
131 define Package/bind-server/conffiles
132 /etc/bind/db.0
133 /etc/bind/db.127
134 /etc/bind/db.255
135 /etc/bind/db.local
136 /etc/bind/db.root
137 /etc/bind/named.conf
138 endef
139
140 define Package/bind-client/install
141 $(INSTALL_DIR) $(1)/usr/bin
142 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
143 endef
144
145 define Package/bind-tools/install
146 $(INSTALL_DIR) $(1)/usr/bin
147 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
148 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
149 $(INSTALL_DIR) $(1)/usr/sbin
150 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
151 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
152 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
153 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
154 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
155 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
156 endef
157
158 define Package/bind-rndc/install
159 $(INSTALL_DIR) $(1)/usr/sbin
160 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
161 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
162 endef
163
164 define Package/bind-check/install
165 $(INSTALL_DIR) $(1)/usr/sbin
166 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
167 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
168 endef
169
170 define Package/bind-dnssec/install
171 $(INSTALL_DIR) $(1)/usr/sbin
172 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
173 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
174 endef
175
176 define Package/bind-host/install
177 $(INSTALL_DIR) $(1)/usr/bin
178 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
179 endef
180
181 define Package/bind-dig/install
182 $(INSTALL_DIR) $(1)/usr/bin
183 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
184 endef
185
186 $(eval $(call BuildPackage,bind-libs))
187 $(eval $(call BuildPackage,bind-server))
188 $(eval $(call BuildPackage,bind-client))
189 $(eval $(call BuildPackage,bind-tools))
190 $(eval $(call BuildPackage,bind-rndc))
191 $(eval $(call BuildPackage,bind-check))
192 $(eval $(call BuildPackage,bind-dnssec))
193 $(eval $(call BuildPackage,bind-host))
194 $(eval $(call BuildPackage,bind-dig))