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