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.

268 lines
7.4 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.2.1
  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:=d573ecadedf4f15ec1f02671443520cb
  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-keymgr
  75. $(call Package/knot/Default)
  76. TITLE+= DNSSEC key management utility
  77. DEPENDS=+knot-libdnssec +knot-libzscanner
  78. endef
  79. define Package/knot-tests
  80. $(call Package/knot/Default)
  81. TITLE+= tests
  82. DEPENDS=+liburcu +knot-libdnssec +knot-libknot +knot-libzscanner
  83. endef
  84. define Package/knot-libdnssec/description
  85. Knot DNS DNSSEC library.
  86. endef
  87. define Package/knot-libknot/description
  88. Knot DNS library.
  89. endef
  90. define Package/knot-libdnssec/description
  91. Knot DNS zone parser library.
  92. endef
  93. define Package/knot/description
  94. High-performance authoritative-only DNS server.
  95. endef
  96. define Package/knot-dig/description
  97. Knot DNS advanced DNS lookup utility.
  98. endef
  99. define Package/knot-host/description
  100. Knot DNS simple DNS lookup utility.
  101. endef
  102. define Package/knot-nsupdate/description
  103. Knot DNS dynamic DNS update utility.
  104. endef
  105. define Package/knot-nsec3hash/description
  106. Knot DNS simple NSEC3 hash utility.
  107. endef
  108. define Package/knot-keymgr/description
  109. Knot DNS DNSSEC key management utility.
  110. endef
  111. define Package/knot-tests/description
  112. Unit tests for the Knot DNS server and libraries.
  113. Usage: /usr/share/knot/runtests.sh
  114. endef
  115. CONFIGURE_ARGS += \
  116. --enable-recvmmsg=no \
  117. --disable-fastparser \
  118. --without-libidn \
  119. --with-rundir=/var/run/knot \
  120. --with-storage=/var/lib/knot \
  121. --with-configdir=/etc/knot \
  122. --with-timer-mapsize=50 \
  123. --with-conf-mapsize=50
  124. TARGET_CFLAGS += -DPSELECT_COMPAT -DNDEBUG
  125. define Package/knot/conffiles
  126. /etc/knot/knot.conf
  127. endef
  128. define Build/Compile
  129. $(MAKE) -C $(PKG_BUILD_DIR)
  130. $(MAKE) -C $(PKG_BUILD_DIR)/libtap check
  131. $(MAKE) -C $(PKG_BUILD_DIR)/src/dnssec/tests check-compile
  132. $(MAKE) -C $(PKG_BUILD_DIR)/tests check-compile
  133. $(MAKE) -C $(PKG_BUILD_DIR)/src/zscanner check-compile
  134. endef
  135. define Build/InstallDev
  136. $(INSTALL_DIR) $(1)/usr/lib
  137. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} $(1)/usr/lib/
  138. $(INSTALL_DIR) $(1)/usr/include/libknot
  139. $(CP) $(PKG_INSTALL_DIR)/usr/include/libknot/* $(1)/usr/include/libknot/
  140. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  141. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
  142. endef
  143. define Package/knot-libdnssec/install
  144. $(INSTALL_DIR) $(1)/usr/lib
  145. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnssec.so.* $(1)/usr/lib/
  146. endef
  147. define Package/knot-libknot/install
  148. $(INSTALL_DIR) $(1)/usr/lib
  149. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libknot.so.* $(1)/usr/lib/
  150. endef
  151. define Package/knot-libzscanner/install
  152. $(INSTALL_DIR) $(1)/usr/lib
  153. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzscanner.so.* $(1)/usr/lib/
  154. endef
  155. define Package/knot/install
  156. $(INSTALL_DIR) $(1)/usr/sbin
  157. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotc $(1)/usr/sbin/
  158. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotd $(1)/usr/sbin/
  159. $(INSTALL_DIR) $(1)/etc/knot
  160. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knot/knot.sample.conf $(1)/etc/knot/knot.conf
  161. $(INSTALL_DIR) $(1)/etc/init.d
  162. $(INSTALL_BIN) ./files/knotd.init $(1)/etc/init.d/knotd
  163. endef
  164. define Package/knot-dig/install
  165. $(INSTALL_DIR) $(1)/usr/bin
  166. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdig $(1)/usr/bin/
  167. endef
  168. define Package/knot-host/install
  169. $(INSTALL_DIR) $(1)/usr/bin
  170. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/khost $(1)/usr/bin/
  171. endef
  172. define Package/knot-nsupdate/install
  173. $(INSTALL_DIR) $(1)/usr/bin
  174. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate $(1)/usr/bin/
  175. endef
  176. define Package/knot-nsec3hash/install
  177. $(INSTALL_DIR) $(1)/usr/bin
  178. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsec3hash $(1)/usr/bin/
  179. endef
  180. define Package/knot-keymgr/install
  181. $(INSTALL_DIR) $(1)/usr/sbin
  182. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keymgr $(1)/usr/sbin/
  183. endef
  184. define Package/knot-tests/install
  185. $(INSTALL_DIR) $(1)/usr/share/knot
  186. $(INSTALL_BIN) ./files/runtests.sh $(1)/usr/share/knot/
  187. $(INSTALL_DIR) $(1)/usr/share/knot/tap
  188. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/runtests $(1)/usr/share/knot/tap/
  189. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/tap/libtap.sh $(1)/usr/share/knot/tap/
  190. $(INSTALL_DIR) $(1)/usr/share/knot/tests
  191. find $(PKG_BUILD_DIR)/src/dnssec/tests -maxdepth 1 -executable -type f | \
  192. xargs -I{} basename {} | \
  193. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/src/dnssec/tests/{} $(1)/usr/share/knot/tests/dnssec_test_{}
  194. find $(PKG_BUILD_DIR)/tests/.libs -maxdepth 1 -executable -type f | \
  195. xargs -I{} basename {} | \
  196. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/.libs/{} $(1)/usr/share/knot/tests/test_{}
  197. find $(PKG_BUILD_DIR)/tests/modules/.libs -maxdepth 1 -executable -type f | \
  198. xargs -I{} basename {} | \
  199. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/modules/.libs/{} $(1)/usr/share/knot/tests/test_module_{}
  200. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/.libs/zscanner-tool $(1)/usr/share/knot/tests/
  201. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/unittests $(1)/usr/share/knot/tests/test_zscanner
  202. $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/zscanner/tests/TESTS $(1)/usr/share/knot/tests/
  203. cp -a $(PKG_BUILD_DIR)/src/zscanner/tests/data $(1)/usr/share/knot/tests/
  204. endef
  205. $(eval $(call BuildPackage,knot-libdnssec))
  206. $(eval $(call BuildPackage,knot-libknot))
  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-nsec3hash))
  213. $(eval $(call BuildPackage,knot-keymgr))
  214. $(eval $(call BuildPackage,knot-tests))