/
curl.spec
464 lines (386 loc) · 12.8 KB
/
curl.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# curl is used by steam
# We don't need all the different crypto providers for the 32bit
# builds though - one will do.
# Let's go with openssl because it's the most common.
%ifarch %{x86_64}
%bcond_without compat32
%else
%bcond_with compat32
%endif
%global optflags %{optflags} -Oz
%define major 4
%define libname %mklibname %{name}
%define gnutlsname %mklibname %{name}-gnutls
%define mbedtlsname %mklibname %{name}-mbedtls
%define devname %mklibname %{name} -d
%define gnutlsdev %mklibname %{name}-gnutls -d
%define mbedtlsdev %mklibname %{name}-mbedtls -d
%define devstatic %mklibname %{name} -d -s
%define gnutlsstatic %mklibname %{name}-gnutls -d -s
%define mbedtlsstatic %mklibname %{name}-mbedtls -d -s
%define lib32name libcurl%{major}
%define dev32name libcurl-devel
%bcond_without openssl
%bcond_without gnutls
%bcond_without mbedtls
%global ssl_implementations %{nil}
%if %{with mbedtls}
%global ssl_implementations %{ssl_implementations} mbedtls
%endif
%if %{with gnutls}
%global ssl_implementations %{ssl_implementations} gnutls
%endif
%if %{with openssl}
%global ssl_implementations %{ssl_implementations} openssl
%endif
Summary: Gets a file from a FTP, GOPHER or HTTP server
Name: curl
Version: 8.7.1
Release: 1
License: BSD-like
Group: Networking/Other
Url: https://curl.haxx.se
Source0: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
# (tpg) patches from OpenSuse
# (tpg) temp disable it unless Suse will publish new version of this patch
# Patch0: libcurl-ocloexec.patch
Patch1: dont-mess-with-rpmoptflags.diff
# (tpg) from Debian
Patch2: 04_workaround_as_needed_bug.patch
Patch4: %{name}-7.26.0-multilib.patch
# Try to be binary compatible with ancient versions
# used by non-free games such as Civilization Beyond Earth
Patch5: curl-7.66.0-CURL_GNUTLS_3.patch
BuildRequires: groff-base
BuildRequires: stunnel
BuildRequires: patchelf
BuildRequires: pkgconfig(krb5-gssapi)
# (tpg) we prefer OpenSSL over GnuTLS or nettle
BuildRequires: pkgconfig(openssl)
# (bero) let's also build the gnutls version for
# compatibility with some binaries
BuildRequires: pkgconfig(gnutls)
BuildRequires: pkgconfig(nettle)
BuildRequires: mbedtls-devel
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(libidn2)
BuildRequires: pkgconfig(libssh)
BuildRequires: pkgconfig(ext2fs)
BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(libnghttp2)
BuildRequires: pkgconfig(libpsl)
BuildRequires: nghttp2
BuildRequires: cmake
BuildRequires: ninja
Provides: webfetch
%if %{with compat32}
BuildRequires: libc6
BuildRequires: devel(libz)
BuildRequires: devel(libidn2)
BuildRequires: devel(libssl)
%endif
%description
curl is a client to get documents/files from servers, using any of the
supported protocols. The command is designed to work without user
interaction or any kind of interactivity.
curl offers a busload of useful tricks like proxy support, user
authentication, ftp upload, HTTP post, file transfer resume and more.
This version is compiled with SSL (https) support.
%package -n %{libname}
Summary: A library of functions for file transfer
Group: Networking/Other
Requires: rootcerts >= 1:20070713.00
%rename %{mklibname %{name} %{major}}
%description -n %{libname}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
You should install this package if you plan to use any applications that
use libcurl.
%package -n %{gnutlsname}
Summary: A library of functions for file transfer
Group: Networking/Other
Requires: rootcerts >= 1:20070713.00
%rename %{mklibname %{name}-gnutls %{major}}
%description -n %{gnutlsname}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
This version uses gnutls rather than OpenSSL for encryption. It is provided
primarily for binary compatibility with some third party applications.
%package -n %{mbedtlsname}
Summary: A library of functions for file transfer
Group: Networking/Other
Requires: rootcerts >= 1:20070713.00
%rename %{mklibname %{name}-mbedtls %{major}}
%description -n %{mbedtlsname}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
This version uses mbedtls rather than OpenSSL for encryption. It is provided
primarily for binary compatibility with some third party applications.
%package -n %{devname}
Summary: Header files and static libraries for libcurl
Group: Development/C
Requires: %{name} = %{EVRD}
Requires: %{libname} = %{EVRD}
Provides: %{name}-devel = %{EVRD}
%description -n %{devname}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
You should install this package if you wish to develop applications that
use libcurl.
%package -n %{gnutlsdev}
Summary: Header files and static libraries for libcurl
Group: Development/C
Requires: %{devname} = %{EVRD}
%description -n %{gnutlsdev}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
This version uses GNUtls rather than OpenSSL.
%package -n %{mbedtlsdev}
Summary: Header files and static libraries for libcurl
Group: Development/C
Requires: %{devname} = %{EVRD}
%description -n %{mbedtlsdev}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
This version uses mbedtls rather than OpenSSL.
%package -n %{devstatic}
Summary: Static libraries for libcurl
Group: Development/C
Requires: %{devname} = %{EVRD}
Provides: %{name}-static-devel = %{EVRD}
%description -n %{devstatic}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
You should install this package if you wish to develop applications that
use libcurl.
%package -n %{gnutlsstatic}
Summary: Static libraries for libcurl-gnutls
Group: Development/C
Requires: %{gnutlsdev} = %{EVRD}
Provides: %{name}-gnutls-static-devel = %{EVRD}
%description -n %{gnutlsstatic}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
This version uses gnutls instead of OpenSSL.
%package -n %{mbedtlsstatic}
Summary: Static libraries for libcurl-mbedtls
Group: Development/C
Requires: %{gnutlsdev} = %{EVRD}
Provides: %{name}-gnutls-static-devel = %{EVRD}
%description -n %{mbedtlsstatic}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
You should install this package if you wish to develop applications that
use libcurl.
This version uses mbedtls instead of OpenSSL.
%package examples
Summary: Example files for %{name} development
Group: Development/C
Requires: %{name}-devel = %{EVRD}
BuildArch: noarch
%description examples
Example files for %{name} development.
%package -n zsh-curl
Summary: ZSH completion and functions related to curl
Group: Networking/Other
Requires: %{name} = %{EVRD}
%description -n zsh-curl
ZSH completion and functions related to curl
%if %{with compat32}
%package -n %{lib32name}
Summary: A library of functions for file transfer (32-bit)
Group: Networking/Other
Requires: rootcerts >= 1:20070713.00
%description -n %{lib32name}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
You should install this package if you plan to use any applications that
use libcurl.
%package -n %{dev32name}
Summary: Header files and static libraries for libcurl (32-bit)
Group: Development/C
Requires: %{devname} = %{EVRD}
Requires: %{lib32name} = %{EVRD}
%description -n %{dev32name}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
You should install this package if you wish to develop applications that
use libcurl.
%endif
%prep
%autosetup -p1
%build
autoreconf -fiv
export CONFIGURE_TOP=$(pwd)
EXTRA_CONFIG_openssl="--with-openssl --without-gnutls --without-mbedtls"
EXTRA_CONFIG_gnutls="--without-openssl --with-gnutls --without-mbedtls"
EXTRA_CONFIG_mbedtls="--without-openssl --without-gnutls --with-mbedtls"
%if %{with compat32}
mkdir build32-openssl
cd build32-openssl
%configure32 \
--with-zlib \
--with-libidn2 \
--with-random='/dev/urandom' \
--enable-hidden-symbols \
--enable-versioned-symbols \
--enable-threaded-resolver \
--disable-optimize \
--without-libpsl \
--enable-nonblocking \
--enable-thread \
--enable-crypto-auth \
--enable-libgcc \
--enable-ipv6 \
--without-brotli \
--without-zstd \
--disable-curldebug \
$EXTRA_CONFIG_openssl
%make_build
cd ..
%endif
for ssl in %{ssl_implementations}; do
mkdir build-$ssl
cd build-$ssl
%configure \
--enable-static \
--with-zlib \
--with-lber-lib=lber \
--with-libidn2 \
--with-nghttp2 \
--with-libssh \
--with-random='/dev/urandom' \
--with-zsh-functions-dir \
--enable-hidden-symbols \
--enable-versioned-symbols \
--enable-threaded-resolver \
--enable-optimize \
--enable-nonblocking \
--enable-thread \
--enable-crypto-auth \
--enable-ipv6 \
--with-ca-bundle=%{_sysconfdir}/pki/tls/certs/ca-bundle.crt \
--with-gssapi=%{_prefix} \
--with-zstd \
--disable-ares \
--disable-curldebug \
$(eval echo \${EXTRA_CONFIG_$ssl})
%make_build
cd ..
done
# We don't use cmake for the main builds yet, but let's run a cmake build
# to get cmake integration files...
# FIXME when we've made sure it doesn't create ABI issues, just switch
# to cmake for the main build
# While cross-compiling, PERL_EXECUTABLE needs to be set to HOST perl, but
# the cmake files detect TARGET perl, so override it
export CMAKE_BUILD_DIR=build-cmake
%cmake \
%if %{cross_compiling}
-DPERL_EXECUTABLE=/usr/bin/perl \
%endif
-G Ninja
%ninja_build
# we don't want them in curl-examples:
rm -r docs/examples/.deps ||:
# disable tests that want to connect/run sshd, which is quite impossible
#%check
# Some tests fail at random inside ABF (timeouts?), but work in local builds.
# Let's make a test failure non-fatal for the moment.
#make test TEST_Q='-a -p -v !SCP !SFTP !SOCKS4 !SOCKS5 !TFTP !198' || :
%install
# Right now, we install the cmake build just to get the cmake files...
# FIXME when we've made sure it doesn't create ABI issues, just switch
# to cmake for the main build
%ninja_install -C build-cmake
# Try to be compatible with the legacy FindCURL.cmake file used
# by a number of projects out there...
cat >>%{buildroot}%{_libdir}/cmake/CURL/CURLTargets.cmake <<'EOF'
set(CURL_LIBRARY "-lcurl")
set(CURL_LIBRARIES "-lcurl")
EOF
%if %{with compat32}
%make_install -C build32-openssl
%endif
for ssl in %{ssl_implementations}; do
%make_install -C build-$ssl
if [ "$ssl" != "openssl" ]; then
pushd %{buildroot}%{_libdir}
patchelf --set-soname libcurl-$ssl.so.%{major} libcurl.so.%{major}
for i in libcurl.so.* libcurl.a; do
mv $i ${i/libcurl/libcurl-$ssl}
done
rm libcurl.so
ln -s libcurl-$ssl.so.%{major} libcurl-$ssl.so
cd pkgconfig
sed -e "s,lcurl,lcurl-$ssl,g" libcurl.pc >libcurl-$ssl.pc
popd
fi
done
%make_install -C build-openssl/scripts
# [july 2008] HACK. to be replaced by a real fix
sed -i -e 's!-Wl,--as-needed!!' -e 's!-Wl,--no-undefined!!' %{buildroot}%{_bindir}/%{name}-config
sed -i -e 's!-Wl,--as-needed!!' -e 's!-Wl,--no-undefined!!' -e 's!-L${libdir} !!' %{buildroot}%{_libdir}/pkgconfig/*.pc
# (tpg) use rootcerts's certificates #35917
find %{buildroot} -name ca-bundle.crt -exec rm -f '{}' \;
# we don't package mk-ca-bundle so we don't need man for it
rm -f %{buildroot}%{_mandir}/man1/mk-ca-bundle.1*
# Does anyone actually use fish?
rm -rf %{buildroot}%{_datadir}/fish
%files
%{_bindir}/curl
%doc %{_mandir}/man1/curl.1*
%files -n %{libname}
%{_libdir}/libcurl.so.%{major}*
%if %{with gnutls}
%files -n %{gnutlsname}
%{_libdir}/libcurl-gnutls.so.%{major}*
%endif
%if %{with mbedtls}
%files -n %{mbedtlsname}
%{_libdir}/libcurl-mbedtls.so.%{major}*
%endif
%files -n %{devname}
%doc docs/KNOWN_BUGS docs/FAQ CHANGES
%doc docs/TODO docs/THANKS
%{_bindir}/curl-config
%{_libdir}/libcurl.so
%{_includedir}/curl
%{_libdir}/pkgconfig/libcurl.pc
%{_libdir}/cmake/CURL
%{_datadir}/aclocal/*.m4
%doc %{_mandir}/man1/curl-config.1*
%doc %{_mandir}/man3/*
%if %{with gnutls}
%files -n %{gnutlsdev}
%{_libdir}/libcurl-gnutls.so
%{_libdir}/pkgconfig/libcurl-gnutls.pc
%endif
%if %{with mbedtls}
%files -n %{mbedtlsdev}
%{_libdir}/libcurl-mbedtls.so
%{_libdir}/pkgconfig/libcurl-mbedtls.pc
%endif
%files -n %{devstatic}
%{_libdir}/libcurl.a
%if %{with gnutls}
%files -n %{gnutlsstatic}
%{_libdir}/libcurl-gnutls.a
%endif
%if %{with mbedtls}
%files -n %{mbedtlsstatic}
%{_libdir}/libcurl-mbedtls.a
%endif
%files examples
%doc docs/examples
%if ! %{cross_compiling}
%files -n zsh-curl
%{_datadir}/zsh/site-functions/_curl
%endif
%if %{with compat32}
%files -n %{lib32name}
%{_prefix}/lib/libcurl.so.%{major}*
%files -n %{dev32name}
%{_prefix}/lib/libcurl.so
%{_prefix}/lib/pkgconfig/libcurl.pc
%endif