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.

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