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.

195 lines
5.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.3
  10. PKG_RELEASE:=2
  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-dig
  40. $(call Package/knot/Default)
  41. TITLE+= lookup utility
  42. DEPENDS+=+knot-libknot
  43. endef
  44. define Package/knot-host
  45. $(call Package/knot/Default)
  46. TITLE+= simple DNS lookup utility
  47. DEPENDS+=+knot-libknot
  48. endef
  49. define Package/knot-nsec3hash
  50. $(call Package/knot/Default)
  51. TITLE+= simple NSEC3 hash utility
  52. DEPENDS+=+knot-libknot
  53. endef
  54. define Package/knot-nsupdate
  55. $(call Package/knot/Default)
  56. TITLE+= dynamic DNS update utility
  57. DEPENDS+=+knot-libknot
  58. endef
  59. define Package/knot-tests
  60. $(call Package/knot/Default)
  61. TITLE+= (tests)
  62. DEPENDS+=+knot-libknot
  63. endef
  64. define Package/knot-libknot/description
  65. Knot DNS library.
  66. endef
  67. define Package/knot/description
  68. High-performance authoritative-only DNS server.
  69. endef
  70. define Package/knot-dig/description
  71. Knot DNS lookup utility.
  72. endef
  73. define Package/knot-host/description
  74. Knot DNS simple DNS lookup utility.
  75. endef
  76. define Package/knot-nsec3hash/description
  77. Knot DNS simple utility to compute NSEC3 hash.
  78. endef
  79. define Package/knot-nsupdate/description
  80. Knot DNS dynamic DNS update utility.
  81. endef
  82. define Package/knot-tests/description
  83. Unit tests for Knot DNS server.
  84. Usage: /usr/share/knot/runtests.sh
  85. endef
  86. define Package/knot/conffiles
  87. /etc/knot/knot.conf
  88. endef
  89. CONFIGURE_ARGS += \
  90. --enable-recvmmsg=no \
  91. --disable-fastparser \
  92. --without-libidn \
  93. --with-rundir=/var/run \
  94. --with-storage=/etc/knot
  95. TARGET_CFLAGS += -std=gnu99 -DPSELECT_COMPAT
  96. define Build/Compile
  97. $(MAKE) -C $(PKG_BUILD_DIR)
  98. $(MAKE) -C $(PKG_BUILD_DIR)/libtap check
  99. $(MAKE) -C $(PKG_BUILD_DIR)/tests check-compile-only
  100. $(MAKE) -C $(PKG_BUILD_DIR)/src/zscanner check-compile-only
  101. endef
  102. define Package/knot-libknot/install
  103. $(INSTALL_DIR) $(1)/usr/lib
  104. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libknot.so.* $(1)/usr/lib/
  105. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzscanner.so.* $(1)/usr/lib/
  106. endef
  107. define Package/knot/install
  108. $(INSTALL_DIR) $(1)/usr/sbin
  109. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotc $(1)/usr/sbin/
  110. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotd $(1)/usr/sbin/
  111. $(INSTALL_DIR) $(1)/etc/knot
  112. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knot/knot.sample.conf $(1)/etc/knot/knot.conf
  113. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/knot/example.com.zone $(1)/etc/knot/
  114. $(INSTALL_DIR) $(1)/etc/init.d
  115. $(INSTALL_BIN) ./files/knotd.init $(1)/etc/init.d/knotd
  116. endef
  117. define Package/knot-dig/install
  118. $(INSTALL_DIR) $(1)/usr/bin
  119. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdig $(1)/usr/bin/
  120. endef
  121. define Package/knot-host/install
  122. $(INSTALL_DIR) $(1)/usr/bin
  123. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/khost $(1)/usr/bin/
  124. endef
  125. define Package/knot-nsec3hash/install
  126. $(INSTALL_DIR) $(1)/usr/bin
  127. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsec3hash $(1)/usr/bin/
  128. endef
  129. define Package/knot-nsupdate/install
  130. $(INSTALL_DIR) $(1)/usr/bin
  131. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate $(1)/usr/bin/
  132. endef
  133. define Package/knot-tests/install
  134. $(INSTALL_DIR) $(1)/usr/share/knot
  135. $(INSTALL_BIN) ./files/runtests.sh $(1)/usr/share/knot/
  136. $(INSTALL_DIR) $(1)/usr/share/knot/tap
  137. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/runtests $(1)/usr/share/knot/tap/
  138. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/tap/libtap.sh $(1)/usr/share/knot/tap/
  139. $(INSTALL_DIR) $(1)/usr/share/knot/tests
  140. find $(PKG_BUILD_DIR)/tests/.libs -maxdepth 1 -executable -type f | \
  141. xargs -I{} basename {} | \
  142. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/.libs/{} $(1)/usr/share/knot/tests/test_{}
  143. $(INSTALL_DIR) $(1)/usr/share/knot/tests/data
  144. $(INSTALL_DATA) $(PKG_BUILD_DIR)/tests/data/sample_conf $(1)/usr/share/knot/tests/data/
  145. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/.libs/zscanner-tool $(1)/usr/share/knot/tests/
  146. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/unittests $(1)/usr/share/knot/tests/test_zscanner
  147. $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/zscanner/tests/TESTS $(1)/usr/share/knot/tests/
  148. cp -a $(PKG_BUILD_DIR)/src/zscanner/tests/data $(1)/usr/share/knot/tests/
  149. endef
  150. $(eval $(call BuildPackage,knot-libknot))
  151. $(eval $(call BuildPackage,knot))
  152. $(eval $(call BuildPackage,knot-dig))
  153. $(eval $(call BuildPackage,knot-host))
  154. $(eval $(call BuildPackage,knot-nsec3hash))
  155. $(eval $(call BuildPackage,knot-nsupdate))
  156. $(eval $(call BuildPackage,knot-tests))