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.

246 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:=3
  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. SUBMENU:=Encryption
  56. TITLE+= (certool utility)
  57. DEPENDS+= +libgnutls
  58. endef
  59. define Package/certtool/description
  60. $(call Package/gnutls/Default/description)
  61. This package contains the GnuTLS certtool utility.
  62. endef
  63. define Package/gnutls-utils
  64. $(call Package/gnutls/Default)
  65. SECTION:=utils
  66. CATEGORY:=Utilities
  67. SUBMENU:=Encryption
  68. TITLE+= (utilities)
  69. DEPENDS+= +libgnutls
  70. endef
  71. define Package/gnutls-utils/description
  72. $(call Package/gnutls/Default/description)
  73. This package contains the GnuTLS gnutls-cli, gnutls-serv, psktool,
  74. and srptool utilities.
  75. endef
  76. define Package/libgnutls/config
  77. source "$(SOURCE)/Config.in"
  78. endef
  79. define Package/libgnutls
  80. $(call Package/gnutls/Default)
  81. TITLE+= (library)
  82. DEPENDS+= +libnettle +!LIBNETTLE_MINI:libgmp +GNUTLS_EXT_LIBTASN1:libtasn1 +GNUTLS_PKCS11:p11-kit +GNUTLS_CRYPTODEV:kmod-cryptodev
  83. endef
  84. define Package/libgnutls/description
  85. $(call Package/gnutls/Default/description)
  86. This package contains the GnuTLS shared library, needed by other programs.
  87. endef
  88. CONFIGURE_ARGS+= \
  89. --enable-shared \
  90. --enable-static \
  91. --disable-rpath \
  92. --disable-libdane \
  93. --disable-guile \
  94. --disable-nls \
  95. --without-zlib \
  96. --enable-local-libopts \
  97. --disable-doc \
  98. --disable-tests \
  99. --with-default-trust-store-dir=/etc/ssl/certs/ \
  100. --disable-crywrap \
  101. --with-librt-prefix="$(LIBRT_ROOT_DIR)/"
  102. ifneq ($(CONFIG_GNUTLS_EXT_LIBTASN1),y)
  103. CONFIGURE_ARGS += --with-included-libtasn1
  104. endif
  105. ifneq ($(CONFIG_GNUTLS_PKCS11),y)
  106. CONFIGURE_ARGS += --without-p11-kit
  107. endif
  108. ifeq ($(CONFIG_LIBNETTLE_MINI),y)
  109. CONFIGURE_ARGS += --with-nettle-mini
  110. endif
  111. ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
  112. CONFIGURE_ARGS += --disable-dtls-srtp-support
  113. endif
  114. ifneq ($(CONFIG_GNUTLS_ALPN),y)
  115. CONFIGURE_ARGS += --disable-alpn-support
  116. endif
  117. ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
  118. CONFIGURE_ARGS += --disable-heartbeat-support
  119. endif
  120. ifneq ($(CONFIG_GNUTLS_SRP),y)
  121. CONFIGURE_ARGS += --disable-srp-authentication
  122. endif
  123. ifneq ($(CONFIG_GNUTLS_PSK),y)
  124. CONFIGURE_ARGS += --disable-psk-authentication
  125. endif
  126. ifneq ($(CONFIG_GNUTLS_OPENPGP),y)
  127. CONFIGURE_ARGS += --disable-openpgp-authentication
  128. endif
  129. ifneq ($(CONFIG_GNUTLS_ANON),y)
  130. CONFIGURE_ARGS += --disable-anon-authentication
  131. endif
  132. ifneq ($(CONFIG_GNUTLS_OCSP),y)
  133. CONFIGURE_ARGS += --disable-ocsp
  134. endif
  135. ifneq ($(CONFIG_GNUTLS_TPM),y)
  136. CONFIGURE_ARGS += --without-tpm
  137. endif
  138. ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
  139. CONFIGURE_ARGS += --enable-cryptodev
  140. endif
  141. TARGET_CFLAGS += $(FPIC)
  142. define Build/InstallDev
  143. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
  144. $(CP) \
  145. $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so* \
  146. $(1)/usr/lib/
  147. $(CP) \
  148. $(PKG_INSTALL_DIR)/usr/include/gnutls \
  149. $(1)/usr/include/
  150. $(CP) \
  151. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls.pc \
  152. $(1)/usr/lib/pkgconfig/
  153. endef
  154. define Package/certtool/conffiles
  155. /etc/gnutls/certtool.cfg
  156. endef
  157. define Package/certtool/install
  158. $(INSTALL_DIR) $(1)/etc/gnutls
  159. $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
  160. $(INSTALL_DIR) $(1)/usr/bin
  161. $(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
  162. endef
  163. define Package/gnutls-utils/install
  164. $(INSTALL_DIR) $(1)/usr/bin
  165. ifeq ($(CONFIG_GNUTLS_OCSP),y)
  166. ifeq ($(CONFIG_GNUTLS_ANON),y)
  167. $(CP) \
  168. $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} \
  169. $(1)/usr/bin/
  170. endif
  171. $(CP) \
  172. $(PKG_INSTALL_DIR)/usr/bin/ocsptool \
  173. $(1)/usr/bin/
  174. endif
  175. ifeq ($(CONFIG_GNUTLS_SRP),y)
  176. $(CP) \
  177. $(PKG_INSTALL_DIR)/usr/bin/srptool \
  178. $(1)/usr/bin/
  179. endif
  180. ifeq ($(CONFIG_GNUTLS_PSK),y)
  181. $(CP) \
  182. $(PKG_INSTALL_DIR)/usr/bin/psktool \
  183. $(1)/usr/bin/
  184. endif
  185. ifeq ($(CONFIG_GNUTLS_PKCS11),y)
  186. $(CP) \
  187. $(PKG_INSTALL_DIR)/usr/bin/p11tool \
  188. $(1)/usr/bin/
  189. endif
  190. ifeq ($(CONFIG_GNUTLS_TPM),y)
  191. $(CP) \
  192. $(PKG_INSTALL_DIR)/usr/bin/tpmtool \
  193. $(1)/usr/bin/
  194. endif
  195. endef
  196. define Package/libgnutls/install
  197. $(INSTALL_DIR) $(1)/usr/lib
  198. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
  199. endef
  200. $(eval $(call BuildPackage,certtool))
  201. $(eval $(call BuildPackage,gnutls-utils))
  202. $(eval $(call BuildPackage,libgnutls))