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.

184 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.85.0
  10. PKG_RELEASE:=$(AUTORELEASE).1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=https://github.com/curl/curl/releases/download/curl-$(subst .,_,$(PKG_VERSION))/ \
  13. https://dl.uxnr.de/mirror/curl/ \
  14. https://curl.askapache.com/download/ \
  15. https://curl.se/download/
  16. PKG_HASH:=88b54a6d4b9a48cb4d873c7056dcba997ddd5b7be5a2d537a4acb55c20b04be6
  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.se/
  73. MAINTAINER:=Stan Grishin <stangri@melmac.ca>
  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-librtmp \
  106. --without-libidn \
  107. --without-ca-path \
  108. --without-libpsl \
  109. --without-zstd \
  110. --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
  111. \
  112. $(call autoconf_bool,CONFIG_IPV6,ipv6) \
  113. \
  114. $(if $(CONFIG_LIBCURL_WOLFSSL),--with-wolfssl="$(STAGING_DIR)/usr",--without-wolfssl) \
  115. $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr",--without-gnutls) \
  116. $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr",--without-ssl) \
  117. $(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr",--without-mbedtls) \
  118. \
  119. $(if $(CONFIG_LIBCURL_LIBIDN2),--with-libidn2="$(STAGING_DIR)/usr",--without-libidn2) \
  120. $(if $(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \
  121. $(if $(CONFIG_LIBCURL_ZLIB),--with-zlib="$(STAGING_DIR)/usr",--without-zlib) \
  122. $(if $(CONFIG_LIBCURL_ZSTD),--with-zstd="$(STAGING_DIR)/usr",--without-zstd) \
  123. $(if $(CONFIG_LIBCURL_NGHTTP2),--with-nghttp2="$(STAGING_DIR)/usr",--without-nghttp2) \
  124. \
  125. $(call autoconf_bool,CONFIG_LIBCURL_DICT,dict) \
  126. $(call autoconf_bool,CONFIG_LIBCURL_FILE,file) \
  127. $(call autoconf_bool,CONFIG_LIBCURL_FTP,ftp) \
  128. $(call autoconf_bool,CONFIG_LIBCURL_GOPHER,gopher) \
  129. $(call autoconf_bool,CONFIG_LIBCURL_HTTP,http) \
  130. $(call autoconf_bool,CONFIG_LIBCURL_IMAP,imap) \
  131. $(call autoconf_bool,CONFIG_LIBCURL_LDAP,ldap) \
  132. $(call autoconf_bool,CONFIG_LIBCURL_LDAPS,ldaps) \
  133. $(call autoconf_bool,CONFIG_LIBCURL_POP3,pop3) \
  134. $(call autoconf_bool,CONFIG_LIBCURL_RTSP,rtsp) \
  135. $(call autoconf_bool,CONFIG_LIBCURL_SMB,smb) \
  136. $(call autoconf_bool,CONFIG_LIBCURL_SMTP,smtp) \
  137. $(call autoconf_bool,CONFIG_LIBCURL_TELNET,telnet) \
  138. $(call autoconf_bool,CONFIG_LIBCURL_TFTP,tftp) \
  139. \
  140. $(call autoconf_bool,CONFIG_LIBCURL_COOKIES,cookies) \
  141. $(call autoconf_bool,CONFIG_LIBCURL_CRYPTO_AUTH,crypto-auth) \
  142. $(call autoconf_bool,CONFIG_LIBCURL_LIBCURL_OPTION,libcurl-option) \
  143. $(call autoconf_bool,CONFIG_LIBCURL_PROXY,proxy) \
  144. $(call autoconf_bool,CONFIG_LIBCURL_THREADED_RESOLVER,threaded-resolver) \
  145. $(call autoconf_bool,CONFIG_LIBCURL_TLS_SRP,tls-srp) \
  146. $(call autoconf_bool,CONFIG_LIBCURL_UNIX_SOCKETS,unix-sockets) \
  147. $(call autoconf_bool,CONFIG_LIBCURL_VERBOSE,verbose) \
  148. define Build/InstallDev
  149. $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
  150. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl-config $(1)/usr/bin/
  151. $(CP) $(PKG_INSTALL_DIR)/usr/include/curl $(1)/usr/include/
  152. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.{a,so*} $(1)/usr/lib/
  153. $(CP) $(PKG_BUILD_DIR)/libcurl.pc $(1)/usr/lib/pkgconfig/
  154. $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(1)/usr/bin/curl-config
  155. [ -n "$(TARGET_LDFLAGS)" ] && $(SED) 's#$(TARGET_LDFLAGS)##g' $(1)/usr/lib/pkgconfig/libcurl.pc || true
  156. $(LN) $(STAGING_DIR)/usr/bin/curl-config $(2)/bin/
  157. endef
  158. define Package/curl/install
  159. $(INSTALL_DIR) $(1)/usr/bin
  160. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl $(1)/usr/bin/
  161. endef
  162. define Package/libcurl/install
  163. $(INSTALL_DIR) $(1)/usr/lib
  164. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.so.* $(1)/usr/lib/
  165. endef
  166. $(eval $(call BuildPackage,libcurl))
  167. $(eval $(call BuildPackage,curl))