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.

250 lines
5.8 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.11.1
  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:=fbba12f3db9a55dbf027e14111755817ec44b57eabec3e8089aac8ac6f533cf8
  15. #PKG_FIXUP:=autoreconf gettext-version
  16. PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
  17. PKG_LICENSE:=LGPL-2.1-or-later
  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. # We disable the configuration file (system-priority-file) because
  89. # the use of configuration increases the non-shared memory used by
  90. # the library and we don't provide an openwrt-specific configuration
  91. # anyway.
  92. CONFIGURE_ARGS+= \
  93. --enable-shared \
  94. --enable-static \
  95. --disable-doc \
  96. --disable-gcc-warnings \
  97. --disable-guile \
  98. --disable-rpath \
  99. --disable-seccomp-tests \
  100. --disable-tests \
  101. --disable-valgrind-tests \
  102. \
  103. --disable-libdane \
  104. --disable-ssl2-support \
  105. --disable-ssl3-support \
  106. --enable-local-libopts \
  107. --without-idn \
  108. --with-default-trust-store-dir=/etc/ssl/certs/ \
  109. --with-included-unistring \
  110. --with-librt-prefix="$(LIBRT_ROOT_DIR)/" \
  111. --with-pic \
  112. --with-system-priority-file=""
  113. ifneq ($(CONFIG_GNUTLS_EXT_LIBTASN1),y)
  114. CONFIGURE_ARGS += --with-included-libtasn1
  115. endif
  116. ifneq ($(CONFIG_GNUTLS_PKCS11),y)
  117. CONFIGURE_ARGS += --without-p11-kit
  118. endif
  119. ifeq ($(CONFIG_LIBNETTLE_MINI),y)
  120. CONFIGURE_ARGS += --with-nettle-mini
  121. endif
  122. ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
  123. CONFIGURE_ARGS += --disable-dtls-srtp-support
  124. endif
  125. ifneq ($(CONFIG_GNUTLS_ALPN),y)
  126. CONFIGURE_ARGS += --disable-alpn-support
  127. endif
  128. ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
  129. CONFIGURE_ARGS += --disable-heartbeat-support
  130. endif
  131. ifneq ($(CONFIG_GNUTLS_SRP),y)
  132. CONFIGURE_ARGS += --disable-srp-authentication
  133. endif
  134. ifneq ($(CONFIG_GNUTLS_PSK),y)
  135. CONFIGURE_ARGS += --disable-psk-authentication
  136. endif
  137. ifneq ($(CONFIG_GNUTLS_ANON),y)
  138. CONFIGURE_ARGS += --disable-anon-authentication
  139. endif
  140. ifneq ($(CONFIG_GNUTLS_OCSP),y)
  141. CONFIGURE_ARGS += --disable-ocsp
  142. endif
  143. ifneq ($(CONFIG_GNUTLS_TPM),y)
  144. CONFIGURE_ARGS += --without-tpm
  145. endif
  146. ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
  147. CONFIGURE_ARGS += --enable-cryptodev
  148. endif
  149. define Build/InstallDev
  150. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
  151. $(CP) \
  152. $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so* \
  153. $(1)/usr/lib/
  154. $(CP) \
  155. $(PKG_INSTALL_DIR)/usr/include/gnutls \
  156. $(1)/usr/include/
  157. $(CP) \
  158. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls.pc \
  159. $(1)/usr/lib/pkgconfig/
  160. endef
  161. define Package/certtool/conffiles
  162. /etc/gnutls/certtool.cfg
  163. endef
  164. define Package/certtool/install
  165. $(INSTALL_DIR) $(1)/etc/gnutls
  166. $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
  167. $(INSTALL_DIR) $(1)/usr/bin
  168. $(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
  169. endef
  170. define Package/gnutls-utils/install
  171. $(INSTALL_DIR) $(1)/usr/bin
  172. ifeq ($(CONFIG_GNUTLS_OCSP),y)
  173. ifeq ($(CONFIG_GNUTLS_ANON),y)
  174. $(CP) \
  175. $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} \
  176. $(1)/usr/bin/
  177. endif
  178. $(CP) \
  179. $(PKG_INSTALL_DIR)/usr/bin/ocsptool \
  180. $(1)/usr/bin/
  181. endif
  182. ifeq ($(CONFIG_GNUTLS_SRP),y)
  183. $(CP) \
  184. $(PKG_INSTALL_DIR)/usr/bin/srptool \
  185. $(1)/usr/bin/
  186. endif
  187. ifeq ($(CONFIG_GNUTLS_PSK),y)
  188. $(CP) \
  189. $(PKG_INSTALL_DIR)/usr/bin/psktool \
  190. $(1)/usr/bin/
  191. endif
  192. ifeq ($(CONFIG_GNUTLS_PKCS11),y)
  193. $(CP) \
  194. $(PKG_INSTALL_DIR)/usr/bin/p11tool \
  195. $(1)/usr/bin/
  196. endif
  197. ifeq ($(CONFIG_GNUTLS_TPM),y)
  198. $(CP) \
  199. $(PKG_INSTALL_DIR)/usr/bin/tpmtool \
  200. $(1)/usr/bin/
  201. endif
  202. endef
  203. define Package/libgnutls/install
  204. $(INSTALL_DIR) $(1)/usr/lib
  205. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
  206. endef
  207. $(eval $(call BuildPackage,certtool))
  208. $(eval $(call BuildPackage,gnutls-utils))
  209. $(eval $(call BuildPackage,libgnutls))