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.

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