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.

264 lines
7.6 KiB

  1. #
  2. # Copyright (C) 2014-2018 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:=2.7.4
  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:=acebe2fbcd8f67b0cb8969376114855316fe831df08321b795147502a5e9fd74
  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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
  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
  39. endef
  40. define Package/knot-libzscanner
  41. $(call Package/knot-lib/Default)
  42. TITLE+= zone parser library
  43. endef
  44. define Package/knot
  45. $(call Package/knot/Default)
  46. TITLE+= server with control utility
  47. DEPENDS+=+libedit +liburcu +knot-libs +knot-libzscanner
  48. EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE)), \
  49. knot-libzscanner (=$(PKG_VERSION)-$(PKG_RELEASE))
  50. USERID:=knot=5353:knot=5353
  51. endef
  52. define Package/knot-dig
  53. $(call Package/knot/Default)
  54. TITLE+= advanced DNS lookup utility
  55. DEPENDS+=+libedit +knot-libs
  56. EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE))
  57. endef
  58. define Package/knot-host
  59. $(call Package/knot/Default)
  60. TITLE+= simple DNS lookup utility
  61. DEPENDS+=+libedit +knot-libs
  62. EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE))
  63. endef
  64. define Package/knot-nsupdate
  65. $(call Package/knot/Default)
  66. TITLE+= dynamic DNS update utility
  67. DEPENDS+=+libedit +knot-libs +knot-libzscanner
  68. EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE)), \
  69. knot-libzscanner (=$(PKG_VERSION)-$(PKG_RELEASE))
  70. endef
  71. define Package/knot-zonecheck
  72. $(call Package/knot/Default)
  73. TITLE+= zonefile check utility
  74. DEPENDS+=+libedit +liburcu +knot-libs +knot-libzscanner
  75. EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE)), \
  76. knot-libzscanner (=$(PKG_VERSION)-$(PKG_RELEASE))
  77. endef
  78. define Package/knot-keymgr
  79. $(call Package/knot/Default)
  80. TITLE+= DNSSEC key management utility
  81. DEPENDS+=+libedit +liburcu +knot-libs +knot-libzscanner
  82. EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE)), \
  83. knot-libzscanner (=$(PKG_VERSION)-$(PKG_RELEASE))
  84. endef
  85. define Package/knot-tests
  86. $(call Package/knot/Default)
  87. TITLE+= tests
  88. DEPENDS+=+libedit +liburcu +knot-libs +knot-libzscanner
  89. EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE)), \
  90. knot-libzscanner (=$(PKG_VERSION)-$(PKG_RELEASE))
  91. endef
  92. define Package/knot-libs/description
  93. Knot DNS common DNS and DNSSEC libraries.
  94. endef
  95. define Package/knot-libzscanner/description
  96. Knot DNS zone parser library.
  97. endef
  98. define Package/knot/description
  99. High-performance authoritative-only DNS server.
  100. endef
  101. define Package/knot-dig/description
  102. Knot DNS advanced DNS lookup utility.
  103. endef
  104. define Package/knot-host/description
  105. Knot DNS simple DNS lookup utility.
  106. endef
  107. define Package/knot-nsupdate/description
  108. Knot DNS dynamic DNS update utility.
  109. endef
  110. define Package/knot-zonecheck/description
  111. Knot DNS zonefile check utility.
  112. endef
  113. define Package/knot-keymgr/description
  114. Knot DNS DNSSEC key management utility.
  115. endef
  116. define Package/knot-tests/description
  117. Unit tests for the Knot DNS server and libraries.
  118. Usage: /usr/share/knot/runtests.sh
  119. endef
  120. CONFIGURE_ARGS += \
  121. --enable-recvmmsg=no \
  122. --disable-fastparser \
  123. --without-libidn \
  124. --with-rundir=/var/run/knot \
  125. --with-storage=/var/lib/knot \
  126. --with-configdir=/etc/knot \
  127. --with-conf-mapsize=20
  128. TARGET_CFLAGS += -DPSELECT_COMPAT -DNDEBUG
  129. define Package/knot/conffiles
  130. /etc/knot/knot.conf
  131. endef
  132. define Build/Compile
  133. $(MAKE) -C $(PKG_BUILD_DIR)
  134. $(MAKE) -C $(PKG_BUILD_DIR)/tests check-compile
  135. endef
  136. define Build/InstallDev
  137. $(INSTALL_DIR) $(1)/usr/lib
  138. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} $(1)/usr/lib/
  139. $(INSTALL_DIR) $(1)/usr/include/libknot
  140. $(CP) $(PKG_INSTALL_DIR)/usr/include/libknot/* $(1)/usr/include/libknot/
  141. $(INSTALL_DIR) $(1)/usr/include/libdnssec
  142. $(CP) $(PKG_INSTALL_DIR)/usr/include/libdnssec/* $(1)/usr/include/libdnssec/
  143. $(INSTALL_DIR) $(1)/usr/include/libzscanner
  144. $(CP) $(PKG_INSTALL_DIR)/usr/include/libzscanner/* $(1)/usr/include/libzscanner/
  145. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  146. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
  147. endef
  148. define Package/knot-libs/install
  149. $(INSTALL_DIR) $(1)/usr/lib
  150. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnssec.so.* $(1)/usr/lib/
  151. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libknot.so.* $(1)/usr/lib/
  152. endef
  153. define Package/knot-libzscanner/install
  154. $(INSTALL_DIR) $(1)/usr/lib
  155. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzscanner.so.* $(1)/usr/lib/
  156. endef
  157. define Package/knot/install
  158. $(INSTALL_DIR) $(1)/usr/bin
  159. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotc $(1)/usr/bin/
  160. $(INSTALL_DIR) $(1)/usr/sbin
  161. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotd $(1)/usr/sbin/
  162. $(INSTALL_DIR) $(1)/etc/knot
  163. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knot/knot.sample.conf $(1)/etc/knot/knot.conf
  164. $(INSTALL_DIR) $(1)/etc/init.d
  165. $(INSTALL_BIN) ./files/knotd.init $(1)/etc/init.d/knotd
  166. endef
  167. define Package/knot-dig/install
  168. $(INSTALL_DIR) $(1)/usr/bin
  169. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdig $(1)/usr/bin/
  170. endef
  171. define Package/knot-host/install
  172. $(INSTALL_DIR) $(1)/usr/bin
  173. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/khost $(1)/usr/bin/
  174. endef
  175. define Package/knot-nsupdate/install
  176. $(INSTALL_DIR) $(1)/usr/bin
  177. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate $(1)/usr/bin/
  178. endef
  179. define Package/knot-zonecheck/install
  180. $(INSTALL_DIR) $(1)/usr/bin
  181. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kzonecheck $(1)/usr/bin/
  182. endef
  183. define Package/knot-keymgr/install
  184. $(INSTALL_DIR) $(1)/usr/bin
  185. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keymgr $(1)/usr/bin/
  186. endef
  187. define Package/knot-tests/install
  188. $(INSTALL_DIR) $(1)/usr/share/knot
  189. $(INSTALL_BIN) ./files/runtests.sh $(1)/usr/share/knot/
  190. $(INSTALL_DIR) $(1)/usr/share/knot/tap
  191. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tests/tap/runtests $(1)/usr/share/knot/tap/
  192. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tests/tap/libtap.sh $(1)/usr/share/knot/tap/
  193. $(INSTALL_DIR) $(1)/usr/share/knot/tests
  194. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tests/libzscanner/.libs/zscanner-tool $(1)/usr/share/knot/tests/
  195. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tests/libzscanner/test_zscanner $(1)/usr/share/knot/tests/
  196. $(INSTALL_DATA) $(PKG_BUILD_DIR)/tests/libzscanner/TESTS $(1)/usr/share/knot/tests/
  197. cp -a $(PKG_BUILD_DIR)/tests/libzscanner/data $(1)/usr/share/knot/tests/
  198. for module in contrib knot libdnssec libknot modules utils; do \
  199. find $(PKG_BUILD_DIR)/tests/$$$${module}/.libs -maxdepth 1 -executable -type f | \
  200. xargs -I{} basename {} | \
  201. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/$$$${module}/.libs/{} \
  202. $(1)/usr/share/knot/tests/$$$${module}_{}; \
  203. done
  204. endef
  205. $(eval $(call BuildPackage,knot-libs))
  206. $(eval $(call BuildPackage,knot-libzscanner))
  207. $(eval $(call BuildPackage,knot))
  208. $(eval $(call BuildPackage,knot-dig))
  209. $(eval $(call BuildPackage,knot-host))
  210. $(eval $(call BuildPackage,knot-nsupdate))
  211. $(eval $(call BuildPackage,knot-zonecheck))
  212. $(eval $(call BuildPackage,knot-keymgr))
  213. $(eval $(call BuildPackage,knot-tests))