Merge pull request #1755 from kissg1988/seafile-server
[feed/packages.git] / net / bind / Makefile
1 #
2 # Copyright (C) 2006-2012 OpenWrt.org
3 # 2014 Noah Meyerhans <frodo@morgul.net>
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=bind
12 PKG_VERSION:=9.9.7-P3
13 PKG_RELEASE:=1
14 USERID:=bind=57:bind=57
15
16 PKG_MAINTAINER := Noah Meyerhans <frodo@morgul.net>
17 PKG_LICENSE := BSD-3-Clause
18
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
20 PKG_SOURCE_URL:= \
21 ftp://ftp.isc.org/isc/bind9/$(PKG_VERSION) \
22 http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION)
23 PKG_MD5SUM:=022a8aca9ca51e1027d77094094eecfd
24
25 PKG_FIXUP:=autoreconf
26 PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
27
28 PKG_INSTALL:=1
29
30 PKG_CONFIG_DEPENDS := CONFIG_OPENSSL_WITH_EC
31
32 include $(INCLUDE_DIR)/package.mk
33
34 define Package/bind/Default
35 SECTION:=net
36 CATEGORY:=Network
37 DEPENDS:=+bind-libs
38 TITLE:=bind
39 URL:=https://www.isc.org/software/bind
40 SUBMENU:=IP Addresses and Names
41 endef
42
43 define Package/bind-libs
44 SECTION:=libs
45 CATEGORY:=Libraries
46 DEPENDS:=+libopenssl
47 TITLE:=bind shared libraries
48 URL:=https://www.isc.org/software/bind
49 endef
50
51 define Package/bind-server
52 $(call Package/bind/Default)
53 TITLE+= DNS server
54 endef
55
56 define Package/bind-client
57 $(call Package/bind/Default)
58 TITLE+= dynamic DNS client
59 endef
60
61 define Package/bind-tools
62 $(call Package/bind/Default)
63 TITLE+= administration tools (all)
64 endef
65
66 define Package/bind-rndc
67 $(call Package/bind/Default)
68 TITLE+= administration tools (rndc and rndc-confgen only)
69 endef
70
71 define Package/bind-check
72 $(call Package/bind/Default)
73 TITLE+= administration tools (named-checkconf and named-checkzone only)
74 endef
75
76 define Package/bind-dnssec
77 $(call Package/bind/Default)
78 TITLE+= administration tools (dnssec-keygen and dnssec-signzone only)
79 endef
80
81 define Package/bind-host
82 $(call Package/bind/Default)
83 TITLE+= simple DNS client
84 endef
85
86 define Package/bind-dig
87 $(call Package/bind/Default)
88 TITLE+= DNS excavation tool
89 endef
90
91 export BUILD_CC="$(TARGET_CC)"
92
93 CONFIGURE_ARGS += \
94 --enable-shared \
95 --enable-static \
96 --with-randomdev="/dev/urandom" \
97 --disable-threads \
98 --disable-linux-caps \
99 --with-openssl="$(STAGING_DIR)/usr" \
100 --with-libtool \
101 --with-libxml2=no \
102 --enable-epoll=yes \
103 --with-gost=no \
104 --with-gssapi=no \
105 --with-ecdsa=$(if $(CONFIG_OPENSSL_WITH_EC),yes,no) \
106 --with-readline=no
107
108 CONFIGURE_VARS += \
109 BUILD_CC="$(TARGET_CC)" \
110
111 define Build/Compile
112 $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
113 BUILD_CC="$(HOSTCC)" \
114 CC="$(HOSTCC)" \
115 CFLAGS="-O2" \
116 LIBS="" \
117 gen
118 $(call Build/Compile/Default)
119 endef
120
121 define Package/bind-libs/install
122 $(INSTALL_DIR) $(1)/usr/lib
123 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
124 endef
125
126 define Package/bind-server/install
127 $(INSTALL_DIR) $(1)/usr/sbin
128 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
129 $(INSTALL_DIR) $(1)/etc/bind
130 $(CP) \
131 ./files/bind/db.0 \
132 ./files/bind/db.127 \
133 ./files/bind/db.255 \
134 ./files/bind/db.local \
135 ./files/bind/db.root \
136 $(1)/etc/bind/
137 $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
138 $(INSTALL_DIR) $(1)/etc/init.d
139 $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
140 find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
141 endef
142
143 define Package/bind-server/conffiles
144 /etc/bind/db.0
145 /etc/bind/db.127
146 /etc/bind/db.255
147 /etc/bind/db.local
148 /etc/bind/db.root
149 /etc/bind/named.conf
150 endef
151
152 define Package/bind-client/install
153 $(INSTALL_DIR) $(1)/usr/bin
154 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
155 endef
156
157 define Package/bind-tools/install
158 $(INSTALL_DIR) $(1)/usr/bin
159 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
160 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
161 $(INSTALL_DIR) $(1)/usr/sbin
162 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
163 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
164 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
165 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
166 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
167 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
168 endef
169
170 define Package/bind-rndc/install
171 $(INSTALL_DIR) $(1)/usr/sbin
172 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
173 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
174 endef
175
176 define Package/bind-check/install
177 $(INSTALL_DIR) $(1)/usr/sbin
178 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
179 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
180 endef
181
182 define Package/bind-dnssec/install
183 $(INSTALL_DIR) $(1)/usr/sbin
184 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
185 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
186 endef
187
188 define Package/bind-host/install
189 $(INSTALL_DIR) $(1)/usr/bin
190 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
191 endef
192
193 define Package/bind-dig/install
194 $(INSTALL_DIR) $(1)/usr/bin
195 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
196 endef
197
198 $(eval $(call BuildPackage,bind-libs))
199 $(eval $(call BuildPackage,bind-server))
200 $(eval $(call BuildPackage,bind-client))
201 $(eval $(call BuildPackage,bind-tools))
202 $(eval $(call BuildPackage,bind-rndc))
203 $(eval $(call BuildPackage,bind-check))
204 $(eval $(call BuildPackage,bind-dnssec))
205 $(eval $(call BuildPackage,bind-host))
206 $(eval $(call BuildPackage,bind-dig))