2 # Copyright (C) 2007-2020 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
12 PKG_RELEASE
:=$(AUTORELEASE
)
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.xz
15 PKG_SOURCE_URL
:=https
://github.com
/curl
/curl
/releases
/download
/curl-
$(subst .
,_
,$(PKG_VERSION
))/ \
16 https
://dl.uxnr.de
/mirror
/curl
/ \
17 https
://curl.askapache.com
/download
/ \
18 https
://curl.se
/download
/
19 PKG_HASH
:=88b54a6d4b9a48cb4d873c7056dcba997ddd5b7be5a2d537a4acb55c20b04be6
22 PKG_LICENSE_FILES
:=COPYING
23 PKG_CPE_ID
:=cpe
:/a
:haxx
:libcurl
29 PKG_CONFIG_DEPENDS
:= \
32 CONFIG_LIBCURL_WOLFSSL \
33 CONFIG_LIBCURL_GNUTLS \
34 CONFIG_LIBCURL_OPENSSL \
35 CONFIG_LIBCURL_MBEDTLS \
36 CONFIG_LIBCURL_NOSSL \
38 CONFIG_LIBCURL_LIBIDN2 \
46 CONFIG_LIBCURL_GOPHER \
50 CONFIG_LIBCURL_LDAPS \
53 CONFIG_LIBCURL_NO_RTSP \
55 CONFIG_LIBCURL_NO_SMB \
57 CONFIG_LIBCURL_TELNET \
59 CONFIG_LIBCURL_NGHTTP2 \
61 CONFIG_LIBCURL_COOKIES \
62 CONFIG_LIBCURL_CRYPTO_AUTH \
63 CONFIG_LIBCURL_LIBCURL_OPTION \
64 CONFIG_LIBCURL_PROXY \
65 CONFIG_LIBCURL_THREADED_RESOLVER \
66 CONFIG_LIBCURL_TLS_SRP \
67 CONFIG_LIBCURL_UNIX_SOCKETS \
68 CONFIG_LIBCURL_VERBOSE \
70 $(if
$(CONFIG_LIBCURL_OPENSSL
), \
71 CONFIG_OPENSSL_ENGINE \
72 CONFIG_OPENSSL_WITH_COMPRESSION \
73 CONFIG_OPENSSL_WITH_NPN
)
75 include $(INCLUDE_DIR
)/package.mk
77 define Package
/curl
/Default
81 MAINTAINER
:=Stan Grishin
<stangri@melmac.ca
>
85 $(call Package
/curl
/Default
)
86 SUBMENU
:=File Transfer
88 TITLE
:=A client-side URL transfer utility
91 define Package
/libcurl
92 $(call Package
/curl
/Default
)
95 DEPENDS
:= +LIBCURL_WOLFSSL
:libwolfssl
+LIBCURL_OPENSSL
:libopenssl
+LIBCURL_GNUTLS
:libgnutls
+LIBCURL_MBEDTLS
:libmbedtls
96 DEPENDS
+= +LIBCURL_ZLIB
:zlib
+LIBCURL_ZSTD
:libzstd
+LIBCURL_THREADED_RESOLVER
:libpthread
+LIBCURL_LDAP
:libopenldap
97 DEPENDS
+= +LIBCURL_LIBIDN2
:libidn2
+LIBCURL_SSH2
:libssh2
+LIBCURL_NGHTTP2
:libnghttp2
+ca-bundle
98 TITLE
:=A client-side URL transfer library
103 define Package
/libcurl
/config
104 source
"$(SOURCE)/Config.in"
107 TARGET_CFLAGS
+= $(FPIC
) -ffunction-sections
-fdata-sections
108 TARGET_CPPFLAGS
+= $(if
$(CONFIG_LIBCURL_NTLM
),,-DCURL_DISABLE_NTLM
)
109 TARGET_LDFLAGS
+= -Wl
,--gc-sections
123 --with-ca-bundle
=/etc
/ssl
/certs
/ca-certificates.crt \
125 $(call autoconf_bool
,CONFIG_IPV6
,ipv6
) \
127 $(if
$(CONFIG_LIBCURL_WOLFSSL
),--with-wolfssl
="$(STAGING_DIR)/usr",--without-wolfssl
) \
128 $(if
$(CONFIG_LIBCURL_GNUTLS
),--with-gnutls
="$(STAGING_DIR)/usr",--without-gnutls
) \
129 $(if
$(CONFIG_LIBCURL_OPENSSL
),--with-ssl
="$(STAGING_DIR)/usr",--without-ssl
) \
130 $(if
$(CONFIG_LIBCURL_MBEDTLS
),--with-mbedtls
="$(STAGING_DIR)/usr",--without-mbedtls
) \
132 $(if
$(CONFIG_LIBCURL_LIBIDN2
),--with-libidn2
="$(STAGING_DIR)/usr",--without-libidn2
) \
133 $(if
$(CONFIG_LIBCURL_SSH2
),--with-libssh2
="$(STAGING_DIR)/usr",--without-libssh2
) \
134 $(if
$(CONFIG_LIBCURL_ZLIB
),--with-zlib
="$(STAGING_DIR)/usr",--without-zlib
) \
135 $(if
$(CONFIG_LIBCURL_ZSTD
),--with-zstd
="$(STAGING_DIR)/usr",--without-zstd
) \
136 $(if
$(CONFIG_LIBCURL_NGHTTP2
),--with-nghttp2
="$(STAGING_DIR)/usr",--without-nghttp2
) \
138 $(call autoconf_bool
,CONFIG_LIBCURL_DICT
,dict
) \
139 $(call autoconf_bool
,CONFIG_LIBCURL_FILE
,file
) \
140 $(call autoconf_bool
,CONFIG_LIBCURL_FTP
,ftp
) \
141 $(call autoconf_bool
,CONFIG_LIBCURL_GOPHER
,gopher
) \
142 $(call autoconf_bool
,CONFIG_LIBCURL_HTTP
,http
) \
143 $(call autoconf_bool
,CONFIG_LIBCURL_IMAP
,imap
) \
144 $(call autoconf_bool
,CONFIG_LIBCURL_LDAP
,ldap
) \
145 $(call autoconf_bool
,CONFIG_LIBCURL_LDAPS
,ldaps
) \
146 $(call autoconf_bool
,CONFIG_LIBCURL_POP3
,pop3
) \
147 $(call autoconf_bool
,CONFIG_LIBCURL_RTSP
,rtsp
) \
148 $(call autoconf_bool
,CONFIG_LIBCURL_SMB
,smb
) \
149 $(call autoconf_bool
,CONFIG_LIBCURL_SMTP
,smtp
) \
150 $(call autoconf_bool
,CONFIG_LIBCURL_TELNET
,telnet
) \
151 $(call autoconf_bool
,CONFIG_LIBCURL_TFTP
,tftp
) \
153 $(call autoconf_bool
,CONFIG_LIBCURL_COOKIES
,cookies
) \
154 $(call autoconf_bool
,CONFIG_LIBCURL_CRYPTO_AUTH
,crypto-auth
) \
155 $(call autoconf_bool
,CONFIG_LIBCURL_LIBCURL_OPTION
,libcurl-option
) \
156 $(call autoconf_bool
,CONFIG_LIBCURL_PROXY
,proxy
) \
157 $(call autoconf_bool
,CONFIG_LIBCURL_THREADED_RESOLVER
,threaded-resolver
) \
158 $(call autoconf_bool
,CONFIG_LIBCURL_TLS_SRP
,tls-srp
) \
159 $(call autoconf_bool
,CONFIG_LIBCURL_UNIX_SOCKETS
,unix-sockets
) \
160 $(call autoconf_bool
,CONFIG_LIBCURL_VERBOSE
,verbose
) \
162 define Build
/InstallDev
163 $(INSTALL_DIR
) $(2)/bin
$(1)/usr
/bin
$(1)/usr
/include $(1)/usr
/lib
$(1)/usr
/lib
/pkgconfig
164 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/curl-config
$(1)/usr
/bin
/
165 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/curl
$(1)/usr
/include/
166 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libcurl.
{a
,so
*} $(1)/usr
/lib
/
167 $(CP
) $(PKG_BUILD_DIR
)/libcurl.
pc $(1)/usr
/lib
/pkgconfig
/
168 $(SED
) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(1)/usr
/bin
/curl-config
169 [ -n
"$(TARGET_LDFLAGS)" ] && $(SED
) 's#$(TARGET_LDFLAGS)##g' $(1)/usr
/lib
/pkgconfig
/libcurl.
pc || true
170 $(LN
) $(STAGING_DIR
)/usr
/bin
/curl-config
$(2)/bin
/
173 define Package
/curl
/install
174 $(INSTALL_DIR
) $(1)/usr
/bin
175 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/curl
$(1)/usr
/bin
/
178 define Package
/libcurl
/install
179 $(INSTALL_DIR
) $(1)/usr
/lib
180 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libcurl.so.
* $(1)/usr
/lib
/
183 $(eval
$(call BuildPackage
,libcurl
))
184 $(eval
$(call BuildPackage
,curl
))