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.

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