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.

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