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.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.6.7
  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.6
  14. PKG_HASH:=5b3409ad5aaf239808730d1ee12fdcd148c0be00262c7edf157af655a8a188e2
  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_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. 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 +libatomic
  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-doc \
  92. --disable-gcc-warnings \
  93. --disable-guile \
  94. --disable-rpath \
  95. --disable-seccomp-tests \
  96. --disable-tests \
  97. --disable-valgrind-tests \
  98. \
  99. --disable-libdane \
  100. --disable-ssl2-support \
  101. --disable-ssl3-support \
  102. --enable-local-libopts \
  103. --without-idn \
  104. --with-default-trust-store-dir=/etc/ssl/certs/ \
  105. --with-included-unistring \
  106. --with-librt-prefix="$(LIBRT_ROOT_DIR)/" \
  107. --with-pic
  108. ifneq ($(CONFIG_GNUTLS_EXT_LIBTASN1),y)
  109. CONFIGURE_ARGS += --with-included-libtasn1
  110. endif
  111. ifneq ($(CONFIG_GNUTLS_PKCS11),y)
  112. CONFIGURE_ARGS += --without-p11-kit
  113. endif
  114. ifeq ($(CONFIG_LIBNETTLE_MINI),y)
  115. CONFIGURE_ARGS += --with-nettle-mini
  116. endif
  117. ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
  118. CONFIGURE_ARGS += --disable-dtls-srtp-support
  119. endif
  120. ifneq ($(CONFIG_GNUTLS_ALPN),y)
  121. CONFIGURE_ARGS += --disable-alpn-support
  122. endif
  123. ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
  124. CONFIGURE_ARGS += --disable-heartbeat-support
  125. endif
  126. ifneq ($(CONFIG_GNUTLS_SRP),y)
  127. CONFIGURE_ARGS += --disable-srp-authentication
  128. endif
  129. ifneq ($(CONFIG_GNUTLS_PSK),y)
  130. CONFIGURE_ARGS += --disable-psk-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. define Build/InstallDev
  145. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
  146. $(CP) \
  147. $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so* \
  148. $(1)/usr/lib/
  149. $(CP) \
  150. $(PKG_INSTALL_DIR)/usr/include/gnutls \
  151. $(1)/usr/include/
  152. $(CP) \
  153. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls.pc \
  154. $(1)/usr/lib/pkgconfig/
  155. endef
  156. define Package/certtool/conffiles
  157. /etc/gnutls/certtool.cfg
  158. endef
  159. define Package/certtool/install
  160. $(INSTALL_DIR) $(1)/etc/gnutls
  161. $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
  162. $(INSTALL_DIR) $(1)/usr/bin
  163. $(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
  164. endef
  165. define Package/gnutls-utils/install
  166. $(INSTALL_DIR) $(1)/usr/bin
  167. ifeq ($(CONFIG_GNUTLS_OCSP),y)
  168. ifeq ($(CONFIG_GNUTLS_ANON),y)
  169. $(CP) \
  170. $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} \
  171. $(1)/usr/bin/
  172. endif
  173. $(CP) \
  174. $(PKG_INSTALL_DIR)/usr/bin/ocsptool \
  175. $(1)/usr/bin/
  176. endif
  177. ifeq ($(CONFIG_GNUTLS_SRP),y)
  178. $(CP) \
  179. $(PKG_INSTALL_DIR)/usr/bin/srptool \
  180. $(1)/usr/bin/
  181. endif
  182. ifeq ($(CONFIG_GNUTLS_PSK),y)
  183. $(CP) \
  184. $(PKG_INSTALL_DIR)/usr/bin/psktool \
  185. $(1)/usr/bin/
  186. endif
  187. ifeq ($(CONFIG_GNUTLS_PKCS11),y)
  188. $(CP) \
  189. $(PKG_INSTALL_DIR)/usr/bin/p11tool \
  190. $(1)/usr/bin/
  191. endif
  192. ifeq ($(CONFIG_GNUTLS_TPM),y)
  193. $(CP) \
  194. $(PKG_INSTALL_DIR)/usr/bin/tpmtool \
  195. $(1)/usr/bin/
  196. endif
  197. endef
  198. define Package/libgnutls/install
  199. $(INSTALL_DIR) $(1)/usr/lib
  200. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
  201. endef
  202. $(eval $(call BuildPackage,certtool))
  203. $(eval $(call BuildPackage,gnutls-utils))
  204. $(eval $(call BuildPackage,libgnutls))