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.

148 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
  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:=d677de99c19afea3b1e8ef075a9d5a8b
  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. define Package/knot/conffiles
  62. /etc/knot/knot.conf
  63. endef
  64. CONFIGURE_ARGS += \
  65. --enable-recvmmsg=no \
  66. --disable-fastparser \
  67. --without-libidn \
  68. --with-rundir=/var/run \
  69. --with-storage=/etc/knot
  70. TARGET_CFLAGS += -std=gnu99 -DPSELECT_COMPAT
  71. define Build/Compile
  72. $(MAKE) -C $(PKG_BUILD_DIR)
  73. $(MAKE) -C $(PKG_BUILD_DIR)/libtap check
  74. $(MAKE) -C $(PKG_BUILD_DIR)/tests check-compile-only
  75. $(MAKE) -C $(PKG_BUILD_DIR)/src/zscanner check-compile-only
  76. endef
  77. define Package/knot-libknot/install
  78. $(INSTALL_DIR) $(1)/usr/lib
  79. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libknot.so.* $(1)/usr/lib/
  80. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzscanner.so.* $(1)/usr/lib/
  81. endef
  82. define Package/knot/install
  83. $(INSTALL_DIR) $(1)/usr/sbin
  84. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotc $(1)/usr/sbin/
  85. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotd $(1)/usr/sbin/
  86. $(INSTALL_DIR) $(1)/etc/knot
  87. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knot/knot.sample.conf $(1)/etc/knot/knot.conf
  88. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/knot/example.com.zone $(1)/etc/knot/
  89. $(INSTALL_DIR) $(1)/etc/init.d
  90. $(INSTALL_BIN) ./files/knotd.init $(1)/etc/init.d/knotd
  91. endef
  92. define Package/knot-utils/install
  93. $(INSTALL_DIR) $(1)/usr/bin
  94. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdig $(1)/usr/bin/
  95. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/khost $(1)/usr/bin/
  96. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate $(1)/usr/bin/
  97. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsec3hash $(1)/usr/bin/
  98. endef
  99. define Package/knot-tests/install
  100. $(INSTALL_DIR) $(1)/usr/share/knot
  101. $(INSTALL_BIN) ./files/runtests.sh $(1)/usr/share/knot/
  102. $(INSTALL_DIR) $(1)/usr/share/knot/tap
  103. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/runtests $(1)/usr/share/knot/tap/
  104. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/tap/libtap.sh $(1)/usr/share/knot/tap/
  105. $(INSTALL_DIR) $(1)/usr/share/knot/tests
  106. find $(PKG_BUILD_DIR)/tests/.libs -maxdepth 1 -executable -type f | \
  107. xargs -I{} basename {} | \
  108. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/.libs/{} $(1)/usr/share/knot/tests/test_{}
  109. $(INSTALL_DIR) $(1)/usr/share/knot/tests/data
  110. $(INSTALL_DATA) $(PKG_BUILD_DIR)/tests/data/sample_conf $(1)/usr/share/knot/tests/data/
  111. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/.libs/zscanner-tool $(1)/usr/share/knot/tests/
  112. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/unittests $(1)/usr/share/knot/tests/test_zscanner
  113. $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/zscanner/tests/TESTS $(1)/usr/share/knot/tests/
  114. cp -a $(PKG_BUILD_DIR)/src/zscanner/tests/data $(1)/usr/share/knot/tests/
  115. endef
  116. $(eval $(call BuildPackage,knot-libknot))
  117. $(eval $(call BuildPackage,knot))
  118. $(eval $(call BuildPackage,knot-utils))
  119. $(eval $(call BuildPackage,knot-tests))