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.

307 lines
9.0 KiB

  1. #
  2. # Copyright (C) 2014-2016 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.3.0
  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_MD5SUM:=7ca754f972fb07faa4f30e50d8a4385b
  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. URL:=https://www.knot-dns.cz
  25. endef
  26. define Package/knot/Default
  27. SECTION:=net
  28. CATEGORY:=Network
  29. SUBMENU:=IP Addresses and Names
  30. TITLE:=Knot DNS
  31. URL:=https://www.knot-dns.cz
  32. USERID:=knot=5353:knot=5353
  33. endef
  34. define Package/knot-libdnssec
  35. $(call Package/knot-lib/Default)
  36. TITLE+= DNSSEC library
  37. DEPENDS=+libpthread +libgnutls +jansson
  38. endef
  39. define Package/knot-libknot
  40. $(call Package/knot-lib/Default)
  41. TITLE+= library
  42. DEPENDS=+libpthread +knot-libdnssec
  43. endef
  44. define Package/knot-libzscanner
  45. $(call Package/knot-lib/Default)
  46. TITLE+= zone parser library
  47. DEPENDS=+libpthread
  48. endef
  49. define Package/knot
  50. $(call Package/knot/Default)
  51. TITLE+= server
  52. DEPENDS=+liburcu +libedit +knot-libdnssec +knot-libknot +knot-libzscanner
  53. endef
  54. define Package/knot-dig
  55. $(call Package/knot/Default)
  56. TITLE+= advanced DNS lookup utility
  57. DEPENDS=+knot-libdnssec +knot-libknot
  58. endef
  59. define Package/knot-host
  60. $(call Package/knot/Default)
  61. TITLE+= simple DNS lookup utility
  62. DEPENDS=+knot-libdnssec +knot-libknot
  63. endef
  64. define Package/knot-nsupdate
  65. $(call Package/knot/Default)
  66. TITLE+= dynamic DNS update utility
  67. DEPENDS=+knot-libdnssec +knot-libknot +knot-libzscanner
  68. endef
  69. define Package/knot-nsec3hash
  70. $(call Package/knot/Default)
  71. TITLE+= simple NSEC3 hash utility
  72. DEPENDS=+knot-libdnssec
  73. endef
  74. define Package/knot-zonecheck
  75. $(call Package/knot/Default)
  76. TITLE+= zonefile check utility
  77. DEPENDS=+liburcu +knot-libdnssec +knot-libknot +knot-libzscanner
  78. endef
  79. define Package/knot-keymgr
  80. $(call Package/knot/Default)
  81. TITLE+= DNSSEC key management utility
  82. DEPENDS=+liburcu +knot-libdnssec +knot-libknot +knot-libzscanner
  83. endef
  84. define Package/knot-tests
  85. $(call Package/knot/Default)
  86. TITLE+= tests
  87. DEPENDS=+liburcu +libedit +knot-libdnssec +knot-libknot +knot-libzscanner
  88. endef
  89. define Package/knot-libdnssec/description
  90. Knot DNS DNSSEC library.
  91. endef
  92. define Package/knot-libknot/description
  93. Knot DNS library.
  94. endef
  95. define Package/knot-libdnssec/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-nsec3hash/description
  111. Knot DNS simple NSEC3 hash utility.
  112. endef
  113. define Package/knot-zonecheck/description
  114. Knot DNS zonefile check utility.
  115. endef
  116. define Package/knot-keymgr/description
  117. Knot DNS DNSSEC key management utility.
  118. endef
  119. define Package/knot-tests/description
  120. Unit tests for the Knot DNS server and libraries.
  121. Usage: /usr/share/knot/runtests.sh
  122. endef
  123. CONFIGURE_ARGS += \
  124. --enable-recvmmsg=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-timer-mapsize=50 \
  131. --with-conf-mapsize=50
  132. TARGET_CFLAGS += -DPSELECT_COMPAT -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)/libtap check
  139. $(MAKE) -C $(PKG_BUILD_DIR)/src/dnssec/tests check-compile
  140. $(MAKE) -C $(PKG_BUILD_DIR)/tests check-compile
  141. $(MAKE) -C $(PKG_BUILD_DIR)/src/zscanner check-compile
  142. endef
  143. define Build/InstallDev
  144. $(INSTALL_DIR) $(1)/usr/lib
  145. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} $(1)/usr/lib/
  146. $(INSTALL_DIR) $(1)/usr/include/libknot
  147. $(CP) $(PKG_INSTALL_DIR)/usr/include/libknot/* $(1)/usr/include/libknot/
  148. $(INSTALL_DIR) $(1)/usr/include/dnssec
  149. $(CP) $(PKG_INSTALL_DIR)/usr/include/dnssec/* $(1)/usr/include/dnssec/
  150. $(INSTALL_DIR) $(1)/usr/include/zscanner
  151. $(CP) $(PKG_INSTALL_DIR)/usr/include/zscanner/* $(1)/usr/include/zscanner/
  152. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  153. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
  154. endef
  155. define Package/knot-libdnssec/install
  156. $(INSTALL_DIR) $(1)/usr/lib
  157. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnssec.so.* $(1)/usr/lib/
  158. endef
  159. define Package/knot-libknot/install
  160. $(INSTALL_DIR) $(1)/usr/lib
  161. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libknot.so.* $(1)/usr/lib/
  162. endef
  163. define Package/knot-libzscanner/install
  164. $(INSTALL_DIR) $(1)/usr/lib
  165. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzscanner.so.* $(1)/usr/lib/
  166. endef
  167. define Package/knot/install
  168. $(INSTALL_DIR) $(1)/usr/bin
  169. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotc $(1)/usr/bin/
  170. $(INSTALL_DIR) $(1)/usr/sbin
  171. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotd $(1)/usr/sbin/
  172. $(INSTALL_DIR) $(1)/etc/knot
  173. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knot/knot.sample.conf $(1)/etc/knot/knot.conf
  174. $(INSTALL_DIR) $(1)/etc/init.d
  175. $(INSTALL_BIN) ./files/knotd.init $(1)/etc/init.d/knotd
  176. endef
  177. define Package/knot-dig/install
  178. $(INSTALL_DIR) $(1)/usr/bin
  179. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdig $(1)/usr/bin/
  180. endef
  181. define Package/knot-host/install
  182. $(INSTALL_DIR) $(1)/usr/bin
  183. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/khost $(1)/usr/bin/
  184. endef
  185. define Package/knot-nsupdate/install
  186. $(INSTALL_DIR) $(1)/usr/bin
  187. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate $(1)/usr/bin/
  188. endef
  189. define Package/knot-nsec3hash/install
  190. $(INSTALL_DIR) $(1)/usr/bin
  191. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsec3hash $(1)/usr/bin/
  192. endef
  193. define Package/knot-zonecheck/install
  194. $(INSTALL_DIR) $(1)/usr/bin
  195. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kzonecheck $(1)/usr/bin/
  196. endef
  197. define Package/knot-keymgr/install
  198. $(INSTALL_DIR) $(1)/usr/bin
  199. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keymgr $(1)/usr/bin/
  200. endef
  201. define Package/knot-tests/install
  202. $(INSTALL_DIR) $(1)/usr/share/knot
  203. $(INSTALL_BIN) ./files/runtests.sh $(1)/usr/share/knot/
  204. $(INSTALL_DIR) $(1)/usr/share/knot/tap
  205. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/runtests $(1)/usr/share/knot/tap/
  206. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/tap/libtap.sh $(1)/usr/share/knot/tap/
  207. $(INSTALL_DIR) $(1)/usr/share/knot/tests
  208. find $(PKG_BUILD_DIR)/tests/.libs -maxdepth 1 -executable -type f | \
  209. xargs -I{} basename {} | \
  210. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/.libs/{} $(1)/usr/share/knot/tests/test_{}
  211. $(INSTALL_DIR) $(1)/usr/share/knot/tests/dnssec
  212. find $(PKG_BUILD_DIR)/src/dnssec/tests -maxdepth 1 -executable -type f | \
  213. xargs -I{} basename {} | \
  214. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/src/dnssec/tests/{} $(1)/usr/share/knot/tests/dnssec/test_{}
  215. $(INSTALL_DIR) $(1)/usr/share/knot/tests/contrib
  216. find $(PKG_BUILD_DIR)/tests/contrib/.libs -maxdepth 1 -executable -type f | \
  217. xargs -I{} basename {} | \
  218. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/contrib/.libs/{} $(1)/usr/share/knot/tests/contrib/{}
  219. $(INSTALL_DIR) $(1)/usr/share/knot/tests/libknot
  220. find $(PKG_BUILD_DIR)/tests/libknot/.libs -maxdepth 1 -executable -type f | \
  221. xargs -I{} basename {} | \
  222. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/libknot/.libs/{} $(1)/usr/share/knot/tests/libknot/{}
  223. $(INSTALL_DIR) $(1)/usr/share/knot/tests/modules
  224. find $(PKG_BUILD_DIR)/tests/modules/.libs -maxdepth 1 -executable -type f | \
  225. xargs -I{} basename {} | \
  226. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/modules/.libs/{} $(1)/usr/share/knot/tests/modules/test_{}
  227. $(INSTALL_DIR) $(1)/usr/share/knot/tests/utils
  228. find $(PKG_BUILD_DIR)/tests/utils/.libs -maxdepth 1 -executable -type f | \
  229. xargs -I{} basename {} | \
  230. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/utils/.libs/{} $(1)/usr/share/knot/tests/utils/{}
  231. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/.libs/zscanner-tool $(1)/usr/share/knot/tests/
  232. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/unittests $(1)/usr/share/knot/tests/test_zscanner
  233. $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/zscanner/tests/TESTS $(1)/usr/share/knot/tests/
  234. cp -a $(PKG_BUILD_DIR)/src/zscanner/tests/data $(1)/usr/share/knot/tests/
  235. endef
  236. $(eval $(call BuildPackage,knot-libdnssec))
  237. $(eval $(call BuildPackage,knot-libknot))
  238. $(eval $(call BuildPackage,knot-libzscanner))
  239. $(eval $(call BuildPackage,knot))
  240. $(eval $(call BuildPackage,knot-dig))
  241. $(eval $(call BuildPackage,knot-host))
  242. $(eval $(call BuildPackage,knot-nsupdate))
  243. $(eval $(call BuildPackage,knot-nsec3hash))
  244. $(eval $(call BuildPackage,knot-zonecheck))
  245. $(eval $(call BuildPackage,knot-keymgr))
  246. $(eval $(call BuildPackage,knot-tests))