Makefile 5.6 KB

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