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.

265 lines
6.3 KiB

  1. #
  2. # Copyright (C) 2005-2016 OpenWrt.org
  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:=gnutls
  9. PKG_VERSION:=3.7.1
  10. PKG_RELEASE:=1
  11. PKG_USE_MIPS16:=0
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_SOURCE_URL:=https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7
  14. PKG_HASH:=3777d7963eca5e06eb315686163b7b3f5045e2baac5e54e038ace9835e5cac6f
  15. PKG_FIXUP:=autoreconf gettext-version
  16. PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
  17. PKG_LICENSE:=LGPL-2.1-or-later
  18. PKG_CPE_ID:=cpe:/a:gnu:gnutls
  19. PKG_INSTALL:=1
  20. PKG_BUILD_PARALLEL:=1
  21. PKG_LIBTOOL_PATHS:=. lib
  22. PKG_CONFIG_DEPENDS:= \
  23. CONFIG_GNUTLS_ALPN \
  24. CONFIG_GNUTLS_ANON \
  25. CONFIG_GNUTLS_CRYPTODEV \
  26. CONFIG_GNUTLS_DTLS_SRTP \
  27. CONFIG_GNUTLS_EXT_LIBTASN1 \
  28. CONFIG_GNUTLS_HEARTBEAT \
  29. CONFIG_GNUTLS_OCSP \
  30. CONFIG_GNUTLS_PKCS11 \
  31. CONFIG_GNUTLS_PSK \
  32. CONFIG_GNUTLS_SRP \
  33. CONFIG_GNUTLS_TPM \
  34. CONFIG_LIBNETTLE_MINI \
  35. CONFIG_PACKAGE_libgnutls-dane \
  36. include $(INCLUDE_DIR)/package.mk
  37. define Package/gnutls/Default
  38. SUBMENU:=SSL
  39. SECTION:=libs
  40. CATEGORY:=Libraries
  41. TITLE:=GNU TLS
  42. URL:=http://www.gnutls.org/
  43. endef
  44. define Package/gnutls/Default/description
  45. GnuTLS is a secure communications library implementing the SSL, TLS
  46. and DTLS protocols and technologies around them. It provides a simple
  47. C language application programming interface (API) to access the secure
  48. communications protocols as well as APIs to parse and write X.509, PKCS12,
  49. OpenPGP and other required structures. It is aimed to be portable and
  50. efficient with focus on security and interoperability.
  51. endef
  52. define Package/certtool
  53. $(call Package/gnutls/Default)
  54. SECTION:=utils
  55. CATEGORY:=Utilities
  56. SUBMENU:=Encryption
  57. TITLE+= (certool utility)
  58. DEPENDS+= +libgnutls
  59. endef
  60. define Package/certtool/description
  61. $(call Package/gnutls/Default/description)
  62. This package contains the GnuTLS certtool utility.
  63. endef
  64. define Package/gnutls-utils
  65. $(call Package/gnutls/Default)
  66. SECTION:=utils
  67. CATEGORY:=Utilities
  68. SUBMENU:=Encryption
  69. TITLE+= (utilities)
  70. DEPENDS+= +libgnutls +PACKAGE_libgnutls-dane:libgnutls-dane
  71. endef
  72. define Package/gnutls-utils/description
  73. $(call Package/gnutls/Default/description)
  74. This package contains the GnuTLS gnutls-cli, gnutls-serv, psktool,
  75. and srptool utilities.
  76. endef
  77. define Package/libgnutls/config
  78. source "$(SOURCE)/Config.in"
  79. endef
  80. define Package/libgnutls
  81. $(call Package/gnutls/Default)
  82. TITLE+= (library)
  83. DEPENDS+= +libnettle +!LIBNETTLE_MINI:libgmp +GNUTLS_EXT_LIBTASN1:libtasn1 +GNUTLS_PKCS11:p11-kit +GNUTLS_CRYPTODEV:kmod-cryptodev +libatomic
  84. endef
  85. define Package/libgnutls-dane
  86. $(call Package/gnutls/Default)
  87. TITLE+= (libgnutls-dane library)
  88. DEPENDS:= +libgnutls +libunbound
  89. endef
  90. define Package/libgnutls/description
  91. $(call Package/gnutls/Default/description)
  92. This package contains the GnuTLS shared library, needed by other programs.
  93. endef
  94. # We disable the configuration file (system-priority-file) because
  95. # the use of configuration increases the non-shared memory used by
  96. # the library and we don't provide an openwrt-specific configuration
  97. # anyway.
  98. CONFIGURE_ARGS+= \
  99. --enable-shared \
  100. --enable-static \
  101. --disable-doc \
  102. --disable-gcc-warnings \
  103. --disable-guile \
  104. --disable-rpath \
  105. --disable-seccomp-tests \
  106. --disable-tests \
  107. --disable-valgrind-tests \
  108. --disable-ssl2-support \
  109. --disable-ssl3-support \
  110. --enable-local-libopts \
  111. --without-idn \
  112. --with-default-trust-store-dir=/etc/ssl/certs/ \
  113. --with-included-unistring \
  114. --with-librt-prefix="$(LIBRT_ROOT_DIR)/" \
  115. --with-pic \
  116. --with-system-priority-file=""
  117. ifneq ($(CONFIG_GNUTLS_EXT_LIBTASN1),y)
  118. CONFIGURE_ARGS += --with-included-libtasn1
  119. endif
  120. ifneq ($(CONFIG_GNUTLS_PKCS11),y)
  121. CONFIGURE_ARGS += --without-p11-kit
  122. endif
  123. ifeq ($(CONFIG_LIBNETTLE_MINI),y)
  124. CONFIGURE_ARGS += --with-nettle-mini
  125. endif
  126. ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
  127. CONFIGURE_ARGS += --disable-dtls-srtp-support
  128. endif
  129. ifneq ($(CONFIG_GNUTLS_ALPN),y)
  130. CONFIGURE_ARGS += --disable-alpn-support
  131. endif
  132. ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
  133. CONFIGURE_ARGS += --disable-heartbeat-support
  134. endif
  135. ifneq ($(CONFIG_GNUTLS_SRP),y)
  136. CONFIGURE_ARGS += --disable-srp-authentication
  137. endif
  138. ifneq ($(CONFIG_GNUTLS_PSK),y)
  139. CONFIGURE_ARGS += --disable-psk-authentication
  140. endif
  141. ifneq ($(CONFIG_GNUTLS_ANON),y)
  142. CONFIGURE_ARGS += --disable-anon-authentication
  143. endif
  144. ifneq ($(CONFIG_GNUTLS_OCSP),y)
  145. CONFIGURE_ARGS += --disable-ocsp
  146. endif
  147. ifneq ($(CONFIG_GNUTLS_TPM),y)
  148. CONFIGURE_ARGS += --without-tpm
  149. endif
  150. ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
  151. CONFIGURE_ARGS += --enable-cryptodev
  152. endif
  153. ifeq ($(CONFIG_PACKAGE_libgnutls-dane),)
  154. CONFIGURE_ARGS += --disable-libdane
  155. endif
  156. define Build/InstallDev
  157. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
  158. $(CP) \
  159. $(PKG_INSTALL_DIR)/usr/lib/*.so* \
  160. $(1)/usr/lib/
  161. $(CP) \
  162. $(PKG_INSTALL_DIR)/usr/include/gnutls \
  163. $(1)/usr/include/
  164. $(CP) \
  165. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
  166. $(1)/usr/lib/pkgconfig/
  167. endef
  168. define Package/certtool/conffiles
  169. /etc/gnutls/certtool.cfg
  170. endef
  171. define Package/certtool/install
  172. $(INSTALL_DIR) $(1)/etc/gnutls
  173. $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
  174. $(INSTALL_DIR) $(1)/usr/bin
  175. $(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
  176. endef
  177. define Package/gnutls-utils/install
  178. $(INSTALL_DIR) $(1)/usr/bin
  179. ifeq ($(CONFIG_GNUTLS_OCSP),y)
  180. ifeq ($(CONFIG_GNUTLS_ANON),y)
  181. $(CP) \
  182. $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} \
  183. $(1)/usr/bin/
  184. endif
  185. $(CP) \
  186. $(PKG_INSTALL_DIR)/usr/bin/ocsptool \
  187. $(1)/usr/bin/
  188. endif
  189. ifeq ($(CONFIG_GNUTLS_SRP),y)
  190. $(CP) \
  191. $(PKG_INSTALL_DIR)/usr/bin/srptool \
  192. $(1)/usr/bin/
  193. endif
  194. ifeq ($(CONFIG_GNUTLS_PSK),y)
  195. $(CP) \
  196. $(PKG_INSTALL_DIR)/usr/bin/psktool \
  197. $(1)/usr/bin/
  198. endif
  199. ifeq ($(CONFIG_GNUTLS_PKCS11),y)
  200. $(CP) \
  201. $(PKG_INSTALL_DIR)/usr/bin/p11tool \
  202. $(1)/usr/bin/
  203. endif
  204. ifeq ($(CONFIG_GNUTLS_TPM),y)
  205. $(CP) \
  206. $(PKG_INSTALL_DIR)/usr/bin/tpmtool \
  207. $(1)/usr/bin/
  208. endif
  209. endef
  210. define Package/libgnutls/install
  211. $(INSTALL_DIR) $(1)/usr/lib
  212. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
  213. endef
  214. define Package/libgnutls-dane/install
  215. $(INSTALL_DIR) $(1)/usr/lib
  216. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-dane.so.* $(1)/usr/lib/
  217. endef
  218. $(eval $(call BuildPackage,certtool))
  219. $(eval $(call BuildPackage,gnutls-utils))
  220. $(eval $(call BuildPackage,libgnutls))
  221. $(eval $(call BuildPackage,libgnutls-dane))