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.

267 lines
7.7 KiB

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