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.

247 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.8
  10. PKG_RELEASE:=1
  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:=113e892e51acdb11b81804cd355adfee
  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. --with-included-unistring \
  94. --disable-guile \
  95. --disable-nls \
  96. --without-zlib \
  97. --enable-local-libopts \
  98. --disable-doc \
  99. --disable-tests \
  100. --with-default-trust-store-dir=/etc/ssl/certs/ \
  101. --disable-crywrap \
  102. --with-librt-prefix="$(LIBRT_ROOT_DIR)/"
  103. ifneq ($(CONFIG_GNUTLS_EXT_LIBTASN1),y)
  104. CONFIGURE_ARGS += --with-included-libtasn1
  105. endif
  106. ifneq ($(CONFIG_GNUTLS_PKCS11),y)
  107. CONFIGURE_ARGS += --without-p11-kit
  108. endif
  109. ifeq ($(CONFIG_LIBNETTLE_MINI),y)
  110. CONFIGURE_ARGS += --with-nettle-mini
  111. endif
  112. ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
  113. CONFIGURE_ARGS += --disable-dtls-srtp-support
  114. endif
  115. ifneq ($(CONFIG_GNUTLS_ALPN),y)
  116. CONFIGURE_ARGS += --disable-alpn-support
  117. endif
  118. ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
  119. CONFIGURE_ARGS += --disable-heartbeat-support
  120. endif
  121. ifneq ($(CONFIG_GNUTLS_SRP),y)
  122. CONFIGURE_ARGS += --disable-srp-authentication
  123. endif
  124. ifneq ($(CONFIG_GNUTLS_PSK),y)
  125. CONFIGURE_ARGS += --disable-psk-authentication
  126. endif
  127. ifneq ($(CONFIG_GNUTLS_OPENPGP),y)
  128. CONFIGURE_ARGS += --disable-openpgp-authentication
  129. endif
  130. ifneq ($(CONFIG_GNUTLS_ANON),y)
  131. CONFIGURE_ARGS += --disable-anon-authentication
  132. endif
  133. ifneq ($(CONFIG_GNUTLS_OCSP),y)
  134. CONFIGURE_ARGS += --disable-ocsp
  135. endif
  136. ifneq ($(CONFIG_GNUTLS_TPM),y)
  137. CONFIGURE_ARGS += --without-tpm
  138. endif
  139. ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
  140. CONFIGURE_ARGS += --enable-cryptodev
  141. endif
  142. TARGET_CFLAGS += $(FPIC)
  143. define Build/InstallDev
  144. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
  145. $(CP) \
  146. $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so* \
  147. $(1)/usr/lib/
  148. $(CP) \
  149. $(PKG_INSTALL_DIR)/usr/include/gnutls \
  150. $(1)/usr/include/
  151. $(CP) \
  152. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls.pc \
  153. $(1)/usr/lib/pkgconfig/
  154. endef
  155. define Package/certtool/conffiles
  156. /etc/gnutls/certtool.cfg
  157. endef
  158. define Package/certtool/install
  159. $(INSTALL_DIR) $(1)/etc/gnutls
  160. $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
  161. $(INSTALL_DIR) $(1)/usr/bin
  162. $(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
  163. endef
  164. define Package/gnutls-utils/install
  165. $(INSTALL_DIR) $(1)/usr/bin
  166. ifeq ($(CONFIG_GNUTLS_OCSP),y)
  167. ifeq ($(CONFIG_GNUTLS_ANON),y)
  168. $(CP) \
  169. $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} \
  170. $(1)/usr/bin/
  171. endif
  172. $(CP) \
  173. $(PKG_INSTALL_DIR)/usr/bin/ocsptool \
  174. $(1)/usr/bin/
  175. endif
  176. ifeq ($(CONFIG_GNUTLS_SRP),y)
  177. $(CP) \
  178. $(PKG_INSTALL_DIR)/usr/bin/srptool \
  179. $(1)/usr/bin/
  180. endif
  181. ifeq ($(CONFIG_GNUTLS_PSK),y)
  182. $(CP) \
  183. $(PKG_INSTALL_DIR)/usr/bin/psktool \
  184. $(1)/usr/bin/
  185. endif
  186. ifeq ($(CONFIG_GNUTLS_PKCS11),y)
  187. $(CP) \
  188. $(PKG_INSTALL_DIR)/usr/bin/p11tool \
  189. $(1)/usr/bin/
  190. endif
  191. ifeq ($(CONFIG_GNUTLS_TPM),y)
  192. $(CP) \
  193. $(PKG_INSTALL_DIR)/usr/bin/tpmtool \
  194. $(1)/usr/bin/
  195. endif
  196. endef
  197. define Package/libgnutls/install
  198. $(INSTALL_DIR) $(1)/usr/lib
  199. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
  200. endef
  201. $(eval $(call BuildPackage,certtool))
  202. $(eval $(call BuildPackage,gnutls-utils))
  203. $(eval $(call BuildPackage,libgnutls))