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.

234 lines
5.3 KiB

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