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.

249 lines
5.6 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.5.16
  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.5
  14. PKG_HASH:=0924dec90c37c05f49fec966eba3672dab4d336d879e5c06e06e13325cbfec25
  15. #PKG_FIXUP:=autoreconf gettext-version
  16. PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
  17. PKG_LICENSE:=LGPLv2.1+
  18. PKG_CPE_ID:=cpe:/a:gnu:gnutls
  19. PKG_INSTALL:=1
  20. PKG_LIBTOOL_PATHS:=. lib
  21. PKG_CHECK_FORMAT_SECURITY:=0
  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_OPENPGP \
  31. CONFIG_GNUTLS_PKCS11 \
  32. CONFIG_GNUTLS_PSK \
  33. CONFIG_GNUTLS_SRP \
  34. CONFIG_GNUTLS_TPM \
  35. CONFIG_LIBNETTLE_MINI \
  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
  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
  84. endef
  85. define Package/libgnutls/description
  86. $(call Package/gnutls/Default/description)
  87. This package contains the GnuTLS shared library, needed by other programs.
  88. endef
  89. CONFIGURE_ARGS+= \
  90. --enable-shared \
  91. --enable-static \
  92. --disable-rpath \
  93. --disable-libdane \
  94. --with-included-unistring \
  95. --disable-guile \
  96. --disable-nls \
  97. --without-idn \
  98. --without-zlib \
  99. --enable-local-libopts \
  100. --disable-doc \
  101. --disable-tests \
  102. --with-default-trust-store-dir=/etc/ssl/certs/ \
  103. --disable-crywrap \
  104. --with-librt-prefix="$(LIBRT_ROOT_DIR)/"
  105. ifneq ($(CONFIG_GNUTLS_EXT_LIBTASN1),y)
  106. CONFIGURE_ARGS += --with-included-libtasn1
  107. endif
  108. ifneq ($(CONFIG_GNUTLS_PKCS11),y)
  109. CONFIGURE_ARGS += --without-p11-kit
  110. endif
  111. ifeq ($(CONFIG_LIBNETTLE_MINI),y)
  112. CONFIGURE_ARGS += --with-nettle-mini
  113. endif
  114. ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
  115. CONFIGURE_ARGS += --disable-dtls-srtp-support
  116. endif
  117. ifneq ($(CONFIG_GNUTLS_ALPN),y)
  118. CONFIGURE_ARGS += --disable-alpn-support
  119. endif
  120. ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
  121. CONFIGURE_ARGS += --disable-heartbeat-support
  122. endif
  123. ifneq ($(CONFIG_GNUTLS_SRP),y)
  124. CONFIGURE_ARGS += --disable-srp-authentication
  125. endif
  126. ifneq ($(CONFIG_GNUTLS_PSK),y)
  127. CONFIGURE_ARGS += --disable-psk-authentication
  128. endif
  129. ifneq ($(CONFIG_GNUTLS_OPENPGP),y)
  130. CONFIGURE_ARGS += --disable-openpgp-authentication
  131. endif
  132. ifneq ($(CONFIG_GNUTLS_ANON),y)
  133. CONFIGURE_ARGS += --disable-anon-authentication
  134. endif
  135. ifneq ($(CONFIG_GNUTLS_OCSP),y)
  136. CONFIGURE_ARGS += --disable-ocsp
  137. endif
  138. ifneq ($(CONFIG_GNUTLS_TPM),y)
  139. CONFIGURE_ARGS += --without-tpm
  140. endif
  141. ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
  142. CONFIGURE_ARGS += --enable-cryptodev
  143. endif
  144. TARGET_CFLAGS += $(FPIC)
  145. define Build/InstallDev
  146. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
  147. $(CP) \
  148. $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so* \
  149. $(1)/usr/lib/
  150. $(CP) \
  151. $(PKG_INSTALL_DIR)/usr/include/gnutls \
  152. $(1)/usr/include/
  153. $(CP) \
  154. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls.pc \
  155. $(1)/usr/lib/pkgconfig/
  156. endef
  157. define Package/certtool/conffiles
  158. /etc/gnutls/certtool.cfg
  159. endef
  160. define Package/certtool/install
  161. $(INSTALL_DIR) $(1)/etc/gnutls
  162. $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
  163. $(INSTALL_DIR) $(1)/usr/bin
  164. $(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
  165. endef
  166. define Package/gnutls-utils/install
  167. $(INSTALL_DIR) $(1)/usr/bin
  168. ifeq ($(CONFIG_GNUTLS_OCSP),y)
  169. ifeq ($(CONFIG_GNUTLS_ANON),y)
  170. $(CP) \
  171. $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} \
  172. $(1)/usr/bin/
  173. endif
  174. $(CP) \
  175. $(PKG_INSTALL_DIR)/usr/bin/ocsptool \
  176. $(1)/usr/bin/
  177. endif
  178. ifeq ($(CONFIG_GNUTLS_SRP),y)
  179. $(CP) \
  180. $(PKG_INSTALL_DIR)/usr/bin/srptool \
  181. $(1)/usr/bin/
  182. endif
  183. ifeq ($(CONFIG_GNUTLS_PSK),y)
  184. $(CP) \
  185. $(PKG_INSTALL_DIR)/usr/bin/psktool \
  186. $(1)/usr/bin/
  187. endif
  188. ifeq ($(CONFIG_GNUTLS_PKCS11),y)
  189. $(CP) \
  190. $(PKG_INSTALL_DIR)/usr/bin/p11tool \
  191. $(1)/usr/bin/
  192. endif
  193. ifeq ($(CONFIG_GNUTLS_TPM),y)
  194. $(CP) \
  195. $(PKG_INSTALL_DIR)/usr/bin/tpmtool \
  196. $(1)/usr/bin/
  197. endif
  198. endef
  199. define Package/libgnutls/install
  200. $(INSTALL_DIR) $(1)/usr/lib
  201. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
  202. endef
  203. $(eval $(call BuildPackage,certtool))
  204. $(eval $(call BuildPackage,gnutls-utils))
  205. $(eval $(call BuildPackage,libgnutls))