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.

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