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.

238 lines
5.5 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.2.15
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2
  13. PKG_MD5SUM:=ec3b06f80e312137386c5d322183ca5a
  14. PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
  15. PKG_INSTALL:=1
  16. PKG_LIBTOOL_PATHS:=. lib
  17. include $(INCLUDE_DIR)/package.mk
  18. define Package/gnutls/Default
  19. SUBMENU:=SSL
  20. SECTION:=libs
  21. CATEGORY:=Libraries
  22. TITLE:=GNU TLS
  23. URL:=http://www.gnutls.org/
  24. endef
  25. define Package/gnutls/Default/description
  26. GnuTLS is a secure communications library implementing the SSL, TLS
  27. and DTLS protocols and technologies around them. It provides a simple
  28. C language application programming interface (API) to access the secure
  29. communications protocols as well as APIs to parse and write X.509, PKCS12,
  30. OpenPGP and other required structures. It is aimed to be portable and
  31. efficient with focus on security and interoperability.
  32. endef
  33. define Package/certtool
  34. $(call Package/gnutls/Default)
  35. SECTION:=utils
  36. CATEGORY:=Utilities
  37. TITLE+= (certool utility)
  38. DEPENDS+= +libgnutls
  39. endef
  40. define Package/certtool/description
  41. $(call Package/gnutls/Default/description)
  42. This package contains the GnuTLS certtool utility.
  43. endef
  44. define Package/gnutls-utils
  45. $(call Package/gnutls/Default)
  46. SECTION:=utils
  47. CATEGORY:=Utilities
  48. TITLE+= (utilities)
  49. DEPENDS+= +libgnutls
  50. endef
  51. define Package/gnutls-utils/description
  52. $(call Package/gnutls/Default/description)
  53. This package contains the GnuTLS gnutls-cli, gnutls-serv, psktool,
  54. and srptool utilities.
  55. endef
  56. define Package/libgnutls/config
  57. source "$(SOURCE)/Config.in"
  58. endef
  59. define Package/libgnutls
  60. $(call Package/gnutls/Default)
  61. TITLE+= (library)
  62. DEPENDS+= +libnettle +!LIBNETTLE_MINI:libgmp +GNUTLS_EXT_LIBTASN1:libtasn1 +GNUTLS_PKCS11:p11-kit
  63. endef
  64. define Package/libgnutls/description
  65. $(call Package/gnutls/Default/description)
  66. This package contains the GnuTLS shared library, needed by other programs.
  67. endef
  68. define Package/libgnutls-openssl
  69. $(call Package/gnutls/Default)
  70. TITLE+= (OpenSSL compat library)
  71. DEPENDS+= +libgnutls
  72. endef
  73. define Package/libgnutls-openssl/description
  74. $(call Package/gnutls/Default/description)
  75. This package contains the GnuTLS OpenSSL compatibility layer shared library.
  76. endef
  77. CONFIGURE_ARGS+= \
  78. --enable-shared \
  79. --enable-static \
  80. --disable-libdane \
  81. --disable-guile \
  82. --disable-nls \
  83. --without-zlib \
  84. --enable-local-libopts \
  85. --disable-doc \
  86. --disable-tests \
  87. --disable-rsa-export \
  88. --disable-crywrap
  89. ifneq ($(CONFIG_GNUTLS_EXT_LIBTASN1),y)
  90. CONFIGURE_ARGS += --with-included-libtasn1
  91. endif
  92. ifneq ($(CONFIG_GNUTLS_PKCS11),y)
  93. CONFIGURE_ARGS += --without-p11-kit
  94. endif
  95. ifeq ($(CONFIG_LIBNETTLE_MINI),y)
  96. CONFIGURE_ARGS += --with-nettle-mini
  97. endif
  98. ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
  99. CONFIGURE_ARGS += --disable-dtls-srtp-support
  100. endif
  101. ifneq ($(CONFIG_GNUTLS_ALPN),y)
  102. CONFIGURE_ARGS += --disable-alpn-support
  103. endif
  104. ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
  105. CONFIGURE_ARGS += --disable-heartbeat-support
  106. endif
  107. ifneq ($(CONFIG_GNUTLS_SRP),y)
  108. CONFIGURE_ARGS += --disable-srp-authentication
  109. endif
  110. ifneq ($(CONFIG_GNUTLS_PSK),y)
  111. CONFIGURE_ARGS += --disable-psk-authentication
  112. endif
  113. ifneq ($(CONFIG_GNUTLS_OPENPGP),y)
  114. CONFIGURE_ARGS += --disable-openpgp-authentication
  115. endif
  116. ifneq ($(CONFIG_GNUTLS_ANON),y)
  117. CONFIGURE_ARGS += --disable-anon-authentication
  118. endif
  119. ifneq ($(CONFIG_GNUTLS_OCSP),y)
  120. CONFIGURE_ARGS += --disable-ocsp
  121. endif
  122. ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
  123. CONFIGURE_ARGS += --enable-cryptodev
  124. endif
  125. TARGET_CFLAGS += $(FPIC)
  126. TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
  127. define Build/Configure
  128. $(SED) 's,-I$$$${includedir},,g' $(PKG_BUILD_DIR)/configure
  129. $(SED) 's,-L$$$${libdir},,g' $(PKG_BUILD_DIR)/configure
  130. $(call Build/Configure/Default)
  131. endef
  132. define Build/InstallDev
  133. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
  134. $(CP) \
  135. $(PKG_INSTALL_DIR)/usr/include/gnutls \
  136. $(1)/usr/include/
  137. $(CP) \
  138. $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-openssl}.{a,so*} \
  139. $(1)/usr/lib/
  140. $(CP) \
  141. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls.pc \
  142. $(1)/usr/lib/pkgconfig/
  143. endef
  144. define Package/certtool/conffiles
  145. /etc/gnutls/certtool.cfg
  146. endef
  147. define Package/certtool/install
  148. $(INSTALL_DIR) $(1)/etc/gnutls
  149. $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
  150. $(INSTALL_DIR) $(1)/usr/bin
  151. $(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
  152. endef
  153. define Package/gnutls-utils/install
  154. $(INSTALL_DIR) $(1)/usr/bin
  155. ifeq ($(CONFIG_GNUTLS_OCSP),y)
  156. ifeq ($(CONFIG_GNUTLS_ANON),y)
  157. $(CP) \
  158. $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} \
  159. $(1)/usr/bin/
  160. endif
  161. $(CP) \
  162. $(PKG_INSTALL_DIR)/usr/bin/ocsptool \
  163. $(1)/usr/bin/
  164. endif
  165. ifeq ($(CONFIG_GNUTLS_SRP),y)
  166. $(CP) \
  167. $(PKG_INSTALL_DIR)/usr/bin/srptool \
  168. $(1)/usr/bin/
  169. endif
  170. ifeq ($(CONFIG_GNUTLS_PSK),y)
  171. $(CP) \
  172. $(PKG_INSTALL_DIR)/usr/bin/psktool \
  173. $(1)/usr/bin/
  174. endif
  175. ifeq ($(CONFIG_GNUTLS_PKCS11),y)
  176. $(CP) \
  177. $(PKG_INSTALL_DIR)/usr/bin/p11tool \
  178. $(1)/usr/bin/
  179. endif
  180. endef
  181. define Package/libgnutls/install
  182. $(INSTALL_DIR) $(1)/usr/lib
  183. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
  184. endef
  185. define Package/libgnutls-openssl/install
  186. $(INSTALL_DIR) $(1)/usr/lib
  187. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
  188. endef
  189. $(eval $(call BuildPackage,certtool))
  190. $(eval $(call BuildPackage,gnutls-utils))
  191. $(eval $(call BuildPackage,libgnutls))
  192. $(eval $(call BuildPackage,libgnutls-openssl))