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.

275 lines
8.2 KiB

  1. #
  2. # Copyright (C) 2014-2018 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.6.7
  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:=1c2a004b05c161f7b36d5eeccebd9d4cdf60aa09930a7cc766514e468ca92243
  14. PKG_MAINTAINER:=Daniel Salzman <daniel.salzman@nic.cz>
  15. PKG_LICENSE:=GPL-3.0 LGPL-2.0 0BSD MIT OLDAP-2.8
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
  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
  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. CONFIGURE_ARGS += \
  121. --enable-recvmmsg=no \
  122. --disable-fastparser \
  123. --without-libidn \
  124. --with-rundir=/var/run/knot \
  125. --with-storage=/var/lib/knot \
  126. --with-configdir=/etc/knot \
  127. --with-conf-mapsize=20
  128. TARGET_CFLAGS += -DPSELECT_COMPAT -DNDEBUG
  129. define Package/knot/conffiles
  130. /etc/knot/knot.conf
  131. endef
  132. define Build/Compile
  133. $(MAKE) -C $(PKG_BUILD_DIR)
  134. $(MAKE) -C $(PKG_BUILD_DIR)/libtap check
  135. $(MAKE) -C $(PKG_BUILD_DIR)/src/dnssec/tests check-compile
  136. $(MAKE) -C $(PKG_BUILD_DIR)/tests check-compile
  137. $(MAKE) -C $(PKG_BUILD_DIR)/src/zscanner check-compile
  138. endef
  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/dnssec
  145. $(CP) $(PKG_INSTALL_DIR)/usr/include/dnssec/* $(1)/usr/include/dnssec/
  146. $(INSTALL_DIR) $(1)/usr/include/zscanner
  147. $(CP) $(PKG_INSTALL_DIR)/usr/include/zscanner/* $(1)/usr/include/zscanner/
  148. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  149. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
  150. endef
  151. define Package/knot-libs/install
  152. $(INSTALL_DIR) $(1)/usr/lib
  153. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnssec.so.* $(1)/usr/lib/
  154. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libknot.so.* $(1)/usr/lib/
  155. endef
  156. define Package/knot-libzscanner/install
  157. $(INSTALL_DIR) $(1)/usr/lib
  158. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzscanner.so.* $(1)/usr/lib/
  159. endef
  160. define Package/knot/install
  161. $(INSTALL_DIR) $(1)/usr/bin
  162. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotc $(1)/usr/bin/
  163. $(INSTALL_DIR) $(1)/usr/sbin
  164. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotd $(1)/usr/sbin/
  165. $(INSTALL_DIR) $(1)/etc/knot
  166. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knot/knot.sample.conf $(1)/etc/knot/knot.conf
  167. $(INSTALL_DIR) $(1)/etc/init.d
  168. $(INSTALL_BIN) ./files/knotd.init $(1)/etc/init.d/knotd
  169. endef
  170. define Package/knot-dig/install
  171. $(INSTALL_DIR) $(1)/usr/bin
  172. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdig $(1)/usr/bin/
  173. endef
  174. define Package/knot-host/install
  175. $(INSTALL_DIR) $(1)/usr/bin
  176. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/khost $(1)/usr/bin/
  177. endef
  178. define Package/knot-nsupdate/install
  179. $(INSTALL_DIR) $(1)/usr/bin
  180. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate $(1)/usr/bin/
  181. endef
  182. define Package/knot-zonecheck/install
  183. $(INSTALL_DIR) $(1)/usr/bin
  184. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kzonecheck $(1)/usr/bin/
  185. endef
  186. define Package/knot-keymgr/install
  187. $(INSTALL_DIR) $(1)/usr/bin
  188. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keymgr $(1)/usr/bin/
  189. endef
  190. define Package/knot-tests/install
  191. $(INSTALL_DIR) $(1)/usr/share/knot
  192. $(INSTALL_BIN) ./files/runtests.sh $(1)/usr/share/knot/
  193. $(INSTALL_DIR) $(1)/usr/share/knot/tap
  194. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/runtests $(1)/usr/share/knot/tap/
  195. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/tap/libtap.sh $(1)/usr/share/knot/tap/
  196. $(INSTALL_DIR) $(1)/usr/share/knot/tests
  197. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/.libs/zscanner-tool $(1)/usr/share/knot/tests/
  198. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/unittests $(1)/usr/share/knot/tests/test_zscanner
  199. $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/zscanner/tests/TESTS $(1)/usr/share/knot/tests/
  200. cp -a $(PKG_BUILD_DIR)/src/zscanner/tests/data $(1)/usr/share/knot/tests/
  201. find $(PKG_BUILD_DIR)/src/dnssec/tests -maxdepth 1 -executable -type f | \
  202. xargs -I{} basename {} | \
  203. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/src/dnssec/tests/{} $(1)/usr/share/knot/tests/dnssec_test_{}
  204. find $(PKG_BUILD_DIR)/tests/.libs -maxdepth 1 -executable -type f | \
  205. xargs -I{} basename {} | \
  206. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/.libs/{} $(1)/usr/share/knot/tests/{}
  207. for module in contrib libknot modules utils; do \
  208. find $(PKG_BUILD_DIR)/tests/$$$${module}/.libs -maxdepth 1 -executable -type f | \
  209. xargs -I{} basename {} | \
  210. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/$$$${module}/.libs/{} \
  211. $(1)/usr/share/knot/tests/$$$${module}_{}; \
  212. done
  213. endef
  214. $(eval $(call BuildPackage,knot-libs))
  215. $(eval $(call BuildPackage,knot-libzscanner))
  216. $(eval $(call BuildPackage,knot))
  217. $(eval $(call BuildPackage,knot-dig))
  218. $(eval $(call BuildPackage,knot-host))
  219. $(eval $(call BuildPackage,knot-nsupdate))
  220. $(eval $(call BuildPackage,knot-zonecheck))
  221. $(eval $(call BuildPackage,knot-keymgr))
  222. $(eval $(call BuildPackage,knot-tests))