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.

150 lines
4.3 KiB

  1. #
  2. # Copyright (C) 2014 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:=1.5.3
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  13. PKG_SOURCE_URL:=https://secure.nic.cz/files/knot-dns/
  14. PKG_MD5SUM:=bab73ec83ad7f1d64bb765bf0c72caae
  15. PKG_MAINTAINER:=Daniel Salzman <daniel.salzman@nic.cz>
  16. PKG_LICENSE:=GPL-2.0+
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_FIXUP:=autoreconf
  20. PKG_INSTALL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/knot/Default
  23. SECTION:=net
  24. CATEGORY:=Network
  25. TITLE:=Knot DNS
  26. URL:=https://www.knot-dns.cz
  27. SUBMENU:=IP Addresses and Names
  28. DEPENDS:=+libopenssl +liburcu
  29. endef
  30. define Package/knot-libknot
  31. $(call Package/knot/Default)
  32. TITLE+= (library)
  33. endef
  34. define Package/knot
  35. $(call Package/knot/Default)
  36. TITLE+= (server)
  37. DEPENDS+=+knot-libknot
  38. endef
  39. define Package/knot-utils
  40. $(call Package/knot/Default)
  41. TITLE+= (utils)
  42. DEPENDS+=+knot-libknot
  43. endef
  44. define Package/knot-tests
  45. $(call Package/knot/Default)
  46. TITLE+= (tests)
  47. DEPENDS+=+knot-libknot
  48. endef
  49. define Package/knot-libknot/description
  50. Knot DNS library.
  51. endef
  52. define Package/knot/description
  53. High-performance authoritative-only DNS server.
  54. endef
  55. define Package/knot-utils/description
  56. DNS utilities: kdig, khost, knsupdate and knsec3hash.
  57. endef
  58. define Package/knot-tests/description
  59. Unit tests for Knot DNS server.
  60. Usage: /usr/share/knot/runtests.sh
  61. endef
  62. define Package/knot/conffiles
  63. /etc/knot/knot.conf
  64. endef
  65. CONFIGURE_ARGS += \
  66. --enable-recvmmsg=no \
  67. --disable-fastparser \
  68. --without-libidn \
  69. --with-rundir=/var/run \
  70. --with-storage=/etc/knot
  71. TARGET_CFLAGS += -std=gnu99 -DPSELECT_COMPAT
  72. define Build/Compile
  73. $(MAKE) -C $(PKG_BUILD_DIR)
  74. $(MAKE) -C $(PKG_BUILD_DIR)/libtap check
  75. $(MAKE) -C $(PKG_BUILD_DIR)/tests check-compile-only
  76. $(MAKE) -C $(PKG_BUILD_DIR)/src/zscanner check-compile-only
  77. endef
  78. define Package/knot-libknot/install
  79. $(INSTALL_DIR) $(1)/usr/lib
  80. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libknot.so.* $(1)/usr/lib/
  81. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzscanner.so.* $(1)/usr/lib/
  82. endef
  83. define Package/knot/install
  84. $(INSTALL_DIR) $(1)/usr/sbin
  85. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotc $(1)/usr/sbin/
  86. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotd $(1)/usr/sbin/
  87. $(INSTALL_DIR) $(1)/etc/knot
  88. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knot/knot.sample.conf $(1)/etc/knot/knot.conf
  89. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/knot/example.com.zone $(1)/etc/knot/
  90. $(INSTALL_DIR) $(1)/etc/init.d
  91. $(INSTALL_BIN) ./files/knotd.init $(1)/etc/init.d/knotd
  92. endef
  93. define Package/knot-utils/install
  94. $(INSTALL_DIR) $(1)/usr/bin
  95. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdig $(1)/usr/bin/
  96. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/khost $(1)/usr/bin/
  97. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate $(1)/usr/bin/
  98. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsec3hash $(1)/usr/bin/
  99. endef
  100. define Package/knot-tests/install
  101. $(INSTALL_DIR) $(1)/usr/share/knot
  102. $(INSTALL_BIN) ./files/runtests.sh $(1)/usr/share/knot/
  103. $(INSTALL_DIR) $(1)/usr/share/knot/tap
  104. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/runtests $(1)/usr/share/knot/tap/
  105. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/tap/libtap.sh $(1)/usr/share/knot/tap/
  106. $(INSTALL_DIR) $(1)/usr/share/knot/tests
  107. find $(PKG_BUILD_DIR)/tests/.libs -maxdepth 1 -executable -type f | \
  108. xargs -I{} basename {} | \
  109. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/.libs/{} $(1)/usr/share/knot/tests/test_{}
  110. $(INSTALL_DIR) $(1)/usr/share/knot/tests/data
  111. $(INSTALL_DATA) $(PKG_BUILD_DIR)/tests/data/sample_conf $(1)/usr/share/knot/tests/data/
  112. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/.libs/zscanner-tool $(1)/usr/share/knot/tests/
  113. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/unittests $(1)/usr/share/knot/tests/test_zscanner
  114. $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/zscanner/tests/TESTS $(1)/usr/share/knot/tests/
  115. cp -a $(PKG_BUILD_DIR)/src/zscanner/tests/data $(1)/usr/share/knot/tests/
  116. endef
  117. $(eval $(call BuildPackage,knot-libknot))
  118. $(eval $(call BuildPackage,knot))
  119. $(eval $(call BuildPackage,knot-utils))
  120. $(eval $(call BuildPackage,knot-tests))