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.

256 lines
5.9 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:=2
  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-libdane \
  96. --disable-guile \
  97. --disable-nls \
  98. --without-zlib \
  99. --enable-local-libopts \
  100. --disable-doc \
  101. --disable-tests \
  102. --disable-rsa-export \
  103. --with-default-trust-store-dir=/etc/ssl/certs/ \
  104. --disable-crywrap \
  105. --with-librt-prefix="$(STAGING_DIR)/"
  106. ifneq ($(CONFIG_GNUTLS_EXT_LIBTASN1),y)
  107. CONFIGURE_ARGS += --with-included-libtasn1
  108. endif
  109. ifneq ($(CONFIG_GNUTLS_PKCS11),y)
  110. CONFIGURE_ARGS += --without-p11-kit
  111. endif
  112. ifeq ($(CONFIG_LIBNETTLE_MINI),y)
  113. CONFIGURE_ARGS += --with-nettle-mini
  114. endif
  115. ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
  116. CONFIGURE_ARGS += --disable-dtls-srtp-support
  117. endif
  118. ifneq ($(CONFIG_GNUTLS_ALPN),y)
  119. CONFIGURE_ARGS += --disable-alpn-support
  120. endif
  121. ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
  122. CONFIGURE_ARGS += --disable-heartbeat-support
  123. endif
  124. ifneq ($(CONFIG_GNUTLS_SRP),y)
  125. CONFIGURE_ARGS += --disable-srp-authentication
  126. endif
  127. ifneq ($(CONFIG_GNUTLS_PSK),y)
  128. CONFIGURE_ARGS += --disable-psk-authentication
  129. endif
  130. ifneq ($(CONFIG_GNUTLS_OPENPGP),y)
  131. CONFIGURE_ARGS += --disable-openpgp-authentication
  132. endif
  133. ifneq ($(CONFIG_GNUTLS_ANON),y)
  134. CONFIGURE_ARGS += --disable-anon-authentication
  135. endif
  136. ifneq ($(CONFIG_GNUTLS_OCSP),y)
  137. CONFIGURE_ARGS += --disable-ocsp
  138. endif
  139. ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
  140. CONFIGURE_ARGS += --enable-cryptodev
  141. endif
  142. TARGET_CFLAGS += $(FPIC)
  143. TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
  144. define Build/Configure
  145. $(SED) 's,-I$$$${includedir},,g' $(PKG_BUILD_DIR)/configure
  146. $(SED) 's,-L$$$${libdir},,g' $(PKG_BUILD_DIR)/configure
  147. $(call Build/Configure/Default)
  148. endef
  149. define Build/InstallDev
  150. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
  151. $(CP) \
  152. $(PKG_INSTALL_DIR)/usr/include/gnutls \
  153. $(1)/usr/include/
  154. $(CP) \
  155. $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-openssl}.{a,so*} \
  156. $(1)/usr/lib/
  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. 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. define Package/libgnutls-openssl/install
  203. $(INSTALL_DIR) $(1)/usr/lib
  204. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
  205. endef
  206. $(eval $(call BuildPackage,certtool))
  207. $(eval $(call BuildPackage,gnutls-utils))
  208. $(eval $(call BuildPackage,libgnutls))
  209. $(eval $(call BuildPackage,libgnutls-openssl))