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