Merge pull request #4079 from antonlacon/sqlite3-3.17.x
[feed/packages.git] / net / knot / Makefile
1 #
2 # Copyright (C) 2014-2017 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
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:=knot
11 PKG_VERSION:=2.3.3
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=https://secure.nic.cz/files/knot-dns/
16 PKG_HASH:=a929bce3b957a81776b1db7b43b0e4473339bf16be8dbba5abb4b0593bf43c94
17
18 PKG_MAINTAINER:=Daniel Salzman <daniel.salzman@nic.cz>
19 PKG_LICENSE:=GPL-3.0 LGPL-2.0 0BSD MIT OLDAP-2.8
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22 PKG_FIXUP:=autoreconf
23 PKG_INSTALL:=1
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/knot-lib/Default
28 SECTION:=libs
29 CATEGORY:=Libraries
30 TITLE:=Knot DNS
31 URL:=https://www.knot-dns.cz
32 endef
33
34 define Package/knot/Default
35 SECTION:=net
36 CATEGORY:=Network
37 SUBMENU:=IP Addresses and Names
38 TITLE:=Knot DNS
39 URL:=https://www.knot-dns.cz
40 USERID:=knot=5353:knot=5353
41 endef
42
43 define Package/knot-libdnssec
44 $(call Package/knot-lib/Default)
45 TITLE+= DNSSEC library
46 DEPENDS=+libpthread +libgnutls +jansson
47 endef
48
49 define Package/knot-libknot
50 $(call Package/knot-lib/Default)
51 TITLE+= library
52 DEPENDS=+libpthread +knot-libdnssec
53 endef
54
55 define Package/knot-libzscanner
56 $(call Package/knot-lib/Default)
57 TITLE+= zone parser library
58 DEPENDS=+libpthread
59 endef
60
61 define Package/knot
62 $(call Package/knot/Default)
63 TITLE+= server
64 DEPENDS=+liburcu +libedit +knot-libdnssec +knot-libknot +knot-libzscanner
65 endef
66
67 define Package/knot-dig
68 $(call Package/knot/Default)
69 TITLE+= advanced DNS lookup utility
70 DEPENDS=+knot-libdnssec +knot-libknot
71 endef
72
73 define Package/knot-host
74 $(call Package/knot/Default)
75 TITLE+= simple DNS lookup utility
76 DEPENDS=+knot-libdnssec +knot-libknot
77 endef
78
79 define Package/knot-nsupdate
80 $(call Package/knot/Default)
81 TITLE+= dynamic DNS update utility
82 DEPENDS=+knot-libdnssec +knot-libknot +knot-libzscanner
83 endef
84
85 define Package/knot-nsec3hash
86 $(call Package/knot/Default)
87 TITLE+= simple NSEC3 hash utility
88 DEPENDS=+knot-libdnssec
89 endef
90
91 define Package/knot-zonecheck
92 $(call Package/knot/Default)
93 TITLE+= zonefile check utility
94 DEPENDS=+liburcu +knot-libdnssec +knot-libknot +knot-libzscanner
95 endef
96
97 define Package/knot-keymgr
98 $(call Package/knot/Default)
99 TITLE+= DNSSEC key management utility
100 DEPENDS=+liburcu +knot-libdnssec +knot-libknot +knot-libzscanner
101 endef
102
103 define Package/knot-tests
104 $(call Package/knot/Default)
105 TITLE+= tests
106 DEPENDS=+liburcu +libedit +knot-libdnssec +knot-libknot +knot-libzscanner
107 endef
108
109 define Package/knot-libdnssec/description
110 Knot DNS DNSSEC library.
111 endef
112
113 define Package/knot-libknot/description
114 Knot DNS library.
115 endef
116
117 define Package/knot-libdnssec/description
118 Knot DNS zone parser library.
119 endef
120
121 define Package/knot/description
122 High-performance authoritative-only DNS server.
123 endef
124
125 define Package/knot-dig/description
126 Knot DNS advanced DNS lookup utility.
127 endef
128
129 define Package/knot-host/description
130 Knot DNS simple DNS lookup utility.
131 endef
132
133 define Package/knot-nsupdate/description
134 Knot DNS dynamic DNS update utility.
135 endef
136
137 define Package/knot-nsec3hash/description
138 Knot DNS simple NSEC3 hash utility.
139 endef
140
141 define Package/knot-zonecheck/description
142 Knot DNS zonefile check utility.
143 endef
144
145 define Package/knot-keymgr/description
146 Knot DNS DNSSEC key management utility.
147 endef
148
149 define Package/knot-tests/description
150 Unit tests for the Knot DNS server and libraries.
151 Usage: /usr/share/knot/runtests.sh
152 endef
153
154 CONFIGURE_ARGS += \
155 --enable-recvmmsg=no \
156 --disable-fastparser \
157 --without-libidn \
158 --with-rundir=/var/run/knot \
159 --with-storage=/var/lib/knot \
160 --with-configdir=/etc/knot \
161 --with-timer-mapsize=50 \
162 --with-conf-mapsize=50
163
164 TARGET_CFLAGS += -DPSELECT_COMPAT -DNDEBUG
165
166 define Package/knot/conffiles
167 /etc/knot/knot.conf
168 endef
169
170 define Build/Compile
171 $(MAKE) -C $(PKG_BUILD_DIR)
172 $(MAKE) -C $(PKG_BUILD_DIR)/libtap check
173 $(MAKE) -C $(PKG_BUILD_DIR)/src/dnssec/tests check-compile
174 $(MAKE) -C $(PKG_BUILD_DIR)/tests check-compile
175 $(MAKE) -C $(PKG_BUILD_DIR)/src/zscanner check-compile
176 endef
177
178 define Build/InstallDev
179 $(INSTALL_DIR) $(1)/usr/lib
180 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} $(1)/usr/lib/
181
182 $(INSTALL_DIR) $(1)/usr/include/libknot
183 $(CP) $(PKG_INSTALL_DIR)/usr/include/libknot/* $(1)/usr/include/libknot/
184
185 $(INSTALL_DIR) $(1)/usr/include/dnssec
186 $(CP) $(PKG_INSTALL_DIR)/usr/include/dnssec/* $(1)/usr/include/dnssec/
187
188 $(INSTALL_DIR) $(1)/usr/include/zscanner
189 $(CP) $(PKG_INSTALL_DIR)/usr/include/zscanner/* $(1)/usr/include/zscanner/
190
191 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
192 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
193 endef
194
195 define Package/knot-libdnssec/install
196 $(INSTALL_DIR) $(1)/usr/lib
197 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnssec.so.* $(1)/usr/lib/
198 endef
199
200 define Package/knot-libknot/install
201 $(INSTALL_DIR) $(1)/usr/lib
202 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libknot.so.* $(1)/usr/lib/
203 endef
204
205 define Package/knot-libzscanner/install
206 $(INSTALL_DIR) $(1)/usr/lib
207 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzscanner.so.* $(1)/usr/lib/
208 endef
209
210 define Package/knot/install
211 $(INSTALL_DIR) $(1)/usr/bin
212 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotc $(1)/usr/bin/
213 $(INSTALL_DIR) $(1)/usr/sbin
214 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotd $(1)/usr/sbin/
215
216 $(INSTALL_DIR) $(1)/etc/knot
217 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knot/knot.sample.conf $(1)/etc/knot/knot.conf
218
219 $(INSTALL_DIR) $(1)/etc/init.d
220 $(INSTALL_BIN) ./files/knotd.init $(1)/etc/init.d/knotd
221 endef
222
223 define Package/knot-dig/install
224 $(INSTALL_DIR) $(1)/usr/bin
225 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdig $(1)/usr/bin/
226 endef
227
228 define Package/knot-host/install
229 $(INSTALL_DIR) $(1)/usr/bin
230 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/khost $(1)/usr/bin/
231 endef
232
233 define Package/knot-nsupdate/install
234 $(INSTALL_DIR) $(1)/usr/bin
235 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate $(1)/usr/bin/
236 endef
237
238 define Package/knot-nsec3hash/install
239 $(INSTALL_DIR) $(1)/usr/bin
240 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsec3hash $(1)/usr/bin/
241 endef
242
243 define Package/knot-zonecheck/install
244 $(INSTALL_DIR) $(1)/usr/bin
245 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kzonecheck $(1)/usr/bin/
246 endef
247
248 define Package/knot-keymgr/install
249 $(INSTALL_DIR) $(1)/usr/bin
250 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keymgr $(1)/usr/bin/
251 endef
252
253 define Package/knot-tests/install
254 $(INSTALL_DIR) $(1)/usr/share/knot
255 $(INSTALL_BIN) ./files/runtests.sh $(1)/usr/share/knot/
256
257 $(INSTALL_DIR) $(1)/usr/share/knot/tap
258 $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/runtests $(1)/usr/share/knot/tap/
259 $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/tap/libtap.sh $(1)/usr/share/knot/tap/
260
261 $(INSTALL_DIR) $(1)/usr/share/knot/tests
262 find $(PKG_BUILD_DIR)/tests/.libs -maxdepth 1 -executable -type f | \
263 xargs -I{} basename {} | \
264 xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/.libs/{} $(1)/usr/share/knot/tests/test_{}
265
266 $(INSTALL_DIR) $(1)/usr/share/knot/tests/dnssec
267 find $(PKG_BUILD_DIR)/src/dnssec/tests -maxdepth 1 -executable -type f | \
268 xargs -I{} basename {} | \
269 xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/src/dnssec/tests/{} $(1)/usr/share/knot/tests/dnssec/test_{}
270
271 $(INSTALL_DIR) $(1)/usr/share/knot/tests/contrib
272 find $(PKG_BUILD_DIR)/tests/contrib/.libs -maxdepth 1 -executable -type f | \
273 xargs -I{} basename {} | \
274 xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/contrib/.libs/{} $(1)/usr/share/knot/tests/contrib/{}
275
276 $(INSTALL_DIR) $(1)/usr/share/knot/tests/libknot
277 find $(PKG_BUILD_DIR)/tests/libknot/.libs -maxdepth 1 -executable -type f | \
278 xargs -I{} basename {} | \
279 xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/libknot/.libs/{} $(1)/usr/share/knot/tests/libknot/{}
280
281 $(INSTALL_DIR) $(1)/usr/share/knot/tests/modules
282 find $(PKG_BUILD_DIR)/tests/modules/.libs -maxdepth 1 -executable -type f | \
283 xargs -I{} basename {} | \
284 xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/modules/.libs/{} $(1)/usr/share/knot/tests/modules/test_{}
285
286 $(INSTALL_DIR) $(1)/usr/share/knot/tests/utils
287 find $(PKG_BUILD_DIR)/tests/utils/.libs -maxdepth 1 -executable -type f | \
288 xargs -I{} basename {} | \
289 xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/utils/.libs/{} $(1)/usr/share/knot/tests/utils/{}
290
291 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/.libs/zscanner-tool $(1)/usr/share/knot/tests/
292 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/unittests $(1)/usr/share/knot/tests/test_zscanner
293 $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/zscanner/tests/TESTS $(1)/usr/share/knot/tests/
294 cp -a $(PKG_BUILD_DIR)/src/zscanner/tests/data $(1)/usr/share/knot/tests/
295 endef
296
297 $(eval $(call BuildPackage,knot-libdnssec))
298 $(eval $(call BuildPackage,knot-libknot))
299 $(eval $(call BuildPackage,knot-libzscanner))
300 $(eval $(call BuildPackage,knot))
301 $(eval $(call BuildPackage,knot-dig))
302 $(eval $(call BuildPackage,knot-host))
303 $(eval $(call BuildPackage,knot-nsupdate))
304 $(eval $(call BuildPackage,knot-nsec3hash))
305 $(eval $(call BuildPackage,knot-zonecheck))
306 $(eval $(call BuildPackage,knot-keymgr))
307 $(eval $(call BuildPackage,knot-tests))