8d751cf2a230a137ba74aade529ed86b88d1305a
[openwrt/svn-archive/archive.git] / net / bind / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=bind
12 PKG_VERSION:=9.3.1
13 PKG_RELEASE:=7
14 PKG_BUILDDEP:=openssl
15
16 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_SOURCE_URL:=ftp://ftp.isc.org/isc/bind9/9.3.1/
19 PKG_MD5SUM:=9ff3204eea27184ea0722f37e43fc95d
20 PKG_CAT:=zcat
21
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/bind
27 SECTION:=net
28 CATEGORY:=Network
29 SUBMENU:=ISC's DNS suite implementation
30 DEPENDS:=+libopenssl
31 TITLE:=ISC's DNS suite implementation
32 DESCRIPTION:=ISC's DNS suite implementation
33 URL:=http://www.isc.org/sw/bind/
34 endef
35
36 define Package/bind-server
37 $(call Package/bind)
38 DEFAULT:=m if ALL
39 TITLE:=ISC's DNS server implementation
40 DESCRIPTION:=ISC's DNS server implementation
41 endef
42
43 define Package/bind-client
44 $(call Package/bind)
45 DEFAULT:=m if ALL
46 TITLE:=A dynamic DNS client
47 DESCRIPTION:=A dynamic DNS client
48 endef
49
50 define Package/bind-tools
51 $(call Package/bind)
52 DEFAULT:=m if ALL
53 TITLE:=Bind administration tools
54 DESCRIPTION:=A DNS client
55 endef
56
57 define Package/bind-rndc
58 $(call Package/bind)
59 DEFAULT:=m if ALL
60 TITLE:=bind administration tools (rndc and rndc-confgen only)
61 DESCRIPTION:=bind administration tools (rndc and rndc-confgen only)
62 endef
63
64 define Package/bind-check
65 $(call Package/bind)
66 DEFAULT:=m if ALL
67 TITLE:=bind administration tools (named-checkconf and named-checkzone only)
68 DESCRIPTION:=bind administration tools (named-checkconf and named-checkzone only)
69 endef
70
71 define Package/bind-dnssec
72 $(call Package/bind)
73 DEFAULT:=m if ALL
74 TITLE:=Bind administration tools (dnssec-keygen and dnssec-signzone only)
75 DESCRIPTION:=Bind administration tools (dnssec-keygen and dnssec-signzone only)
76 endef
77
78 define Package/bind-host
79 $(call Package/bind)
80 DEFAULT:=m if ALL
81 TITLE:=A simple DNS client
82 DESCRIPTION:=A simple DNS client
83 endef
84
85 define Package/bind-dig
86 $(call Package/bind)
87 DEFAULT:=m if ALL
88 TITLE:=A DNS client
89 DESCRIPTION:=A DNS client
90 endef
91
92 define Package/Build/Configure
93 $(call Build/Configure/Default,--enable-shared \
94 --enable-static \
95 --enable-ipv6 \
96 --with-randomdev=/dev/urandom \
97 --disable-threads \
98 --with-openssl=$(STAGING_DIR)/usr/
99 )
100 endef
101
102 define Build/Compile
103 rm -rf $(PKG_INSTALL_DIR)
104 mkdir -p $(PKG_INSTALL_DIR)
105 $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
106 CC="$(HOSTCC)" \
107 CFLAGS="-O2" \
108 gen
109 $(MAKE) -C $(PKG_BUILD_DIR) \
110 DESTDIR="$(PKG_INSTALL_DIR)" \
111 STAGING_DIR=$(STAGING_DIR) \
112 all install
113 endef
114
115 define Package/bind-server/install
116 install -d -m0755 $(1)/usr/sbin
117 install -d -m0755 $(1)/etc/init.d
118 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
119 $(CP) files/bind $(1)/etc
120 $(CP) files/named.init $(1)/etc/init.d/S$(PKG_INIT_LEVEL)named
121 find $(1)/etc/bind -name ".svn" | xargs rm -rf
122 endef
123
124 define Package/bind-client/install
125 install -d -m0755 $(1)/usr/bin
126 $(CP) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
127 endef
128
129 define Package/bind-tools/install
130 install -d -m0755 $(1)/usr/bin
131 install -d -m0755 $(1)/usr/sbin
132 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
133 $(CP) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
134 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
135 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
136 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
137 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
138 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
139 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
140 endef
141
142 define Package/bind-rndc/install
143 install -d -m0755 $(1)/usr/sbin
144 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
145 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
146 endef
147
148 define Package/bind-check/install
149 install -d -m0755 $(1)/usr/sbin
150 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
151 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
152 endef
153
154 define Package/bind-dnssec/install
155 install -d -m0755 $(1)/usr/sbin
156 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
157 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
158 endef
159
160 define Package/bind-host/install
161 install -d -m0755 $(1)/usr/bin
162 $(CP) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
163 endef
164
165 define Package/bind-dig/install
166 install -d -m0755 $(1)/usr/bin
167 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
168 endef
169
170 $(eval $(call BuildPackage,bind-server))
171 $(eval $(call BuildPackage,bind-client))
172 $(eval $(call BuildPackage,bind-tools))
173 $(eval $(call BuildPackage,bind-rndc))
174 $(eval $(call BuildPackage,bind-check))
175 $(eval $(call BuildPackage,bind-dnssec))
176 $(eval $(call BuildPackage,bind-host))
177 $(eval $(call BuildPackage,bind-dig))