Merge pull request #2865 from miska/lxc-luci-features
[feed/packages.git] / net / knot / Makefile
1 #
2 # Copyright (C) 2014-2016 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.2.1
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_MD5SUM:=d573ecadedf4f15ec1f02671443520cb
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-keymgr
92 $(call Package/knot/Default)
93 TITLE+= DNSSEC key management utility
94 DEPENDS=+knot-libdnssec +knot-libzscanner
95 endef
96
97 define Package/knot-tests
98 $(call Package/knot/Default)
99 TITLE+= tests
100 DEPENDS=+liburcu +knot-libdnssec +knot-libknot +knot-libzscanner
101 endef
102
103 define Package/knot-libdnssec/description
104 Knot DNS DNSSEC library.
105 endef
106
107 define Package/knot-libknot/description
108 Knot DNS library.
109 endef
110
111 define Package/knot-libdnssec/description
112 Knot DNS zone parser library.
113 endef
114
115 define Package/knot/description
116 High-performance authoritative-only DNS server.
117 endef
118
119 define Package/knot-dig/description
120 Knot DNS advanced DNS lookup utility.
121 endef
122
123 define Package/knot-host/description
124 Knot DNS simple DNS lookup utility.
125 endef
126
127 define Package/knot-nsupdate/description
128 Knot DNS dynamic DNS update utility.
129 endef
130
131 define Package/knot-nsec3hash/description
132 Knot DNS simple NSEC3 hash utility.
133 endef
134
135 define Package/knot-keymgr/description
136 Knot DNS DNSSEC key management utility.
137 endef
138
139 define Package/knot-tests/description
140 Unit tests for the Knot DNS server and libraries.
141 Usage: /usr/share/knot/runtests.sh
142 endef
143
144 CONFIGURE_ARGS += \
145 --enable-recvmmsg=no \
146 --disable-fastparser \
147 --without-libidn \
148 --with-rundir=/var/run/knot \
149 --with-storage=/var/lib/knot \
150 --with-configdir=/etc/knot \
151 --with-timer-mapsize=50 \
152 --with-conf-mapsize=50
153
154 TARGET_CFLAGS += -DPSELECT_COMPAT -DNDEBUG
155
156 define Package/knot/conffiles
157 /etc/knot/knot.conf
158 endef
159
160 define Build/Compile
161 $(MAKE) -C $(PKG_BUILD_DIR)
162 $(MAKE) -C $(PKG_BUILD_DIR)/libtap check
163 $(MAKE) -C $(PKG_BUILD_DIR)/src/dnssec/tests check-compile
164 $(MAKE) -C $(PKG_BUILD_DIR)/tests check-compile
165 $(MAKE) -C $(PKG_BUILD_DIR)/src/zscanner check-compile
166 endef
167
168 define Build/InstallDev
169 $(INSTALL_DIR) $(1)/usr/lib
170 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} $(1)/usr/lib/
171
172 $(INSTALL_DIR) $(1)/usr/include/libknot
173 $(CP) $(PKG_INSTALL_DIR)/usr/include/libknot/* $(1)/usr/include/libknot/
174
175 $(INSTALL_DIR) $(1)/usr/include/dnssec
176 $(CP) $(PKG_INSTALL_DIR)/usr/include/dnssec/* $(1)/usr/include/dnssec/
177
178 $(INSTALL_DIR) $(1)/usr/include/zscanner
179 $(CP) $(PKG_INSTALL_DIR)/usr/include/zscanner/* $(1)/usr/include/zscanner/
180
181 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
182 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
183 endef
184
185 define Package/knot-libdnssec/install
186 $(INSTALL_DIR) $(1)/usr/lib
187 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnssec.so.* $(1)/usr/lib/
188 endef
189
190 define Package/knot-libknot/install
191 $(INSTALL_DIR) $(1)/usr/lib
192 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libknot.so.* $(1)/usr/lib/
193 endef
194
195 define Package/knot-libzscanner/install
196 $(INSTALL_DIR) $(1)/usr/lib
197 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzscanner.so.* $(1)/usr/lib/
198 endef
199
200 define Package/knot/install
201 $(INSTALL_DIR) $(1)/usr/sbin
202 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotc $(1)/usr/sbin/
203 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotd $(1)/usr/sbin/
204
205 $(INSTALL_DIR) $(1)/etc/knot
206 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knot/knot.sample.conf $(1)/etc/knot/knot.conf
207
208 $(INSTALL_DIR) $(1)/etc/init.d
209 $(INSTALL_BIN) ./files/knotd.init $(1)/etc/init.d/knotd
210 endef
211
212 define Package/knot-dig/install
213 $(INSTALL_DIR) $(1)/usr/bin
214 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdig $(1)/usr/bin/
215 endef
216
217 define Package/knot-host/install
218 $(INSTALL_DIR) $(1)/usr/bin
219 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/khost $(1)/usr/bin/
220 endef
221
222 define Package/knot-nsupdate/install
223 $(INSTALL_DIR) $(1)/usr/bin
224 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate $(1)/usr/bin/
225 endef
226
227 define Package/knot-nsec3hash/install
228 $(INSTALL_DIR) $(1)/usr/bin
229 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsec3hash $(1)/usr/bin/
230 endef
231
232 define Package/knot-keymgr/install
233 $(INSTALL_DIR) $(1)/usr/sbin
234 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keymgr $(1)/usr/sbin/
235 endef
236
237 define Package/knot-tests/install
238 $(INSTALL_DIR) $(1)/usr/share/knot
239 $(INSTALL_BIN) ./files/runtests.sh $(1)/usr/share/knot/
240
241 $(INSTALL_DIR) $(1)/usr/share/knot/tap
242 $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/runtests $(1)/usr/share/knot/tap/
243 $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/tap/libtap.sh $(1)/usr/share/knot/tap/
244
245 $(INSTALL_DIR) $(1)/usr/share/knot/tests
246
247 find $(PKG_BUILD_DIR)/src/dnssec/tests -maxdepth 1 -executable -type f | \
248 xargs -I{} basename {} | \
249 xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/src/dnssec/tests/{} $(1)/usr/share/knot/tests/dnssec_test_{}
250
251 find $(PKG_BUILD_DIR)/tests/.libs -maxdepth 1 -executable -type f | \
252 xargs -I{} basename {} | \
253 xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/.libs/{} $(1)/usr/share/knot/tests/test_{}
254
255 find $(PKG_BUILD_DIR)/tests/modules/.libs -maxdepth 1 -executable -type f | \
256 xargs -I{} basename {} | \
257 xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/modules/.libs/{} $(1)/usr/share/knot/tests/test_module_{}
258
259 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/.libs/zscanner-tool $(1)/usr/share/knot/tests/
260 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/unittests $(1)/usr/share/knot/tests/test_zscanner
261 $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/zscanner/tests/TESTS $(1)/usr/share/knot/tests/
262 cp -a $(PKG_BUILD_DIR)/src/zscanner/tests/data $(1)/usr/share/knot/tests/
263 endef
264
265 $(eval $(call BuildPackage,knot-libdnssec))
266 $(eval $(call BuildPackage,knot-libknot))
267 $(eval $(call BuildPackage,knot-libzscanner))
268 $(eval $(call BuildPackage,knot))
269 $(eval $(call BuildPackage,knot-dig))
270 $(eval $(call BuildPackage,knot-host))
271 $(eval $(call BuildPackage,knot-nsupdate))
272 $(eval $(call BuildPackage,knot-nsec3hash))
273 $(eval $(call BuildPackage,knot-keymgr))
274 $(eval $(call BuildPackage,knot-tests))