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.

227 lines
5.2 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
  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. --with-included-libtasn1 \
  85. --enable-local-libopts \
  86. --disable-doc \
  87. --disable-tests \
  88. --disable-rsa-export \
  89. --disable-crywrap \
  90. --without-p11-kit
  91. ifeq ($(CONFIG_LIBNETTLE_MINI),y)
  92. CONFIGURE_ARGS += --with-nettle-mini
  93. endif
  94. ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
  95. CONFIGURE_ARGS += --disable-dtls-srtp-support
  96. endif
  97. ifneq ($(CONFIG_GNUTLS_ALPN),y)
  98. CONFIGURE_ARGS += --disable-alpn-support
  99. endif
  100. ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
  101. CONFIGURE_ARGS += --disable-heartbeat-support
  102. endif
  103. ifneq ($(CONFIG_GNUTLS_SRP),y)
  104. CONFIGURE_ARGS += --disable-srp-authentication
  105. endif
  106. ifneq ($(CONFIG_GNUTLS_PSK),y)
  107. CONFIGURE_ARGS += --disable-psk-authentication
  108. endif
  109. ifneq ($(CONFIG_GNUTLS_OPENPGP),y)
  110. CONFIGURE_ARGS += --disable-openpgp-authentication
  111. endif
  112. ifneq ($(CONFIG_GNUTLS_ANON),y)
  113. CONFIGURE_ARGS += --disable-anon-authentication
  114. endif
  115. ifneq ($(CONFIG_GNUTLS_OCSP),y)
  116. CONFIGURE_ARGS += --disable-ocsp
  117. endif
  118. ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
  119. CONFIGURE_ARGS += --enable-cryptodev
  120. endif
  121. TARGET_CFLAGS += $(FPIC)
  122. TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
  123. define Build/Configure
  124. $(SED) 's,-I$$$${includedir},,g' $(PKG_BUILD_DIR)/configure
  125. $(SED) 's,-L$$$${libdir},,g' $(PKG_BUILD_DIR)/configure
  126. $(call Build/Configure/Default)
  127. endef
  128. define Build/InstallDev
  129. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
  130. $(CP) \
  131. $(PKG_INSTALL_DIR)/usr/include/gnutls \
  132. $(1)/usr/include/
  133. $(CP) \
  134. $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-openssl}.{a,so*} \
  135. $(1)/usr/lib/
  136. $(CP) \
  137. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls.pc \
  138. $(1)/usr/lib/pkgconfig/
  139. endef
  140. define Package/certtool/conffiles
  141. /etc/gnutls/certtool.cfg
  142. endef
  143. define Package/certtool/install
  144. $(INSTALL_DIR) $(1)/etc/gnutls
  145. $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
  146. $(INSTALL_DIR) $(1)/usr/bin
  147. $(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
  148. endef
  149. define Package/gnutls-utils/install
  150. $(INSTALL_DIR) $(1)/usr/bin
  151. ifeq ($(CONFIG_GNUTLS_OCSP),y)
  152. ifeq ($(CONFIG_GNUTLS_ANON),y)
  153. $(CP) \
  154. $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} \
  155. $(1)/usr/bin/
  156. endif
  157. $(CP) \
  158. $(PKG_INSTALL_DIR)/usr/bin/ocsptool \
  159. $(1)/usr/bin/
  160. endif
  161. ifeq ($(CONFIG_GNUTLS_SRP),y)
  162. $(CP) \
  163. $(PKG_INSTALL_DIR)/usr/bin/srptool \
  164. $(1)/usr/bin/
  165. endif
  166. ifeq ($(CONFIG_GNUTLS_PSK),y)
  167. $(CP) \
  168. $(PKG_INSTALL_DIR)/usr/bin/psktool \
  169. $(1)/usr/bin/
  170. endif
  171. endef
  172. define Package/libgnutls/install
  173. $(INSTALL_DIR) $(1)/usr/lib
  174. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
  175. endef
  176. define Package/libgnutls-openssl/install
  177. $(INSTALL_DIR) $(1)/usr/lib
  178. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
  179. endef
  180. $(eval $(call BuildPackage,certtool))
  181. $(eval $(call BuildPackage,gnutls-utils))
  182. $(eval $(call BuildPackage,libgnutls))
  183. $(eval $(call BuildPackage,libgnutls-openssl))