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.

266 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
  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. export KNOT_VERSION_FORMAT=release
  121. CONFIGURE_ARGS += \
  122. --enable-recvmmsg=no \
  123. --disable-fastparser \
  124. --without-libidn \
  125. --with-rundir=/var/run/knot \
  126. --with-storage=/var/lib/knot \
  127. --with-configdir=/etc/knot \
  128. --with-conf-mapsize=20
  129. TARGET_CFLAGS += -DPSELECT_COMPAT -DNDEBUG
  130. define Package/knot/conffiles
  131. /etc/knot/knot.conf
  132. endef
  133. define Build/Compile
  134. $(MAKE) -C $(PKG_BUILD_DIR)
  135. $(MAKE) -C $(PKG_BUILD_DIR)/tests check-compile
  136. endef
  137. define Build/InstallDev
  138. $(INSTALL_DIR) $(1)/usr/lib
  139. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} $(1)/usr/lib/
  140. $(INSTALL_DIR) $(1)/usr/include/libknot
  141. $(CP) $(PKG_INSTALL_DIR)/usr/include/libknot/* $(1)/usr/include/libknot/
  142. $(INSTALL_DIR) $(1)/usr/include/libdnssec
  143. $(CP) $(PKG_INSTALL_DIR)/usr/include/libdnssec/* $(1)/usr/include/libdnssec/
  144. $(INSTALL_DIR) $(1)/usr/include/libzscanner
  145. $(CP) $(PKG_INSTALL_DIR)/usr/include/libzscanner/* $(1)/usr/include/libzscanner/
  146. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  147. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
  148. endef
  149. define Package/knot-libs/install
  150. $(INSTALL_DIR) $(1)/usr/lib
  151. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnssec.so.* $(1)/usr/lib/
  152. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libknot.so.* $(1)/usr/lib/
  153. endef
  154. define Package/knot-libzscanner/install
  155. $(INSTALL_DIR) $(1)/usr/lib
  156. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzscanner.so.* $(1)/usr/lib/
  157. endef
  158. define Package/knot/install
  159. $(INSTALL_DIR) $(1)/usr/bin
  160. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotc $(1)/usr/bin/
  161. $(INSTALL_DIR) $(1)/usr/sbin
  162. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotd $(1)/usr/sbin/
  163. $(INSTALL_DIR) $(1)/etc/knot
  164. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knot/knot.sample.conf $(1)/etc/knot/knot.conf
  165. $(INSTALL_DIR) $(1)/etc/init.d
  166. $(INSTALL_BIN) ./files/knotd.init $(1)/etc/init.d/knotd
  167. endef
  168. define Package/knot-dig/install
  169. $(INSTALL_DIR) $(1)/usr/bin
  170. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdig $(1)/usr/bin/
  171. endef
  172. define Package/knot-host/install
  173. $(INSTALL_DIR) $(1)/usr/bin
  174. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/khost $(1)/usr/bin/
  175. endef
  176. define Package/knot-nsupdate/install
  177. $(INSTALL_DIR) $(1)/usr/bin
  178. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate $(1)/usr/bin/
  179. endef
  180. define Package/knot-zonecheck/install
  181. $(INSTALL_DIR) $(1)/usr/bin
  182. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kzonecheck $(1)/usr/bin/
  183. endef
  184. define Package/knot-keymgr/install
  185. $(INSTALL_DIR) $(1)/usr/bin
  186. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keymgr $(1)/usr/bin/
  187. endef
  188. define Package/knot-tests/install
  189. $(INSTALL_DIR) $(1)/usr/share/knot
  190. $(INSTALL_BIN) ./files/runtests.sh $(1)/usr/share/knot/
  191. $(INSTALL_DIR) $(1)/usr/share/knot/tap
  192. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tests/tap/.libs/runtests $(1)/usr/share/knot/tap/
  193. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tests/tap/libtap.sh $(1)/usr/share/knot/tap/
  194. $(INSTALL_DIR) $(1)/usr/share/knot/tests
  195. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tests/libzscanner/.libs/zscanner-tool $(1)/usr/share/knot/tests/
  196. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tests/libzscanner/test_zscanner $(1)/usr/share/knot/tests/
  197. $(INSTALL_DATA) $(PKG_BUILD_DIR)/tests/libzscanner/TESTS $(1)/usr/share/knot/tests/
  198. cp -a $(PKG_BUILD_DIR)/tests/libzscanner/data $(1)/usr/share/knot/tests/
  199. for module in contrib knot libdnssec libknot modules utils; do \
  200. find $(PKG_BUILD_DIR)/tests/$$$${module}/.libs -maxdepth 1 -executable -type f | \
  201. xargs -I{} basename {} | \
  202. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/$$$${module}/.libs/{} \
  203. $(1)/usr/share/knot/tests/$$$${module}_{}; \
  204. done
  205. endef
  206. $(eval $(call BuildPackage,knot-libs))
  207. $(eval $(call BuildPackage,knot-libzscanner))
  208. $(eval $(call BuildPackage,knot))
  209. $(eval $(call BuildPackage,knot-dig))
  210. $(eval $(call BuildPackage,knot-host))
  211. $(eval $(call BuildPackage,knot-nsupdate))
  212. $(eval $(call BuildPackage,knot-zonecheck))
  213. $(eval $(call BuildPackage,knot-keymgr))
  214. $(eval $(call BuildPackage,knot-tests))