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.

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