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