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.7 KiB

  1. #
  2. # Copyright (C) 2005-2010 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.3.13
  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.3
  14. PKG_MD5SUM:=a7387fe8bf3e604bf518a6da9ab2a4e6
  15. PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
  16. PKG_INSTALL:=1
  17. PKG_LIBTOOL_PATHS:=. lib
  18. PKG_CHECK_FORMAT_SECURITY:=0
  19. PKG_CONFIG_DEPENDS:= \
  20. CONFIG_GNUTLS_ALPN \
  21. CONFIG_GNUTLS_ANON \
  22. CONFIG_GNUTLS_CRYPTODEV \
  23. CONFIG_GNUTLS_DTLS_SRTP \
  24. CONFIG_GNUTLS_EXT_LIBTASN1 \
  25. CONFIG_GNUTLS_HEARTBEAT \
  26. CONFIG_GNUTLS_OCSP \
  27. CONFIG_GNUTLS_OPENPGP \
  28. CONFIG_GNUTLS_PKCS11 \
  29. CONFIG_GNUTLS_PSK \
  30. CONFIG_GNUTLS_SRP \
  31. CONFIG_LIBNETTLE_MINI \
  32. include $(INCLUDE_DIR)/package.mk
  33. define Package/gnutls/Default
  34. SUBMENU:=SSL
  35. SECTION:=libs
  36. CATEGORY:=Libraries
  37. TITLE:=GNU TLS
  38. URL:=http://www.gnutls.org/
  39. endef
  40. define Package/gnutls/Default/description
  41. GnuTLS is a secure communications library implementing the SSL, TLS
  42. and DTLS protocols and technologies around them. It provides a simple
  43. C language application programming interface (API) to access the secure
  44. communications protocols as well as APIs to parse and write X.509, PKCS12,
  45. OpenPGP and other required structures. It is aimed to be portable and
  46. efficient with focus on security and interoperability.
  47. endef
  48. define Package/certtool
  49. $(call Package/gnutls/Default)
  50. SECTION:=utils
  51. CATEGORY:=Utilities
  52. TITLE+= (certool utility)
  53. DEPENDS+= +libgnutls
  54. endef
  55. define Package/certtool/description
  56. $(call Package/gnutls/Default/description)
  57. This package contains the GnuTLS certtool utility.
  58. endef
  59. define Package/gnutls-utils
  60. $(call Package/gnutls/Default)
  61. SECTION:=utils
  62. CATEGORY:=Utilities
  63. TITLE+= (utilities)
  64. DEPENDS+= +libgnutls
  65. endef
  66. define Package/gnutls-utils/description
  67. $(call Package/gnutls/Default/description)
  68. This package contains the GnuTLS gnutls-cli, gnutls-serv, psktool,
  69. and srptool utilities.
  70. endef
  71. define Package/libgnutls/config
  72. source "$(SOURCE)/Config.in"
  73. endef
  74. define Package/libgnutls
  75. $(call Package/gnutls/Default)
  76. TITLE+= (library)
  77. DEPENDS+= +libnettle +!LIBNETTLE_MINI:libgmp +GNUTLS_EXT_LIBTASN1:libtasn1 +GNUTLS_PKCS11:p11-kit
  78. endef
  79. define Package/libgnutls/description
  80. $(call Package/gnutls/Default/description)
  81. This package contains the GnuTLS shared library, needed by other programs.
  82. endef
  83. define Package/libgnutls-openssl
  84. $(call Package/gnutls/Default)
  85. TITLE+= (OpenSSL compat library)
  86. DEPENDS+= +libgnutls
  87. endef
  88. define Package/libgnutls-openssl/description
  89. $(call Package/gnutls/Default/description)
  90. This package contains the GnuTLS OpenSSL compatibility layer shared library.
  91. endef
  92. CONFIGURE_ARGS+= \
  93. --enable-shared \
  94. --enable-static \
  95. --disable-rpath \
  96. --disable-libdane \
  97. --disable-guile \
  98. --disable-nls \
  99. --without-zlib \
  100. --enable-local-libopts \
  101. --disable-doc \
  102. --disable-tests \
  103. --disable-rsa-export \
  104. --with-default-trust-store-dir=/etc/ssl/certs/ \
  105. --disable-crywrap \
  106. --with-librt-prefix="$(STAGING_DIR)/"
  107. ifneq ($(CONFIG_GNUTLS_EXT_LIBTASN1),y)
  108. CONFIGURE_ARGS += --with-included-libtasn1
  109. endif
  110. ifneq ($(CONFIG_GNUTLS_PKCS11),y)
  111. CONFIGURE_ARGS += --without-p11-kit
  112. endif
  113. ifeq ($(CONFIG_LIBNETTLE_MINI),y)
  114. CONFIGURE_ARGS += --with-nettle-mini
  115. endif
  116. ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
  117. CONFIGURE_ARGS += --disable-dtls-srtp-support
  118. endif
  119. ifneq ($(CONFIG_GNUTLS_ALPN),y)
  120. CONFIGURE_ARGS += --disable-alpn-support
  121. endif
  122. ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
  123. CONFIGURE_ARGS += --disable-heartbeat-support
  124. endif
  125. ifneq ($(CONFIG_GNUTLS_SRP),y)
  126. CONFIGURE_ARGS += --disable-srp-authentication
  127. endif
  128. ifneq ($(CONFIG_GNUTLS_PSK),y)
  129. CONFIGURE_ARGS += --disable-psk-authentication
  130. endif
  131. ifneq ($(CONFIG_GNUTLS_OPENPGP),y)
  132. CONFIGURE_ARGS += --disable-openpgp-authentication
  133. endif
  134. ifneq ($(CONFIG_GNUTLS_ANON),y)
  135. CONFIGURE_ARGS += --disable-anon-authentication
  136. endif
  137. ifneq ($(CONFIG_GNUTLS_OCSP),y)
  138. CONFIGURE_ARGS += --disable-ocsp
  139. endif
  140. ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
  141. CONFIGURE_ARGS += --enable-cryptodev
  142. endif
  143. TARGET_CFLAGS += $(FPIC)
  144. define Build/InstallDev
  145. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
  146. $(CP) \
  147. $(PKG_INSTALL_DIR)/usr/include/gnutls \
  148. $(1)/usr/include/
  149. $(CP) \
  150. $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-openssl}.{a,so*} \
  151. $(1)/usr/lib/
  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. endef
  193. define Package/libgnutls/install
  194. $(INSTALL_DIR) $(1)/usr/lib
  195. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
  196. endef
  197. define Package/libgnutls-openssl/install
  198. $(INSTALL_DIR) $(1)/usr/lib
  199. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
  200. endef
  201. $(eval $(call BuildPackage,certtool))
  202. $(eval $(call BuildPackage,gnutls-utils))
  203. $(eval $(call BuildPackage,libgnutls))
  204. $(eval $(call BuildPackage,libgnutls-openssl))