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.

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