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.

269 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.1.1
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  13. PKG_SOURCE_URL:=https://secure.nic.cz/files/knot-dns/
  14. PKG_MD5SUM:=ee6a54ec8a7898579b768c66e2eaeb54
  15. PKG_MAINTAINER:=Daniel Salzman <daniel.salzman@nic.cz>
  16. PKG_LICENSE:=GPL-3.0 LGPL-2.0 0BSD MIT OLDAP-2.8
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
  18. PKG_FIXUP:=autoreconf
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/knot-lib/Default
  22. SECTION:=libs
  23. CATEGORY:=Libraries
  24. TITLE:=Knot DNS
  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. URL:=https://www.knot-dns.cz
  33. USERID:=knot=5353:knot=5353
  34. endef
  35. define Package/knot-libdnssec
  36. $(call Package/knot-lib/Default)
  37. TITLE+= DNSSEC library
  38. DEPENDS=+libpthread +libgnutls +jansson
  39. endef
  40. define Package/knot-libknot
  41. $(call Package/knot-lib/Default)
  42. TITLE+= library
  43. DEPENDS=+libpthread +knot-libdnssec
  44. endef
  45. define Package/knot-libzscanner
  46. $(call Package/knot-lib/Default)
  47. TITLE+= zone parser library
  48. DEPENDS=+libpthread
  49. endef
  50. define Package/knot
  51. $(call Package/knot/Default)
  52. TITLE+= server
  53. DEPENDS=+liburcu +knot-libdnssec +knot-libknot +knot-libzscanner
  54. endef
  55. define Package/knot-dig
  56. $(call Package/knot/Default)
  57. TITLE+= advanced DNS lookup utility
  58. DEPENDS=+knot-libdnssec +knot-libknot
  59. endef
  60. define Package/knot-host
  61. $(call Package/knot/Default)
  62. TITLE+= simple DNS lookup utility
  63. DEPENDS=+knot-libdnssec +knot-libknot
  64. endef
  65. define Package/knot-nsupdate
  66. $(call Package/knot/Default)
  67. TITLE+= dynamic DNS update utility
  68. DEPENDS=+knot-libdnssec +knot-libknot +knot-libzscanner
  69. endef
  70. define Package/knot-nsec3hash
  71. $(call Package/knot/Default)
  72. TITLE+= simple NSEC3 hash utility
  73. DEPENDS=+knot-libdnssec
  74. endef
  75. define Package/knot-keymgr
  76. $(call Package/knot/Default)
  77. TITLE+= DNSSEC key management utility
  78. DEPENDS=+knot-libdnssec +knot-libzscanner
  79. endef
  80. define Package/knot-tests
  81. $(call Package/knot/Default)
  82. TITLE+= tests
  83. DEPENDS=+liburcu +knot-libdnssec +knot-libknot +knot-libzscanner
  84. endef
  85. define Package/knot-libdnssec/description
  86. Knot DNS DNSSEC library.
  87. endef
  88. define Package/knot-libknot/description
  89. Knot DNS library.
  90. endef
  91. define Package/knot-libdnssec/description
  92. Knot DNS zone parser library.
  93. endef
  94. define Package/knot/description
  95. High-performance authoritative-only DNS server.
  96. endef
  97. define Package/knot-dig/description
  98. Knot DNS advanced DNS lookup utility.
  99. endef
  100. define Package/knot-host/description
  101. Knot DNS simple DNS lookup utility.
  102. endef
  103. define Package/knot-nsupdate/description
  104. Knot DNS dynamic DNS update utility.
  105. endef
  106. define Package/knot-nsec3hash/description
  107. Knot DNS simple NSEC3 hash utility.
  108. endef
  109. define Package/knot-keymgr/description
  110. Knot DNS DNSSEC key management utility.
  111. endef
  112. define Package/knot-tests/description
  113. Unit tests for the Knot DNS server and libraries.
  114. Usage: /usr/share/knot/runtests.sh
  115. endef
  116. CONFIGURE_ARGS += \
  117. --enable-recvmmsg=no \
  118. --disable-fastparser \
  119. --without-libidn \
  120. --with-rundir=/var/run/knot \
  121. --with-storage=/var/lib/knot \
  122. --with-configdir=/etc/knot \
  123. --with-timer-mapsize=50 \
  124. --with-conf-mapsize=50
  125. TARGET_CFLAGS += -DPSELECT_COMPAT -DNDEBUG
  126. define Package/knot/conffiles
  127. /etc/knot/knot.conf
  128. endef
  129. define Build/Compile
  130. $(MAKE) -C $(PKG_BUILD_DIR)
  131. $(MAKE) -C $(PKG_BUILD_DIR)/libtap check
  132. $(MAKE) -C $(PKG_BUILD_DIR)/src/dnssec/tests check-compile-only
  133. $(MAKE) -C $(PKG_BUILD_DIR)/tests check-compile-only
  134. $(MAKE) -C $(PKG_BUILD_DIR)/src/zscanner check-compile-only
  135. endef
  136. define Build/InstallDev
  137. $(INSTALL_DIR) $(1)/usr/lib
  138. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} $(1)/usr/lib/
  139. $(INSTALL_DIR) $(1)/usr/include/libknot
  140. $(CP) $(PKG_INSTALL_DIR)/usr/include/libknot/* $(1)/usr/include/libknot/
  141. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  142. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
  143. endef
  144. define Package/knot-libdnssec/install
  145. $(INSTALL_DIR) $(1)/usr/lib
  146. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnssec.so.* $(1)/usr/lib/
  147. endef
  148. define Package/knot-libknot/install
  149. $(INSTALL_DIR) $(1)/usr/lib
  150. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libknot.so.* $(1)/usr/lib/
  151. endef
  152. define Package/knot-libzscanner/install
  153. $(INSTALL_DIR) $(1)/usr/lib
  154. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzscanner.so.* $(1)/usr/lib/
  155. endef
  156. define Package/knot/install
  157. $(INSTALL_DIR) $(1)/usr/sbin
  158. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotc $(1)/usr/sbin/
  159. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotd $(1)/usr/sbin/
  160. $(INSTALL_DIR) $(1)/etc/knot
  161. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knot/knot.sample.conf $(1)/etc/knot/knot.conf
  162. $(INSTALL_DIR) $(1)/etc/init.d
  163. $(INSTALL_BIN) ./files/knotd.init $(1)/etc/init.d/knotd
  164. endef
  165. define Package/knot-dig/install
  166. $(INSTALL_DIR) $(1)/usr/bin
  167. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdig $(1)/usr/bin/
  168. endef
  169. define Package/knot-host/install
  170. $(INSTALL_DIR) $(1)/usr/bin
  171. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/khost $(1)/usr/bin/
  172. endef
  173. define Package/knot-nsupdate/install
  174. $(INSTALL_DIR) $(1)/usr/bin
  175. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate $(1)/usr/bin/
  176. endef
  177. define Package/knot-nsec3hash/install
  178. $(INSTALL_DIR) $(1)/usr/bin
  179. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsec3hash $(1)/usr/bin/
  180. endef
  181. define Package/knot-keymgr/install
  182. $(INSTALL_DIR) $(1)/usr/sbin
  183. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keymgr $(1)/usr/sbin/
  184. endef
  185. define Package/knot-tests/install
  186. $(INSTALL_DIR) $(1)/usr/share/knot
  187. $(INSTALL_BIN) ./files/runtests.sh $(1)/usr/share/knot/
  188. $(INSTALL_DIR) $(1)/usr/share/knot/tap
  189. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/runtests $(1)/usr/share/knot/tap/
  190. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/tap/libtap.sh $(1)/usr/share/knot/tap/
  191. $(INSTALL_DIR) $(1)/usr/share/knot/tests
  192. find $(PKG_BUILD_DIR)/src/dnssec/tests -maxdepth 1 -executable -type f | \
  193. xargs -I{} basename {} | \
  194. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/src/dnssec/tests/{} $(1)/usr/share/knot/tests/dnssec_test_{}
  195. find $(PKG_BUILD_DIR)/tests/.libs -maxdepth 1 -executable -type f | \
  196. xargs -I{} basename {} | \
  197. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/.libs/{} $(1)/usr/share/knot/tests/test_{}
  198. find $(PKG_BUILD_DIR)/tests/modules/.libs -maxdepth 1 -executable -type f | \
  199. xargs -I{} basename {} | \
  200. xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/modules/.libs/{} $(1)/usr/share/knot/tests/test_module_{}
  201. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/.libs/zscanner-tool $(1)/usr/share/knot/tests/
  202. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/unittests $(1)/usr/share/knot/tests/test_zscanner
  203. $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/zscanner/tests/TESTS $(1)/usr/share/knot/tests/
  204. cp -a $(PKG_BUILD_DIR)/src/zscanner/tests/data $(1)/usr/share/knot/tests/
  205. endef
  206. $(eval $(call BuildPackage,knot-libdnssec))
  207. $(eval $(call BuildPackage,knot-libknot))
  208. $(eval $(call BuildPackage,knot-libzscanner))
  209. $(eval $(call BuildPackage,knot))
  210. $(eval $(call BuildPackage,knot-dig))
  211. $(eval $(call BuildPackage,knot-host))
  212. $(eval $(call BuildPackage,knot-nsupdate))
  213. $(eval $(call BuildPackage,knot-nsec3hash))
  214. $(eval $(call BuildPackage,knot-keymgr))
  215. $(eval $(call BuildPackage,knot-tests))