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.

183 lines
5.9 KiB

  1. #
  2. # Copyright (C) 2007-2020 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:=curl
  9. PKG_VERSION:=7.80.0
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=https://dl.uxnr.de/mirror/curl/ \
  13. https://curl.askapache.com/download/ \
  14. https://curl.se/download/
  15. PKG_HASH:=a132bd93188b938771135ac7c1f3ac1d3ce507c1fcbef8c471397639214ae2ab
  16. PKG_LICENSE:=MIT
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_CPE_ID:=cpe:/a:haxx:libcurl
  19. PKG_FIXUP:=autoreconf
  20. PKG_INSTALL:=1
  21. PKG_BUILD_PARALLEL:=1
  22. PKG_CONFIG_DEPENDS:= \
  23. CONFIG_IPV6 \
  24. \
  25. CONFIG_LIBCURL_WOLFSSL \
  26. CONFIG_LIBCURL_GNUTLS \
  27. CONFIG_LIBCURL_OPENSSL \
  28. CONFIG_LIBCURL_MBEDTLS \
  29. CONFIG_LIBCURL_NOSSL \
  30. \
  31. CONFIG_LIBCURL_LIBIDN2 \
  32. CONFIG_LIBCURL_SSH2 \
  33. CONFIG_LIBCURL_ZLIB \
  34. CONFIG_LIBCURL_ZSTD \
  35. \
  36. CONFIG_LIBCURL_DICT \
  37. CONFIG_LIBCURL_FILE \
  38. CONFIG_LIBCURL_FTP \
  39. CONFIG_LIBCURL_GOPHER \
  40. CONFIG_LIBCURL_HTTP \
  41. CONFIG_LIBCURL_IMAP \
  42. CONFIG_LIBCURL_LDAP \
  43. CONFIG_LIBCURL_LDAPS \
  44. CONFIG_LIBCURL_POP3 \
  45. CONFIG_LIBCURL_RTSP \
  46. CONFIG_LIBCURL_NO_RTSP \
  47. CONFIG_LIBCURL_SMB \
  48. CONFIG_LIBCURL_NO_SMB \
  49. CONFIG_LIBCURL_SMTP \
  50. CONFIG_LIBCURL_TELNET \
  51. CONFIG_LIBCURL_TFTP \
  52. CONFIG_LIBCURL_NGHTTP2 \
  53. \
  54. CONFIG_LIBCURL_COOKIES \
  55. CONFIG_LIBCURL_CRYPTO_AUTH \
  56. CONFIG_LIBCURL_LIBCURL_OPTION \
  57. CONFIG_LIBCURL_PROXY \
  58. CONFIG_LIBCURL_THREADED_RESOLVER \
  59. CONFIG_LIBCURL_TLS_SRP \
  60. CONFIG_LIBCURL_UNIX_SOCKETS \
  61. CONFIG_LIBCURL_VERBOSE \
  62. CONFIG_LIBCURL_NTLM \
  63. $(if $(CONFIG_LIBCURL_OPENSSL), \
  64. CONFIG_OPENSSL_ENGINE \
  65. CONFIG_OPENSSL_WITH_COMPRESSION \
  66. CONFIG_OPENSSL_WITH_NPN)
  67. include $(INCLUDE_DIR)/package.mk
  68. define Package/curl/Default
  69. SECTION:=net
  70. CATEGORY:=Network
  71. URL:=http://curl.se/
  72. MAINTAINER:=Stan Grishin <stangri@melmac.ca>
  73. endef
  74. define Package/curl
  75. $(call Package/curl/Default)
  76. SUBMENU:=File Transfer
  77. DEPENDS:=+libcurl
  78. TITLE:=A client-side URL transfer utility
  79. endef
  80. define Package/libcurl
  81. $(call Package/curl/Default)
  82. SECTION:=libs
  83. CATEGORY:=Libraries
  84. DEPENDS:= +LIBCURL_WOLFSSL:libwolfssl +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_MBEDTLS:libmbedtls
  85. DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_ZSTD:libzstd +LIBCURL_THREADED_RESOLVER:libpthread +LIBCURL_LDAP:libopenldap
  86. DEPENDS += +LIBCURL_LIBIDN2:libidn2 +LIBCURL_SSH2:libssh2 +LIBCURL_NGHTTP2:libnghttp2 +ca-bundle
  87. TITLE:=A client-side URL transfer library
  88. MENU:=1
  89. ABI_VERSION:=4
  90. endef
  91. define Package/libcurl/config
  92. source "$(SOURCE)/Config.in"
  93. endef
  94. TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections
  95. TARGET_CPPFLAGS += $(if $(CONFIG_LIBCURL_NTLM),,-DCURL_DISABLE_NTLM)
  96. TARGET_LDFLAGS += -Wl,--gc-sections
  97. CONFIGURE_ARGS += \
  98. --disable-debug \
  99. --disable-ares \
  100. --enable-shared \
  101. --enable-static \
  102. --disable-manual \
  103. --without-nss \
  104. --without-librtmp \
  105. --without-libidn \
  106. --without-ca-path \
  107. --without-libpsl \
  108. --without-zstd \
  109. --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
  110. \
  111. $(call autoconf_bool,CONFIG_IPV6,ipv6) \
  112. \
  113. $(if $(CONFIG_LIBCURL_WOLFSSL),--with-wolfssl="$(STAGING_DIR)/usr",--without-wolfssl) \
  114. $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr",--without-gnutls) \
  115. $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr",--without-ssl) \
  116. $(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr",--without-mbedtls) \
  117. \
  118. $(if $(CONFIG_LIBCURL_LIBIDN2),--with-libidn2="$(STAGING_DIR)/usr",--without-libidn2) \
  119. $(if $(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \
  120. $(if $(CONFIG_LIBCURL_ZLIB),--with-zlib="$(STAGING_DIR)/usr",--without-zlib) \
  121. $(if $(CONFIG_LIBCURL_ZSTD),--with-zstd="$(STAGING_DIR)/usr",--without-zstd) \
  122. $(if $(CONFIG_LIBCURL_NGHTTP2),--with-nghttp2="$(STAGING_DIR)/usr",--without-nghttp2) \
  123. \
  124. $(call autoconf_bool,CONFIG_LIBCURL_DICT,dict) \
  125. $(call autoconf_bool,CONFIG_LIBCURL_FILE,file) \
  126. $(call autoconf_bool,CONFIG_LIBCURL_FTP,ftp) \
  127. $(call autoconf_bool,CONFIG_LIBCURL_GOPHER,gopher) \
  128. $(call autoconf_bool,CONFIG_LIBCURL_HTTP,http) \
  129. $(call autoconf_bool,CONFIG_LIBCURL_IMAP,imap) \
  130. $(call autoconf_bool,CONFIG_LIBCURL_LDAP,ldap) \
  131. $(call autoconf_bool,CONFIG_LIBCURL_LDAPS,ldaps) \
  132. $(call autoconf_bool,CONFIG_LIBCURL_POP3,pop3) \
  133. $(call autoconf_bool,CONFIG_LIBCURL_RTSP,rtsp) \
  134. $(call autoconf_bool,CONFIG_LIBCURL_SMB,smb) \
  135. $(call autoconf_bool,CONFIG_LIBCURL_SMTP,smtp) \
  136. $(call autoconf_bool,CONFIG_LIBCURL_TELNET,telnet) \
  137. $(call autoconf_bool,CONFIG_LIBCURL_TFTP,tftp) \
  138. \
  139. $(call autoconf_bool,CONFIG_LIBCURL_COOKIES,cookies) \
  140. $(call autoconf_bool,CONFIG_LIBCURL_CRYPTO_AUTH,crypto-auth) \
  141. $(call autoconf_bool,CONFIG_LIBCURL_LIBCURL_OPTION,libcurl-option) \
  142. $(call autoconf_bool,CONFIG_LIBCURL_PROXY,proxy) \
  143. $(call autoconf_bool,CONFIG_LIBCURL_THREADED_RESOLVER,threaded-resolver) \
  144. $(call autoconf_bool,CONFIG_LIBCURL_TLS_SRP,tls-srp) \
  145. $(call autoconf_bool,CONFIG_LIBCURL_UNIX_SOCKETS,unix-sockets) \
  146. $(call autoconf_bool,CONFIG_LIBCURL_VERBOSE,verbose) \
  147. define Build/InstallDev
  148. $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
  149. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl-config $(1)/usr/bin/
  150. $(CP) $(PKG_INSTALL_DIR)/usr/include/curl $(1)/usr/include/
  151. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.{a,so*} $(1)/usr/lib/
  152. $(CP) $(PKG_BUILD_DIR)/libcurl.pc $(1)/usr/lib/pkgconfig/
  153. $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(1)/usr/bin/curl-config
  154. [ -n "$(TARGET_LDFLAGS)" ] && $(SED) 's#$(TARGET_LDFLAGS)##g' $(1)/usr/lib/pkgconfig/libcurl.pc || true
  155. $(LN) $(STAGING_DIR)/usr/bin/curl-config $(2)/bin/
  156. endef
  157. define Package/curl/install
  158. $(INSTALL_DIR) $(1)/usr/bin
  159. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl $(1)/usr/bin/
  160. endef
  161. define Package/libcurl/install
  162. $(INSTALL_DIR) $(1)/usr/lib
  163. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.so.* $(1)/usr/lib/
  164. endef
  165. $(eval $(call BuildPackage,libcurl))
  166. $(eval $(call BuildPackage,curl))