add submenus to several packages
[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.4.1
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:= \
17         ftp://ftp.isc.org/isc/bind9/$(PKG_VERSION) \
18         http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION)
19 PKG_MD5SUM:=09b54d35036cb0423b2e618f21766285
20 PKG_CAT:=zcat
21
22 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
23 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
24
25 PKG_BUILD_DEPENDS:=libopenssl
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/bind/Default
30   SECTION:=net
31   CATEGORY:=Network
32   DEPENDS:=+bind-libs
33   TITLE:=bind
34   URL:=http://www.isc.org/sw/bind/
35   SUBMENU:=dns
36 endef
37
38 define Package/bind-libs
39   SECTION:=net
40   CATEGORY:=Network
41   TITLE:=bind shared libraries
42   URL:=http://www.isc.org/sw/bind/
43   SUBMENU:=dns
44 endef
45
46 define Package/bind-server
47   $(call Package/bind/Default)
48   TITLE+= DNS server
49 endef
50
51 define Package/bind-client
52   $(call Package/bind/Default)
53   TITLE+= dynamic DNS client
54 endef
55
56 define Package/bind-tools
57   $(call Package/bind/Default)
58   TITLE+= administration tools (all)
59 endef
60   
61 define Package/bind-rndc
62   $(call Package/bind/Default)
63   TITLE+= administration tools (rndc and rndc-confgen only)
64 endef
65
66 define Package/bind-check
67   $(call Package/bind/Default)
68   TITLE+= administration tools (named-checkconf and named-checkzone only)
69 endef
70
71 define Package/bind-dnssec
72   $(call Package/bind/Default)
73   TITLE+= administration tools (dnssec-keygen and dnssec-signzone only)
74 endef
75
76 define Package/bind-host
77   $(call Package/bind/Default)
78   TITLE+= simple DNS client
79 endef
80
81 define Package/bind-dig
82   $(call Package/bind/Default)
83   TITLE+= DNS excavation tool
84 endef
85
86 export BUILD_CC="$(TARGET_CC)"
87
88 CONFIGURE_ARGS += \
89                 --enable-shared \
90                 --enable-static \
91                 --enable-ipv6 \
92                 --with-randomdev="/dev/urandom" \
93                 --disable-threads \
94                 --with-openssl="$(STAGING_DIR)/usr" \
95                 --with-libtool \
96                 , \
97                 BUILD_CC="$(TARGET_CC)" \
98
99 define Build/Compile
100         rm -rf $(PKG_INSTALL_DIR)
101         mkdir -p $(PKG_INSTALL_DIR)
102         $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
103                 BUILD_CC="$(HOSTCC)" \
104                 CC="$(HOSTCC)" \
105                 CFLAGS="-O2" \
106                 LIBS="" \
107                 gen
108         $(MAKE) -C $(PKG_BUILD_DIR) \
109         DESTDIR="$(PKG_INSTALL_DIR)" \
110                 DESTDIR="$(PKG_INSTALL_DIR)" \
111                 all install
112 endef
113
114 define Package/bind-libs/install
115         $(INSTALL_DIR) $(1)/usr/lib
116         $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
117 endef
118
119 define Package/bind-server/install
120         $(INSTALL_DIR) $(1)/usr/sbin
121         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
122         $(INSTALL_DIR) $(1)/etc
123         $(CP) ./files/bind $(1)/etc/
124         $(INSTALL_DIR) $(1)/etc/init.d
125         $(CP) ./files/named.init $(1)/etc/init.d/named
126         find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
127 endef
128
129 define Package/bind-client/install
130         $(INSTALL_DIR) $(1)/usr/bin
131         $(CP) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
132 endef
133
134 define Package/bind-tools/install
135         $(INSTALL_DIR) $(1)/usr/bin
136         $(CP) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
137         $(CP) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
138         $(INSTALL_DIR) $(1)/usr/sbin
139         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
140         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
141         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
142         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
143         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
144         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
145 endef
146
147 define Package/bind-rndc/install
148         $(INSTALL_DIR) $(1)/usr/sbin
149         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
150         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
151 endef
152
153 define Package/bind-check/install
154         $(INSTALL_DIR) $(1)/usr/sbin
155         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
156         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
157 endef
158
159 define Package/bind-dnssec/install
160         $(INSTALL_DIR) $(1)/usr/sbin
161         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
162         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
163 endef
164
165 define Package/bind-host/install
166         $(INSTALL_DIR) $(1)/usr/bin
167         $(CP) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
168 endef
169
170 define Package/bind-dig/install
171         $(INSTALL_DIR) $(1)/usr/bin
172         $(CP) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
173 endef
174
175 $(eval $(call BuildPackage,bind-libs))
176 $(eval $(call BuildPackage,bind-server))
177 $(eval $(call BuildPackage,bind-client))
178 $(eval $(call BuildPackage,bind-tools))
179 $(eval $(call BuildPackage,bind-rndc))
180 $(eval $(call BuildPackage,bind-check))
181 $(eval $(call BuildPackage,bind-dnssec))
182 $(eval $(call BuildPackage,bind-host))
183 $(eval $(call BuildPackage,bind-dig))