Merge pull request #878 from jow-/lxc-autoconf-fix
[feed/packages.git] / net / knot / Makefile
1 #
2 # Copyright (C) 2014-2015 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:=1.6.2
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE_URL:=https://secure.nic.cz/files/knot-dns/
17 PKG_MD5SUM:=ad0a2d641556ad30d17d45200a2c45df
18
19 PKG_MAINTAINER:=Daniel Salzman <daniel.salzman@nic.cz>
20 PKG_LICENSE:=GPL-2.0+
21
22 PKG_BUILD_PARALLEL:=1
23 PKG_FIXUP:=autoreconf
24 PKG_INSTALL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/knot/Default
29 SECTION:=net
30 CATEGORY:=Network
31 TITLE:=Knot DNS
32 URL:=https://www.knot-dns.cz
33 SUBMENU:=IP Addresses and Names
34 DEPENDS:=+libopenssl +liburcu
35 endef
36
37 define Package/knot-libknot
38 $(call Package/knot/Default)
39 TITLE+= (library)
40 endef
41
42 define Package/knot
43 $(call Package/knot/Default)
44 TITLE+= (server)
45 DEPENDS+=+knot-libknot
46 endef
47
48 define Package/knot-dig
49 $(call Package/knot/Default)
50 TITLE+= lookup utility
51 DEPENDS+=+knot-libknot
52 endef
53
54 define Package/knot-host
55 $(call Package/knot/Default)
56 TITLE+= simple DNS lookup utility
57 DEPENDS+=+knot-libknot
58 endef
59
60 define Package/knot-nsec3hash
61 $(call Package/knot/Default)
62 TITLE+= simple NSEC3 hash utility
63 DEPENDS+=+knot-libknot
64 endef
65
66 define Package/knot-nsupdate
67 $(call Package/knot/Default)
68 TITLE+= dynamic DNS update utility
69 DEPENDS+=+knot-libknot
70 endef
71
72 define Package/knot-tests
73 $(call Package/knot/Default)
74 TITLE+= (tests)
75 DEPENDS+=+knot-libknot
76 endef
77
78 define Package/knot-libknot/description
79 Knot DNS library.
80 endef
81
82 define Package/knot/description
83 High-performance authoritative-only DNS server.
84 endef
85
86 define Package/knot-dig/description
87 Knot DNS lookup utility.
88 endef
89
90 define Package/knot-host/description
91 Knot DNS simple DNS lookup utility.
92 endef
93
94 define Package/knot-nsec3hash/description
95 Knot DNS simple utility to compute NSEC3 hash.
96 endef
97
98 define Package/knot-nsupdate/description
99 Knot DNS dynamic DNS update utility.
100 endef
101
102 define Package/knot-tests/description
103 Unit tests for Knot DNS server.
104 Usage: /usr/share/knot/runtests.sh
105 endef
106
107 define Package/knot/conffiles
108 /etc/knot/knot.conf
109 endef
110
111 CONFIGURE_ARGS += \
112 --enable-recvmmsg=no \
113 --disable-fastparser \
114 --without-libidn \
115 --with-rundir=/var/run \
116 --with-storage=/etc/knot
117
118 TARGET_CFLAGS += -std=gnu99 -DPSELECT_COMPAT
119
120 define Build/Compile
121 $(MAKE) -C $(PKG_BUILD_DIR)
122 $(MAKE) -C $(PKG_BUILD_DIR)/libtap check
123 $(MAKE) -C $(PKG_BUILD_DIR)/tests check-compile-only
124 $(MAKE) -C $(PKG_BUILD_DIR)/src/zscanner check-compile-only
125 endef
126
127 define Package/knot-libknot/install
128 $(INSTALL_DIR) $(1)/usr/lib
129 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libknot.so.* $(1)/usr/lib/
130 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzscanner.so.* $(1)/usr/lib/
131 endef
132
133 define Package/knot/install
134 $(INSTALL_DIR) $(1)/usr/sbin
135 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotc $(1)/usr/sbin/
136 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotd $(1)/usr/sbin/
137
138 $(INSTALL_DIR) $(1)/etc/knot
139 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knot/knot.sample.conf $(1)/etc/knot/knot.conf
140 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/knot/example.com.zone $(1)/etc/knot/
141
142 $(INSTALL_DIR) $(1)/etc/init.d
143 $(INSTALL_BIN) ./files/knotd.init $(1)/etc/init.d/knotd
144 endef
145
146 define Package/knot-dig/install
147 $(INSTALL_DIR) $(1)/usr/bin
148 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdig $(1)/usr/bin/
149 endef
150
151 define Package/knot-host/install
152 $(INSTALL_DIR) $(1)/usr/bin
153 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/khost $(1)/usr/bin/
154 endef
155
156 define Package/knot-nsec3hash/install
157 $(INSTALL_DIR) $(1)/usr/bin
158 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsec3hash $(1)/usr/bin/
159 endef
160
161 define Package/knot-nsupdate/install
162 $(INSTALL_DIR) $(1)/usr/bin
163 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate $(1)/usr/bin/
164 endef
165
166 define Package/knot-tests/install
167 $(INSTALL_DIR) $(1)/usr/share/knot
168 $(INSTALL_BIN) ./files/runtests.sh $(1)/usr/share/knot/
169
170 $(INSTALL_DIR) $(1)/usr/share/knot/tap
171 $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/runtests $(1)/usr/share/knot/tap/
172 $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/tap/libtap.sh $(1)/usr/share/knot/tap/
173
174 $(INSTALL_DIR) $(1)/usr/share/knot/tests
175 find $(PKG_BUILD_DIR)/tests/.libs -maxdepth 1 -executable -type f | \
176 xargs -I{} basename {} | \
177 xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/.libs/{} $(1)/usr/share/knot/tests/test_{}
178
179 $(INSTALL_DIR) $(1)/usr/share/knot/tests/data
180 $(INSTALL_DATA) $(PKG_BUILD_DIR)/tests/data/sample_conf $(1)/usr/share/knot/tests/data/
181
182 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/.libs/zscanner-tool $(1)/usr/share/knot/tests/
183 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/unittests $(1)/usr/share/knot/tests/test_zscanner
184 $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/zscanner/tests/TESTS $(1)/usr/share/knot/tests/
185 cp -a $(PKG_BUILD_DIR)/src/zscanner/tests/data $(1)/usr/share/knot/tests/
186 endef
187
188 $(eval $(call BuildPackage,knot-libknot))
189 $(eval $(call BuildPackage,knot))
190 $(eval $(call BuildPackage,knot-dig))
191 $(eval $(call BuildPackage,knot-host))
192 $(eval $(call BuildPackage,knot-nsec3hash))
193 $(eval $(call BuildPackage,knot-nsupdate))
194 $(eval $(call BuildPackage,knot-tests))