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.

253 lines
5.8 KiB

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