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.

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