Fix/clean several hundred package makefiles
[packages.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 PKG_BUILDDEP:=libopenssl
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/bind
29   SECTION:=net
30   CATEGORY:=Network
31   SUBMENU:=ISC's DNS suite implementation
32   DEPENDS:=+libopenssl
33   TITLE:=ISC's DNS suite implementation
34   DESCRIPTION:=ISC's DNS suite implementation
35   URL:=http://www.isc.org/sw/bind/
36 endef
37
38 define Package/bind-server
39   $(call Package/bind)
40   DEFAULT:=m if ALL
41   TITLE:=ISC's DNS server implementation
42   DESCRIPTION:=ISC's DNS server implementation
43 endef
44
45 define Package/bind-client
46   $(call Package/bind)
47   DEFAULT:=m if ALL
48   TITLE:=A dynamic DNS client
49   DESCRIPTION:=A dynamic DNS client
50 endef
51
52 define Package/bind-tools
53   $(call Package/bind)
54   DEFAULT:=m if ALL
55   TITLE:=Bind administration tools
56   DESCRIPTION:=A DNS client
57 endef
58   
59 define Package/bind-rndc
60   $(call Package/bind)
61   DEFAULT:=m if ALL  
62   TITLE:=bind administration tools (rndc and rndc-confgen only)
63   DESCRIPTION:=bind administration tools (rndc and rndc-confgen only)
64 endef
65
66 define Package/bind-check
67   $(call Package/bind)
68   DEFAULT:=m if ALL
69   TITLE:=bind administration tools (named-checkconf and named-checkzone only)
70   DESCRIPTION:=bind administration tools (named-checkconf and named-checkzone only)
71 endef
72
73 define Package/bind-dnssec
74   $(call Package/bind)
75   DEFAULT:=m if ALL
76   TITLE:=Bind administration tools (dnssec-keygen and dnssec-signzone only)
77   DESCRIPTION:=Bind administration tools (dnssec-keygen and dnssec-signzone only)
78 endef
79
80 define Package/bind-host
81   $(call Package/bind)
82   DEFAULT:=m if ALL
83   TITLE:=A simple DNS client
84   DESCRIPTION:=A simple DNS client
85 endef
86
87 define Package/bind-dig
88   $(call Package/bind)
89   DEFAULT:=m if ALL
90   TITLE:=A DNS client
91   DESCRIPTION:=A DNS client
92 endef
93
94 define Package/Build/Configure
95 $(call Build/Configure/Default,--enable-shared \
96 --enable-static \
97 --enable-ipv6 \
98 --with-randomdev=/dev/urandom \
99 --disable-threads \
100 --with-openssl=$(STAGING_DIR)/usr/
101 )
102 endef
103
104 define Build/Compile
105         rm -rf $(PKG_INSTALL_DIR)
106         mkdir -p $(PKG_INSTALL_DIR)
107         $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
108                 CC="$(HOSTCC)" \
109                 CFLAGS="-O2" \
110                 gen
111         $(MAKE) -C $(PKG_BUILD_DIR) \
112         DESTDIR="$(PKG_INSTALL_DIR)" \
113                 all install
114 endef
115
116 define Package/bind-server/install
117         install -d -m0755 $(1)/usr/sbin
118         install -d -m0755 $(1)/etc/init.d
119         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
120         $(CP) files/bind $(1)/etc
121         $(CP) files/named.init $(1)/etc/init.d/S$(PKG_INIT_LEVEL)named
122         find $(1)/etc/bind -name ".svn" | xargs rm -rf
123 endef
124
125 define Package/bind-client/install
126         install -d -m0755 $(1)/usr/bin
127         $(CP) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
128 endef
129
130 define Package/bind-tools/install
131         install -d -m0755 $(1)/usr/bin
132         install -d -m0755 $(1)/usr/sbin
133         $(CP) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
134         $(CP) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
135         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
136         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
137         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
138         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
139         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
140         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
141 endef
142
143 define Package/bind-rndc/install
144         install -d -m0755 $(1)/usr/sbin
145         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
146         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
147 endef
148
149 define Package/bind-check/install
150         install -d -m0755 $(1)/usr/sbin
151         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
152         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
153 endef
154
155 define Package/bind-dnssec/install
156         install -d -m0755 $(1)/usr/sbin
157         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
158         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
159 endef
160
161 define Package/bind-host/install
162         install -d -m0755 $(1)/usr/bin
163         $(CP) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
164 endef
165
166 define Package/bind-dig/install
167         install -d -m0755 $(1)/usr/bin
168         $(CP) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
169 endef
170
171 $(eval $(call BuildPackage,bind-server))
172 $(eval $(call BuildPackage,bind-client))
173 $(eval $(call BuildPackage,bind-tools))
174 $(eval $(call BuildPackage,bind-rndc))
175 $(eval $(call BuildPackage,bind-check))
176 $(eval $(call BuildPackage,bind-dnssec))
177 $(eval $(call BuildPackage,bind-host))
178 $(eval $(call BuildPackage,bind-dig))