[packages] bind: move dependency to the right place (#11660)
[packages.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:=autoreconf
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
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   DEPENDS:=+libopenssl
38   TITLE:=bind shared libraries
39   URL:=https://www.isc.org/software/bind
40 endef
41
42 define Package/bind-server
43   $(call Package/bind/Default)
44   TITLE+= DNS server
45 endef
46
47 define Package/bind-client
48   $(call Package/bind/Default)
49   TITLE+= dynamic DNS client
50 endef
51
52 define Package/bind-tools
53   $(call Package/bind/Default)
54   TITLE+= administration tools (all)
55 endef
56
57 define Package/bind-rndc
58   $(call Package/bind/Default)
59   TITLE+= administration tools (rndc and rndc-confgen only)
60 endef
61
62 define Package/bind-check
63   $(call Package/bind/Default)
64   TITLE+= administration tools (named-checkconf and named-checkzone only)
65 endef
66
67 define Package/bind-dnssec
68   $(call Package/bind/Default)
69   TITLE+= administration tools (dnssec-keygen and dnssec-signzone only)
70 endef
71
72 define Package/bind-host
73   $(call Package/bind/Default)
74   TITLE+= simple DNS client
75 endef
76
77 define Package/bind-dig
78   $(call Package/bind/Default)
79   TITLE+= DNS excavation tool
80 endef
81
82 export BUILD_CC="$(TARGET_CC)"
83
84 CONFIGURE_ARGS += \
85         --enable-shared \
86         --enable-static \
87         --with-randomdev="/dev/urandom" \
88         --disable-threads \
89         --with-openssl="$(STAGING_DIR)/usr" \
90         --with-libtool \
91         --with-libxml2=no \
92         --enable-epoll=yes \
93         --with-gost=no \
94         --with-gssapi=no \
95         --with-readline=no
96
97 CONFIGURE_VARS += \
98         BUILD_CC="$(TARGET_CC)" \
99
100 define Build/Compile
101         $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
102                 BUILD_CC="$(HOSTCC)" \
103                 CC="$(HOSTCC)" \
104                 CFLAGS="-O2" \
105                 LIBS="" \
106                 gen
107         $(call Build/Compile/Default)
108 endef
109
110 define Package/bind-libs/install
111         $(INSTALL_DIR) $(1)/usr/lib
112         $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
113 endef
114
115 define Package/bind-server/install
116         $(INSTALL_DIR) $(1)/usr/sbin
117         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
118         $(INSTALL_DIR) $(1)/etc/bind
119         $(CP) \
120                 ./files/bind/db.0 \
121                 ./files/bind/db.127 \
122                 ./files/bind/db.255 \
123                 ./files/bind/db.local \
124                 ./files/bind/db.root \
125                 $(1)/etc/bind/
126         $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
127         $(INSTALL_DIR) $(1)/etc/init.d
128         $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
129         find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
130 endef
131
132 define Package/bind-server/conffiles
133 /etc/bind/db.0
134 /etc/bind/db.127
135 /etc/bind/db.255
136 /etc/bind/db.local
137 /etc/bind/db.root
138 /etc/bind/named.conf
139 endef
140
141 define Package/bind-client/install
142         $(INSTALL_DIR) $(1)/usr/bin
143         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
144 endef
145
146 define Package/bind-tools/install
147         $(INSTALL_DIR) $(1)/usr/bin
148         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
149         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
150         $(INSTALL_DIR) $(1)/usr/sbin
151         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
152         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
153         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
154         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
155         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
156         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
157 endef
158
159 define Package/bind-rndc/install
160         $(INSTALL_DIR) $(1)/usr/sbin
161         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
162         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
163 endef
164
165 define Package/bind-check/install
166         $(INSTALL_DIR) $(1)/usr/sbin
167         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
168         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
169 endef
170
171 define Package/bind-dnssec/install
172         $(INSTALL_DIR) $(1)/usr/sbin
173         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
174         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
175 endef
176
177 define Package/bind-host/install
178         $(INSTALL_DIR) $(1)/usr/bin
179         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
180 endef
181
182 define Package/bind-dig/install
183         $(INSTALL_DIR) $(1)/usr/bin
184         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
185 endef
186
187 $(eval $(call BuildPackage,bind-libs))
188 $(eval $(call BuildPackage,bind-server))
189 $(eval $(call BuildPackage,bind-client))
190 $(eval $(call BuildPackage,bind-tools))
191 $(eval $(call BuildPackage,bind-rndc))
192 $(eval $(call BuildPackage,bind-check))
193 $(eval $(call BuildPackage,bind-dnssec))
194 $(eval $(call BuildPackage,bind-host))
195 $(eval $(call BuildPackage,bind-dig))