You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

272 lines
7.8 KiB

  1. #
  2. # Copyright (C) 2014-2019 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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=knot
  9. PKG_VERSION:=3.0.6
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=https://secure.nic.cz/files/knot-dns/
  13. PKG_HASH:=63756ac5a00c3e4a066ed231a287faef5963a9183d77326e30bf0644cdf74f86
  14. PKG_MAINTAINER:=Daniel Salzman <daniel.salzman@nic.cz>
  15. PKG_LICENSE:=GPL-3.0 LGPL-2.0 0BSD BSD-3-Clause OLDAP-2.8
  16. PKG_CPE_ID:=cpe:/a:knot-dns:knot_dns
  17. PKG_FIXUP:=autoreconf
  18. PKG_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/knot-lib/Default
  21. SECTION:=libs
  22. CATEGORY:=Libraries
  23. TITLE:=Knot DNS
  24. DEPENDS=+libpthread
  25. URL:=https://www.knot-dns.cz
  26. endef
  27. define Package/knot/Default
  28. SECTION:=net
  29. CATEGORY:=Network
  30. SUBMENU:=IP Addresses and Names
  31. TITLE:=Knot DNS
  32. DEPENDS=+libatomic
  33. URL:=https://www.knot-dns.cz
  34. endef
  35. define Package/knot-libs
  36. $(call Package/knot-lib/Default)
  37. TITLE+= common DNS and DNSSEC libraries
  38. DEPENDS+=+libgnutls +lmdb @!arc
  39. endef
  40. define Package/knot-libzscanner
  41. $(call Package/knot-lib/Default)
  42. TITLE+= zone parser library
  43. DEPENDS+=@!arc
  44. endef
  45. define Package/knot
  46. $(call Package/knot/Default)
  47. TITLE+= server with control utility
  48. DEPENDS+=+libedit +liburcu +knot-libs +knot-libzscanner
  49. EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE)), \
  50. knot-libzscanner (=$(PKG_VERSION)-$(PKG_RELEASE))
  51. USERID:=knot=5353:knot=5353
  52. endef
  53. define Package/knot-dig
  54. $(call Package/knot/Default)
  55. TITLE+= advanced DNS lookup utility
  56. DEPENDS+=+libedit +knot-libs
  57. EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE))
  58. endef
  59. define Package/knot-host
  60. $(call Package/knot/Default)
  61. TITLE+= simple DNS lookup utility
  62. DEPENDS+=+libedit +knot-libs
  63. EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE))
  64. endef
  65. define Package/knot-nsupdate
  66. $(call Package/knot/Default)
  67. TITLE+= dynamic DNS update utility
  68. DEPENDS+=+libedit +knot-libs +knot-libzscanner
  69. EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE)), \
  70. knot-libzscanner (=$(PKG_VERSION)-$(PKG_RELEASE))
  71. endef
  72. define Package/knot-zonecheck
  73. $(call Package/knot/Default)
  74. TITLE+= zonefile check utility
  75. DEPENDS+=+libedit +liburcu +knot-libs +knot-libzscanner
  76. EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE)), \
  77. knot-libzscanner (=$(PKG_VERSION)-$(PKG_RELEASE))
  78. endef
  79. define Package/knot-keymgr
  80. $(call Package/knot/Default)
  81. TITLE+= DNSSEC key management utility
  82. DEPENDS+=+libedit +liburcu +knot-libs +knot-libzscanner
  83. EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE)), \
  84. knot-libzscanner (=$(PKG_VERSION)-$(PKG_RELEASE))
  85. endef
  86. define Package/knot-tests
  87. $(call Package/knot/Default)
  88. TITLE+= tests
  89. DEPENDS+=+libedit +liburcu +knot-libs +knot-libzscanner
  90. EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE)), \
  91. knot-libzscanner (=$(PKG_VERSION)-$(PKG_RELEASE))
  92. endef
  93. define Package/knot-libs/description
  94. Knot DNS common DNS and DNSSEC libraries.
  95. endef
  96. define Package/knot-libzscanner/description
  97. Knot DNS zone parser library.
  98. endef
  99. define Package/knot/description
  100. High-performance authoritative-only DNS server.
  101. endef
  102. define Package/knot-dig/description
  103. Knot DNS advanced DNS lookup utility.
  104. endef
  105. define Package/knot-host/description
  106. Knot DNS simple DNS lookup utility.
  107. endef
  108. define Package/knot-nsupdate/description
  109. Knot DNS dynamic DNS update utility.
  110. endef
  111. define Package/knot-zonecheck/description
  112. Knot DNS zonefile check utility.
  113. endef
  114. define Package/knot-keymgr/description
  115. Knot DNS DNSSEC key management utility.
  116. endef
  117. define Package/knot-tests/description
  118. Unit tests for the Knot DNS server and libraries.
  119. Usage: /usr/share/knot/runtests.sh
  120. endef
  121. export KNOT_VERSION_FORMAT=release
  122. CONFIGURE_ARGS += \
  123. --enable-recvmmsg=no \
  124. --enable-cap-ng=no \
  125. --enable-xdp=no \
  126. --disable-fastparser \
  127. --without-libidn \
  128. --with-libnghttp2=no \
  129. --with-rundir=/var/run/knot \
  130. --with-storage=/var/lib/knot \
  131. --with-configdir=/etc/knot \
  132. --with-conf-mapsize=20
  133. TARGET_CFLAGS += -DNDEBUG
  134. define Package/knot/conffiles
  135. /etc/knot/knot.conf
  136. endef
  137. define Build/Compile
  138. $(MAKE) -C $(PKG_BUILD_DIR)
  139. $(MAKE) -C $(PKG_BUILD_DIR)/tests check-compile
  140. endef
  141. ifneq ($(CONFIG_arc),y)
  142. define Build/InstallDev
  143. $(INSTALL_DIR) $(1)/usr/lib
  144. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} $(1)/usr/lib/
  145. $(INSTALL_DIR) $(1)/usr/include/libknot
  146. $(CP) $(PKG_INSTALL_DIR)/usr/include/libknot/* $(1)/usr/include/libknot/
  147. $(INSTALL_DIR) $(1)/usr/include/libdnssec
  148. $(CP) $(PKG_INSTALL_DIR)/usr/include/libdnssec/* $(1)/usr/include/libdnssec/
  149. $(INSTALL_DIR) $(1)/usr/include/libzscanner
  150. $(CP) $(PKG_INSTALL_DIR)/usr/include/libzscanner/* $(1)/usr/include/libzscanner/
  151. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  152. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
  153. endef
  154. endif
  155. define Package/knot-libs/install
  156. $(INSTALL_DIR) $(1)/usr/lib
  157. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnssec.so.* $(1)/usr/lib/
  158. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libknot.so.* $(1)/usr/lib/
  159. endef
  160. define Package/knot-libzscanner/install
  161. $(INSTALL_DIR) $(1)/usr/lib
  162. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzscanner.so.* $(1)/usr/lib/
  163. endef
  164. define Package/knot/install
  165. $(INSTALL_DIR) $(1)/usr/bin
  166. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotc $(1)/usr/bin/
  167. $(INSTALL_DIR) $(1)/usr/sbin
  168. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotd $(1)/usr/sbin/
  169. $(INSTALL_DIR) $(1)/etc/knot
  170. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knot/knot.sample.conf $(1)/etc/knot/knot.conf
  171. $(INSTALL_DIR) $(1)/etc/init.d
  172. $(INSTALL_BIN) ./files/knotd.init $(1)/etc/init.d/knotd
  173. endef
  174. define Package/knot-dig/install
  175. $(INSTALL_DIR) $(1)/usr/bin
  176. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdig $(1)/usr/bin/
  177. endef
  178. define Package/knot-host/install
  179. $(INSTALL_DIR) $(1)/usr/bin
  180. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/khost $(1)/usr/bin/
  181. endef
  182. define Package/knot-nsupdate/install
  183. $(INSTALL_DIR) $(1)/usr/bin
  184. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate $(1)/usr/bin/
  185. endef
  186. define Package/knot-zonecheck/install
  187. $(INSTALL_DIR) $(1)/usr/bin
  188. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kzonecheck $(1)/usr/bin/
  189. endef
  190. define Package/knot-keymgr/install
  191. $(INSTALL_DIR) $(1)/usr/bin
  192. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keymgr $(1)/usr/bin/
  193. endef
  194. define Package/knot-tests/install
  195. $(INSTALL_DIR) $(1)/usr/share/knot
  196. $(INSTALL_BIN) ./files/runtests.sh $(1)/usr/share/knot/
  197. $(INSTALL_DIR) $(1)/usr/share/knot/tap
  198. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tests/tap/.libs/runtests $(1)/usr/share/knot/tap/
  199. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tests/tap/libtap.sh $(1)/usr/share/knot/tap/
  200. $(INSTALL_DIR) $(1)/usr/share/knot/tests
  201. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tests/libzscanner/.libs/zscanner-tool $(1)/usr/share/knot/tests/
  202. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tests/libzscanner/test_zscanner $(1)/usr/share/knot/tests/
  203. $(INSTALL_DATA) $(PKG_BUILD_DIR)/tests/libzscanner/TESTS $(1)/usr/share/knot/tests/
  204. cp -a $(PKG_BUILD_DIR)/tests/libzscanner/data $(1)/usr/share/knot/tests/
  205. for module in contrib knot libdnssec libknot modules utils; do \
  206. find $(PKG_BUILD_DIR)/tests/$$$${module}/.libs -maxdepth 1 -executable -type f | \
  207. xargs -I{} basename {} | \
  208. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/$$$${module}/.libs/{} \
  209. $(1)/usr/share/knot/tests/$$$${module}_{}; \
  210. done
  211. endef
  212. $(eval $(call BuildPackage,knot-libs))
  213. $(eval $(call BuildPackage,knot-libzscanner))
  214. $(eval $(call BuildPackage,knot))
  215. $(eval $(call BuildPackage,knot-dig))
  216. $(eval $(call BuildPackage,knot-host))
  217. $(eval $(call BuildPackage,knot-nsupdate))
  218. $(eval $(call BuildPackage,knot-zonecheck))
  219. $(eval $(call BuildPackage,knot-keymgr))
  220. $(eval $(call BuildPackage,knot-tests))