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.

255 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.10
  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.3
  14. PKG_MD5SUM:=c0a72b2c0553fe1c4992e30835808012
  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. ifneq ($(CONFIG_GNUTLS_EXT_LIBTASN1),y)
  106. CONFIGURE_ARGS += --with-included-libtasn1
  107. endif
  108. ifneq ($(CONFIG_GNUTLS_PKCS11),y)
  109. CONFIGURE_ARGS += --without-p11-kit
  110. endif
  111. ifeq ($(CONFIG_LIBNETTLE_MINI),y)
  112. CONFIGURE_ARGS += --with-nettle-mini
  113. endif
  114. ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
  115. CONFIGURE_ARGS += --disable-dtls-srtp-support
  116. endif
  117. ifneq ($(CONFIG_GNUTLS_ALPN),y)
  118. CONFIGURE_ARGS += --disable-alpn-support
  119. endif
  120. ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
  121. CONFIGURE_ARGS += --disable-heartbeat-support
  122. endif
  123. ifneq ($(CONFIG_GNUTLS_SRP),y)
  124. CONFIGURE_ARGS += --disable-srp-authentication
  125. endif
  126. ifneq ($(CONFIG_GNUTLS_PSK),y)
  127. CONFIGURE_ARGS += --disable-psk-authentication
  128. endif
  129. ifneq ($(CONFIG_GNUTLS_OPENPGP),y)
  130. CONFIGURE_ARGS += --disable-openpgp-authentication
  131. endif
  132. ifneq ($(CONFIG_GNUTLS_ANON),y)
  133. CONFIGURE_ARGS += --disable-anon-authentication
  134. endif
  135. ifneq ($(CONFIG_GNUTLS_OCSP),y)
  136. CONFIGURE_ARGS += --disable-ocsp
  137. endif
  138. ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
  139. CONFIGURE_ARGS += --enable-cryptodev
  140. endif
  141. TARGET_CFLAGS += $(FPIC)
  142. TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
  143. define Build/Configure
  144. $(SED) 's,-I$$$${includedir},,g' $(PKG_BUILD_DIR)/configure
  145. $(SED) 's,-L$$$${libdir},,g' $(PKG_BUILD_DIR)/configure
  146. $(call Build/Configure/Default)
  147. endef
  148. define Build/InstallDev
  149. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
  150. $(CP) \
  151. $(PKG_INSTALL_DIR)/usr/include/gnutls \
  152. $(1)/usr/include/
  153. $(CP) \
  154. $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-openssl}.{a,so*} \
  155. $(1)/usr/lib/
  156. $(CP) \
  157. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls.pc \
  158. $(1)/usr/lib/pkgconfig/
  159. endef
  160. define Package/certtool/conffiles
  161. /etc/gnutls/certtool.cfg
  162. endef
  163. define Package/certtool/install
  164. $(INSTALL_DIR) $(1)/etc/gnutls
  165. $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
  166. $(INSTALL_DIR) $(1)/usr/bin
  167. $(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
  168. endef
  169. define Package/gnutls-utils/install
  170. $(INSTALL_DIR) $(1)/usr/bin
  171. ifeq ($(CONFIG_GNUTLS_OCSP),y)
  172. ifeq ($(CONFIG_GNUTLS_ANON),y)
  173. $(CP) \
  174. $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} \
  175. $(1)/usr/bin/
  176. endif
  177. $(CP) \
  178. $(PKG_INSTALL_DIR)/usr/bin/ocsptool \
  179. $(1)/usr/bin/
  180. endif
  181. ifeq ($(CONFIG_GNUTLS_SRP),y)
  182. $(CP) \
  183. $(PKG_INSTALL_DIR)/usr/bin/srptool \
  184. $(1)/usr/bin/
  185. endif
  186. ifeq ($(CONFIG_GNUTLS_PSK),y)
  187. $(CP) \
  188. $(PKG_INSTALL_DIR)/usr/bin/psktool \
  189. $(1)/usr/bin/
  190. endif
  191. ifeq ($(CONFIG_GNUTLS_PKCS11),y)
  192. $(CP) \
  193. $(PKG_INSTALL_DIR)/usr/bin/p11tool \
  194. $(1)/usr/bin/
  195. endif
  196. endef
  197. define Package/libgnutls/install
  198. $(INSTALL_DIR) $(1)/usr/lib
  199. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
  200. endef
  201. define Package/libgnutls-openssl/install
  202. $(INSTALL_DIR) $(1)/usr/lib
  203. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
  204. endef
  205. $(eval $(call BuildPackage,certtool))
  206. $(eval $(call BuildPackage,gnutls-utils))
  207. $(eval $(call BuildPackage,libgnutls))
  208. $(eval $(call BuildPackage,libgnutls-openssl))