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.

269 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.9.2
  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:=298cdf33aa7589b50df7e5833694b24cd2de8b6d17cee7e1673873fe576db6ee
  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_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 +lmdb @!arc
  39. endef
  40. define Package/knot-libzscanner
  41. $(call Package/knot-lib/Default)
  42. TITLE+= zone parser library
  43. DEPENDS+=@!arc
  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. ifneq ($(CONFIG_arc),y)
  139. define Build/InstallDev
  140. $(INSTALL_DIR) $(1)/usr/lib
  141. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} $(1)/usr/lib/
  142. $(INSTALL_DIR) $(1)/usr/include/libknot
  143. $(CP) $(PKG_INSTALL_DIR)/usr/include/libknot/* $(1)/usr/include/libknot/
  144. $(INSTALL_DIR) $(1)/usr/include/libdnssec
  145. $(CP) $(PKG_INSTALL_DIR)/usr/include/libdnssec/* $(1)/usr/include/libdnssec/
  146. $(INSTALL_DIR) $(1)/usr/include/libzscanner
  147. $(CP) $(PKG_INSTALL_DIR)/usr/include/libzscanner/* $(1)/usr/include/libzscanner/
  148. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  149. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
  150. endef
  151. endif
  152. define Package/knot-libs/install
  153. $(INSTALL_DIR) $(1)/usr/lib
  154. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnssec.so.* $(1)/usr/lib/
  155. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libknot.so.* $(1)/usr/lib/
  156. endef
  157. define Package/knot-libzscanner/install
  158. $(INSTALL_DIR) $(1)/usr/lib
  159. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzscanner.so.* $(1)/usr/lib/
  160. endef
  161. define Package/knot/install
  162. $(INSTALL_DIR) $(1)/usr/bin
  163. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotc $(1)/usr/bin/
  164. $(INSTALL_DIR) $(1)/usr/sbin
  165. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotd $(1)/usr/sbin/
  166. $(INSTALL_DIR) $(1)/etc/knot
  167. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knot/knot.sample.conf $(1)/etc/knot/knot.conf
  168. $(INSTALL_DIR) $(1)/etc/init.d
  169. $(INSTALL_BIN) ./files/knotd.init $(1)/etc/init.d/knotd
  170. endef
  171. define Package/knot-dig/install
  172. $(INSTALL_DIR) $(1)/usr/bin
  173. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdig $(1)/usr/bin/
  174. endef
  175. define Package/knot-host/install
  176. $(INSTALL_DIR) $(1)/usr/bin
  177. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/khost $(1)/usr/bin/
  178. endef
  179. define Package/knot-nsupdate/install
  180. $(INSTALL_DIR) $(1)/usr/bin
  181. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate $(1)/usr/bin/
  182. endef
  183. define Package/knot-zonecheck/install
  184. $(INSTALL_DIR) $(1)/usr/bin
  185. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kzonecheck $(1)/usr/bin/
  186. endef
  187. define Package/knot-keymgr/install
  188. $(INSTALL_DIR) $(1)/usr/bin
  189. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keymgr $(1)/usr/bin/
  190. endef
  191. define Package/knot-tests/install
  192. $(INSTALL_DIR) $(1)/usr/share/knot
  193. $(INSTALL_BIN) ./files/runtests.sh $(1)/usr/share/knot/
  194. $(INSTALL_DIR) $(1)/usr/share/knot/tap
  195. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tests/tap/.libs/runtests $(1)/usr/share/knot/tap/
  196. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tests/tap/libtap.sh $(1)/usr/share/knot/tap/
  197. $(INSTALL_DIR) $(1)/usr/share/knot/tests
  198. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tests/libzscanner/.libs/zscanner-tool $(1)/usr/share/knot/tests/
  199. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tests/libzscanner/test_zscanner $(1)/usr/share/knot/tests/
  200. $(INSTALL_DATA) $(PKG_BUILD_DIR)/tests/libzscanner/TESTS $(1)/usr/share/knot/tests/
  201. cp -a $(PKG_BUILD_DIR)/tests/libzscanner/data $(1)/usr/share/knot/tests/
  202. for module in contrib knot libdnssec libknot modules utils; do \
  203. find $(PKG_BUILD_DIR)/tests/$$$${module}/.libs -maxdepth 1 -executable -type f | \
  204. xargs -I{} basename {} | \
  205. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/$$$${module}/.libs/{} \
  206. $(1)/usr/share/knot/tests/$$$${module}_{}; \
  207. done
  208. endef
  209. $(eval $(call BuildPackage,knot-libs))
  210. $(eval $(call BuildPackage,knot-libzscanner))
  211. $(eval $(call BuildPackage,knot))
  212. $(eval $(call BuildPackage,knot-dig))
  213. $(eval $(call BuildPackage,knot-host))
  214. $(eval $(call BuildPackage,knot-nsupdate))
  215. $(eval $(call BuildPackage,knot-zonecheck))
  216. $(eval $(call BuildPackage,knot-keymgr))
  217. $(eval $(call BuildPackage,knot-tests))