curl: bugfix: github source url
[feed/packages.git] / net / curl / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=curl
11 PKG_VERSION:=7.85.0
12 PKG_RELEASE:=$(AUTORELEASE)
13
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
20
21 PKG_LICENSE:=MIT
22 PKG_LICENSE_FILES:=COPYING
23 PKG_CPE_ID:=cpe:/a:haxx:libcurl
24
25 PKG_FIXUP:=autoreconf
26 PKG_INSTALL:=1
27 PKG_BUILD_PARALLEL:=1
28
29 PKG_CONFIG_DEPENDS:= \
30 CONFIG_IPV6 \
31 \
32 CONFIG_LIBCURL_WOLFSSL \
33 CONFIG_LIBCURL_GNUTLS \
34 CONFIG_LIBCURL_OPENSSL \
35 CONFIG_LIBCURL_MBEDTLS \
36 CONFIG_LIBCURL_NOSSL \
37 \
38 CONFIG_LIBCURL_LIBIDN2 \
39 CONFIG_LIBCURL_SSH2 \
40 CONFIG_LIBCURL_ZLIB \
41 CONFIG_LIBCURL_ZSTD \
42 \
43 CONFIG_LIBCURL_DICT \
44 CONFIG_LIBCURL_FILE \
45 CONFIG_LIBCURL_FTP \
46 CONFIG_LIBCURL_GOPHER \
47 CONFIG_LIBCURL_HTTP \
48 CONFIG_LIBCURL_IMAP \
49 CONFIG_LIBCURL_LDAP \
50 CONFIG_LIBCURL_LDAPS \
51 CONFIG_LIBCURL_POP3 \
52 CONFIG_LIBCURL_RTSP \
53 CONFIG_LIBCURL_NO_RTSP \
54 CONFIG_LIBCURL_SMB \
55 CONFIG_LIBCURL_NO_SMB \
56 CONFIG_LIBCURL_SMTP \
57 CONFIG_LIBCURL_TELNET \
58 CONFIG_LIBCURL_TFTP \
59 CONFIG_LIBCURL_NGHTTP2 \
60 \
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 \
69 CONFIG_LIBCURL_NTLM \
70 $(if $(CONFIG_LIBCURL_OPENSSL), \
71 CONFIG_OPENSSL_ENGINE \
72 CONFIG_OPENSSL_WITH_COMPRESSION \
73 CONFIG_OPENSSL_WITH_NPN)
74
75 include $(INCLUDE_DIR)/package.mk
76
77 define Package/curl/Default
78 SECTION:=net
79 CATEGORY:=Network
80 URL:=http://curl.se/
81 MAINTAINER:=Stan Grishin <stangri@melmac.ca>
82 endef
83
84 define Package/curl
85 $(call Package/curl/Default)
86 SUBMENU:=File Transfer
87 DEPENDS:=+libcurl
88 TITLE:=A client-side URL transfer utility
89 endef
90
91 define Package/libcurl
92 $(call Package/curl/Default)
93 SECTION:=libs
94 CATEGORY:=Libraries
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
99 MENU:=1
100 ABI_VERSION:=4
101 endef
102
103 define Package/libcurl/config
104 source "$(SOURCE)/Config.in"
105 endef
106
107 TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections
108 TARGET_CPPFLAGS += $(if $(CONFIG_LIBCURL_NTLM),,-DCURL_DISABLE_NTLM)
109 TARGET_LDFLAGS += -Wl,--gc-sections
110
111 CONFIGURE_ARGS += \
112 --disable-debug \
113 --disable-ares \
114 --enable-shared \
115 --enable-static \
116 --disable-manual \
117 --without-nss \
118 --without-librtmp \
119 --without-libidn \
120 --without-ca-path \
121 --without-libpsl \
122 --without-zstd \
123 --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
124 \
125 $(call autoconf_bool,CONFIG_IPV6,ipv6) \
126 \
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) \
131 \
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) \
137 \
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) \
152 \
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) \
161
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/
171 endef
172
173 define Package/curl/install
174 $(INSTALL_DIR) $(1)/usr/bin
175 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl $(1)/usr/bin/
176 endef
177
178 define Package/libcurl/install
179 $(INSTALL_DIR) $(1)/usr/lib
180 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.so.* $(1)/usr/lib/
181 endef
182
183 $(eval $(call BuildPackage,libcurl))
184 $(eval $(call BuildPackage,curl))