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