/[packages]/cauldron/rust/current/SPECS/rust.spec
ViewVC logotype

Contents of /cauldron/rust/current/SPECS/rust.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1623405 - (show annotations) (download)
Mon Sep 7 21:59:50 2020 UTC (3 years, 7 months ago) by akien
File size: 22960 byte(s)
Drop typenum PR#115 patch which has finally been upstreamed (SILENT)
1 # (akien) This package is synced with Fedora / Josh Stone's spec.
2 # The aim is to work with them on a rust packaging policy we could share,
3 # so that we can ensure a good packaging and share the workload.
4
5
6 # Only x86_64 and i686 are Tier 1 platforms at this time.
7 # https://forge.rust-lang.org/platform-support.html
8 %global rust_arches x86_64 i686 i586 armv7hl aarch64 ppc64 ppc64le s390x
9
10 # The channel can be stable, beta, or nightly
11 %{!?channel: %global channel stable}
12
13 # To bootstrap from scratch, set the channel and date from src/stage0.txt
14 # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24
15 # or nightly wants some beta-YYYY-MM-DD
16 # Note that cargo matches the program version here, not its crate version.
17 %global bootstrap_rust 1.44.0
18 %global bootstrap_cargo 1.44.0
19 %global bootstrap_channel 1.44.0
20 %global bootstrap_date 2020-06-04
21
22 # Only the specified arches will use bootstrap binaries.
23 #global bootstrap_arches %%{rust_arches}
24
25 # To bootstrap a compiler for a Tier 2 platform, we first need to build a
26 # compiler for a Tier 1 platform that targets the Tier 2 platform, then use
27 # the resulting compiler in a second build. Set bootstrap_build_arch to the
28 # Tier 1 arch for the first build, leave it undefined for the second build.
29 %bcond_with bootstrap_i586
30 %if %with bootstrap_i586
31 %ifarch i586
32 %global bootstrap_build_arch i686
33 %endif
34 %endif
35
36 # Using llvm-static may be helpful as an opt-in, e.g. to aid LLVM rebases.
37 %bcond_with llvm_static
38
39 # We can also choose to just use Rust's bundled LLVM, in case the system LLVM
40 # is insufficient. Rust currently requires LLVM 8.0+.
41 %if 0%{?rhel} && !0%{?epel}
42 # (akien) Hacks below are needed on mga's buildsystem when we have to rebootstrap llvm.
43 # Bundled LLVM has underlinking issues:
44 %global _disable_ld_no_undefined 1
45 %ifarch %{arm} %ix86
46 # Decrease debuginfo verbosity to reduce memory consumption during final library linking
47 %global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
48 %endif
49 %bcond_without bundled_llvm
50 %else
51 %bcond_with bundled_llvm
52 %endif
53
54 # libgit2-sys expects to use its bundled library, which is sometimes just a
55 # snapshot of libgit2's master branch. This can mean the FFI declarations
56 # won't match our released libgit2.so, e.g. having changed struct fields.
57 # So, tread carefully if you toggle this...
58 %bcond_without bundled_libgit2
59
60 %if 0%{?rhel}
61 %bcond_without bundled_libssh2
62 %else
63 %bcond_with bundled_libssh2
64 %endif
65
66 # LLDB isn't available everywhere...
67 %if !0%{?rhel}
68 %bcond_without lldb
69 %else
70 %bcond_with lldb
71 %endif
72
73 %if 0%{?mageia}
74 # (akien) Added by tv in mga8/rust 1.37.0.
75 %global _python_bytecompile_extra 0
76 %endif
77
78 Name: rust
79 Version: 1.45.2
80 Release: %mkrel 1
81 Summary: The Rust Programming Language
82 %if 0%{?mageia}
83 Group: Development/Other
84 %endif
85 License: (ASL 2.0 or MIT) and (BSD and MIT)
86 # ^ written as: (rust itself) and (bundled libraries)
87 URL: https://www.rust-lang.org
88 ExclusiveArch: %{rust_arches}
89
90 %if "%{channel}" == "stable"
91 %global rustc_package rustc-%{version}-src
92 %else
93 %global rustc_package rustc-%{channel}-src
94 %endif
95 Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz
96
97 # Get the Rust triple for any arch.
98 %{lua: function rust_triple(arch)
99 local abi = "gnu"
100 if arch == "armv7hl" then
101 arch = "armv7"
102 abi = "gnueabihf"
103 elseif arch == "ppc64" then
104 arch = "powerpc64"
105 elseif arch == "ppc64le" then
106 arch = "powerpc64le"
107 end
108 return arch.."-unknown-linux-"..abi
109 end}
110
111 %if %defined bootstrap_build_arch
112 %global rust_triple %{lua: print(rust_triple(rpm.expand("%{bootstrap_build_arch}")))}
113 %global target_triple %{lua: print(rust_triple(rpm.expand("%{_target_cpu}")))}
114 %else
115 %global rust_triple %{lua: print(rust_triple(rpm.expand("%{_target_cpu}")))}
116 %global target_triple %{rust_triple}
117 %endif
118
119 %if %defined bootstrap_arches
120 # For each bootstrap arch, add an additional binary Source.
121 # Also define bootstrap_source just for the current target.
122 %{lua: do
123 local bootstrap_arches = {}
124 for arch in string.gmatch(rpm.expand("%{bootstrap_arches}"), "%S+") do
125 table.insert(bootstrap_arches, arch)
126 end
127 local base = rpm.expand("https://static.rust-lang.org/dist/%{bootstrap_date}"
128 .."/rust-%{bootstrap_channel}")
129 local target_arch = rpm.expand("%{_target_cpu}")
130 for i, arch in ipairs(bootstrap_arches) do
131 print(string.format("Source%d: %s-%s.tar.xz\n",
132 i, base, rust_triple(arch)))
133 if arch == target_arch then
134 rpm.define("bootstrap_source "..i)
135 end
136 end
137 end}
138 %endif
139
140 %ifarch %{bootstrap_arches}
141 %global bootstrap_root rust-%{bootstrap_channel}-%{rust_triple}
142 %global local_rust_root %{_builddir}/%{bootstrap_root}/usr
143 Provides: bundled(%{name}-bootstrap) = %{bootstrap_rust}
144 %else
145 BuildRequires: cargo >= %{bootstrap_cargo}
146 %if 0%{?fedora} >= 27
147 BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{version})
148 %else
149 BuildRequires: %{name} >= %{bootstrap_rust}
150 BuildConflicts: %{name} > %{version}
151 %endif
152 %global local_rust_root %{_prefix}
153 %endif
154
155 BuildRequires: make
156 BuildRequires: gcc
157 BuildRequires: gcc-c++
158 BuildRequires: ncurses-devel
159 BuildRequires: curl
160 BuildRequires: pkgconfig(libcurl)
161 BuildRequires: pkgconfig(liblzma)
162 BuildRequires: pkgconfig(openssl)
163 BuildRequires: pkgconfig(zlib)
164
165 %if %without bundled_libgit2
166 BuildRequires: pkgconfig(libgit2) >= 1.0.0
167 %endif
168
169 %if %without bundled_libssh2
170 # needs libssh2_userauth_publickey_frommemory
171 BuildRequires: pkgconfig(libssh2) >= 1.6.0
172 %endif
173
174 %if 0%{?rhel} && 0%{?rhel} <= 7
175 %global python python2
176 %else
177 %global python python3
178 %endif
179 BuildRequires: %{python}
180
181 %if %with bundled_llvm
182 BuildRequires: cmake3 >= 3.4.3
183 Provides: bundled(llvm) = 10.0.1
184 %else
185 BuildRequires: cmake >= 2.8.11
186 %if 0%{?epel}
187 %global llvm llvm9.0
188 %endif
189 %if %defined llvm
190 %global llvm_root %{_libdir}/%{llvm}
191 %else
192 %global llvm llvm
193 %global llvm_root %{_prefix}
194 %endif
195 BuildRequires: %{llvm}-devel >= 8.0
196 %if %with llvm_static
197 BuildRequires: %{llvm}-static
198 BuildRequires: libffi-devel
199 %endif
200 %endif
201
202 # make check needs "ps" for src/test/run-pass/wait-forked-but-failed-child.rs
203 BuildRequires: procps-ng
204
205 # debuginfo-gdb tests need gdb
206 BuildRequires: gdb
207
208 # TODO: work on unbundling these!
209 Provides: bundled(libbacktrace) = 1.0.20200219
210
211 # Virtual provides for folks who attempt "dnf install rustc"
212 Provides: rustc = %{version}-%{release}
213 Provides: rustc%{?_isa} = %{version}-%{release}
214
215 # Always require our exact standard library
216 Requires: %{name}-std-static%{?_isa} = %{version}-%{release}
217
218 # The C compiler is needed at runtime just for linking. Someday rustc might
219 # invoke the linker directly, and then we'll only need binutils.
220 # https://github.com/rust-lang/rust/issues/11937
221 %if 0%{?mageia}
222 Requires: gcc
223 %else
224 Requires: /usr/bin/cc
225 %endif
226
227 # ALL Rust libraries are private, because they don't keep an ABI.
228 %global _privatelibs lib(.*-[[:xdigit:]]{16}*|rustc.*)[.]so.*
229 %global __provides_exclude ^(%{_privatelibs})$
230 %global __requires_exclude ^(%{_privatelibs})$
231 %global __provides_exclude_from ^(%{_docdir}|%{rustlibdir}/src)/.*$
232 %global __requires_exclude_from ^(%{_docdir}|%{rustlibdir}/src)/.*$
233
234 # While we don't want to encourage dynamic linking to Rust shared libraries, as
235 # there's no stable ABI, we still need the unallocated metadata (.rustc) to
236 # support custom-derive plugins like #[proc_macro_derive(Foo)]. But eu-strip is
237 # very eager by default, so we have to limit it to -g, only debugging symbols.
238 %if 0%{?fedora} >= 27 || 0%{?mageia} >= 7
239 # Newer find-debuginfo.sh supports --keep-section, which is preferable. rhbz1465997
240 %global _find_debuginfo_opts --keep-section .rustc
241 %else
242 %global _find_debuginfo_opts -g
243 %undefine _include_minidebuginfo
244 %endif
245
246 # Use hardening ldflags.
247 %global rustflags -Clink-arg=-Wl,-z,relro,-z,now
248
249 %if %{without bundled_llvm}
250 %if "%{llvm_root}" == "%{_prefix}" || 0%{?scl:1}
251 %global llvm_has_filecheck 1
252 %endif
253 %endif
254
255 %description
256 Rust is a systems programming language that runs blazingly fast, prevents
257 segfaults, and guarantees thread safety.
258
259 This package includes the Rust compiler and documentation generator.
260
261
262 %package std-static
263 Summary: Standard library for Rust
264
265 %description std-static
266 This package includes the standard libraries for building applications
267 written in Rust.
268
269
270 %package debugger-common
271 Summary: Common debugger pretty printers for Rust
272 BuildArch: noarch
273
274 %description debugger-common
275 This package includes the common functionality for %{name}-gdb and %{name}-lldb.
276
277
278 %package gdb
279 Summary: GDB pretty printers for Rust
280 BuildArch: noarch
281 Requires: gdb
282 Requires: %{name}-debugger-common = %{version}-%{release}
283
284 %description gdb
285 This package includes the rust-gdb script, which allows easier debugging of Rust
286 programs.
287
288
289 %if %with lldb
290
291 %package lldb
292 Summary: LLDB pretty printers for Rust
293 BuildArch: noarch
294 Requires: lldb
295 %if 0%{?fedora} >= 31
296 Requires: python3-lldb
297 %else
298 Requires: python2-lldb
299 %endif
300 Requires: %{name}-debugger-common = %{version}-%{release}
301
302 %description lldb
303 This package includes the rust-lldb script, which allows easier debugging of Rust
304 programs.
305
306 %endif
307
308
309 %package doc
310 Summary: Documentation for Rust
311 # NOT BuildArch: noarch
312 # Note, while docs are mostly noarch, some things do vary by target_arch.
313 # Koji will fail the build in rpmdiff if two architectures build a noarch
314 # subpackage differently, so instead we have to keep its arch.
315
316 %description doc
317 This package includes HTML documentation for the Rust programming language and
318 its standard library.
319
320
321 %package -n cargo
322 Summary: Rust's package manager and build tool
323 %if %with bundled_libgit2
324 Provides: bundled(libgit2) = 1.0.0
325 %endif
326 %if %with bundled_libssh2
327 Provides: bundled(libssh2) = 1.9.0~dev
328 %endif
329 # For tests:
330 BuildRequires: git
331 # Cargo is not much use without Rust
332 Requires: rust
333
334 # "cargo vendor" is a builtin command starting with 1.37. The Obsoletes and
335 # Provides are mostly relevant to RHEL, but harmless to have on Fedora/etc. too
336 Obsoletes: cargo-vendor <= 0.1.23
337 Provides: cargo-vendor = %{version}-%{release}
338
339 %description -n cargo
340 Cargo is a tool that allows Rust projects to declare their various dependencies
341 and ensure that you'll always get a repeatable build.
342
343
344 %package -n cargo-doc
345 Summary: Documentation for Cargo
346 BuildArch: noarch
347 # Cargo no longer builds its own documentation
348 # https://github.com/rust-lang/cargo/pull/4904
349 Requires: rust-doc = %{version}-%{release}
350
351 %description -n cargo-doc
352 This package includes HTML documentation for Cargo.
353
354
355 %package -n rustfmt
356 Summary: Tool to find and fix Rust formatting issues
357 Requires: cargo
358
359 # The component/package was rustfmt-preview until Rust 1.31.
360 Obsoletes: rustfmt-preview < 1.0.0
361 Provides: rustfmt-preview = %{version}-%{release}
362
363 %description -n rustfmt
364 A tool for formatting Rust code according to style guidelines.
365
366
367 %package -n rls
368 Summary: Rust Language Server for IDE integration
369 %if %with bundled_libgit2
370 Provides: bundled(libgit2) = 1.0.0
371 %endif
372 %if %with bundled_libssh2
373 Provides: bundled(libssh2) = 1.9.0~dev
374 %endif
375 Requires: rust-analysis
376 # /usr/bin/rls is dynamically linked against internal rustc libs
377 Requires: %{name}%{?_isa} = %{version}-%{release}
378
379 # The component/package was rls-preview until Rust 1.31.
380 Obsoletes: rls-preview < 1.31.6
381 Provides: rls-preview = %{version}-%{release}
382
383 %description -n rls
384 The Rust Language Server provides a server that runs in the background,
385 providing IDEs, editors, and other tools with information about Rust programs.
386 It supports functionality such as 'goto definition', symbol search,
387 reformatting, and code completion, and enables renaming and refactorings.
388
389
390 %package -n clippy
391 Summary: Lints to catch common mistakes and improve your Rust code
392 Requires: cargo
393 # /usr/bin/clippy-driver is dynamically linked against internal rustc libs
394 Requires: %{name}%{?_isa} = %{version}-%{release}
395
396 # The component/package was clippy-preview until Rust 1.31.
397 Obsoletes: clippy-preview <= 0.0.212
398 Provides: clippy-preview = %{version}-%{release}
399
400 %description -n clippy
401 A collection of lints to catch common mistakes and improve your Rust code.
402
403
404 %package src
405 Summary: Sources for the Rust standard library
406 BuildArch: noarch
407
408 %description src
409 This package includes source files for the Rust standard library. It may be
410 useful as a reference for code completion tools in various editors.
411
412
413 %package analysis
414 Summary: Compiler analysis data for the Rust standard library
415 Requires: rust-std-static%{?_isa} = %{version}-%{release}
416
417 %description analysis
418 This package contains analysis data files produced with rustc's -Zsave-analysis
419 feature for the Rust standard library. The RLS (Rust Language Server) uses this
420 data to provide information about the Rust standard library.
421
422
423 %prep
424
425 %ifarch %{bootstrap_arches}
426 %setup -q -n %{bootstrap_root} -T -b %{bootstrap_source}
427 ./install.sh --components=cargo,rustc,rust-std-%{rust_triple} \
428 --prefix=%{local_rust_root} --disable-ldconfig
429 test -f '%{local_rust_root}/bin/cargo'
430 test -f '%{local_rust_root}/bin/rustc'
431 %endif
432
433 %setup -q -n %{rustc_package}
434
435 %if "%{python}" == "python3"
436 sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure
437 %endif
438
439 %if %without bundled_llvm
440 rm -rf src/llvm-project/
441 %endif
442
443 # Remove other unused vendored libraries
444 rm -rf vendor/curl-sys/curl/
445 rm -rf vendor/jemalloc-sys/jemalloc/
446 rm -rf vendor/libz-sys/src/zlib/
447 rm -rf vendor/lzma-sys/xz-*/
448 rm -rf vendor/openssl-src/openssl/
449
450 %if %without bundled_libgit2
451 rm -rf vendor/libgit2-sys/libgit2/
452 %endif
453
454 %if %without bundled_libssh2
455 rm -rf vendor/libssh2-sys/libssh2/
456 %endif
457
458 # This only affects the transient rust-installer, but let it use our dynamic xz-libs
459 sed -i.lzma -e '/LZMA_API_STATIC/d' src/bootstrap/tool.rs
460
461 # rename bundled license for packaging
462 cp -a vendor/backtrace-sys/src/libbacktrace/LICENSE{,-libbacktrace}
463
464 %if %{with bundled_llvm} && 0%{?epel}
465 mkdir -p cmake-bin
466 ln -s /usr/bin/cmake3 cmake-bin/cmake
467 %global cmake_path $PWD/cmake-bin
468 %endif
469
470 %if %{without bundled_llvm} && %{with llvm_static}
471 # Static linking to distro LLVM needs to add -lffi
472 # https://github.com/rust-lang/rust/issues/34486
473 sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \
474 src/librustc_llvm/lib.rs
475 %endif
476
477 # The configure macro will modify some autoconf-related files, which upsets
478 # cargo when it tries to verify checksums in those files. If we just truncate
479 # that file list, cargo won't have anything to complain about.
480 find vendor -name .cargo-checksum.json \
481 -exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+'
482
483 # Sometimes Rust sources start with #![...] attributes, and "smart" editors think
484 # it's a shebang and make them executable. Then brp-mangle-shebangs gets upset...
485 find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+'
486
487
488 %build
489 # This package fails to build with LTO due to undefined symbols. LTO
490 # was disabled in OpenSuSE as well, but with no real explanation why
491 # beyond the undefined symbols. It really should be investigated further.
492 # Disable LTO
493 %define _lto_cflags %{nil}
494
495 %if %without bundled_libgit2
496 # convince libgit2-sys to use the distro libgit2
497 export LIBGIT2_SYS_USE_PKG_CONFIG=1
498 %endif
499
500 %if %without bundled_libssh2
501 # convince libssh2-sys to use the distro libssh2
502 export LIBSSH2_SYS_USE_PKG_CONFIG=1
503 %endif
504
505 %{?cmake_path:export PATH=%{cmake_path}:$PATH}
506 %{?rustflags:export RUSTFLAGS="%{rustflags}"}
507
508 # We're going to override --libdir when configuring to get rustlib into a
509 # common path, but we'll fix the shared libraries during install.
510 %global common_libdir %{_prefix}/lib
511 %global rustlibdir %{common_libdir}/rustlib
512
513 %ifarch aarch64 %{arm} %{ix86} s390x
514 # full debuginfo is exhausting memory; just do libstd for now
515 # https://github.com/rust-lang/rust/issues/45854
516 %if (0%{?fedora} && 0%{?fedora} < 27) || (0%{?rhel} && 0%{?rhel} <= 7)
517 # Older rpmbuild didn't work with partial debuginfo coverage.
518 %global debug_package %{nil}
519 %define enable_debuginfo --debuginfo-level=0
520 %else
521 %define enable_debuginfo --debuginfo-level=0 --debuginfo-level-std=2
522 %endif
523 %else
524 %define enable_debuginfo --debuginfo-level=2
525 %endif
526
527 # We want the best optimization for std, but it caused problems for rpm-ostree
528 # on ppc64le to have all of the compiler_builtins in a single object:
529 # https://bugzilla.redhat.com/show_bug.cgi?id=1713090
530 %ifnarch %{power64}
531 %define codegen_units_std --set rust.codegen-units-std=1
532 %endif
533
534 %configure --disable-option-checking \
535 --libdir=%{common_libdir} \
536 --build=%{rust_triple} --host=%{rust_triple} --target=%{target_triple} \
537 --python=%{python} \
538 --local-rust-root=%{local_rust_root} \
539 %{!?with_bundled_llvm: --llvm-root=%{llvm_root} \
540 %{!?llvm_has_filecheck: --disable-codegen-tests} \
541 %{!?with_llvm_static: --enable-llvm-link-shared } } \
542 --disable-rpath \
543 %{enable_debuginfo} \
544 --enable-extended \
545 --tools=analysis,cargo,clippy,rls,rustfmt,src \
546 --enable-vendor \
547 --enable-verbose-tests \
548 %{?codegen_units_std} \
549 --release-channel=%{channel}
550
551 %{python} ./x.py build
552 %{python} ./x.py doc
553
554
555 %install
556 %{?cmake_path:export PATH=%{cmake_path}:$PATH}
557 %{?rustflags:export RUSTFLAGS="%{rustflags}"}
558
559 DESTDIR=%{buildroot} %{python} ./x.py install
560
561 # Make sure the shared libraries are in the proper libdir
562 %if "%{_libdir}" != "%{common_libdir}"
563 mkdir -p %{buildroot}%{_libdir}
564 find %{buildroot}%{common_libdir} -maxdepth 1 -type f -name '*.so' \
565 -exec mv -v -t %{buildroot}%{_libdir} '{}' '+'
566 %endif
567
568 # The shared libraries should be executable for debuginfo extraction.
569 find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' \
570 -exec chmod -v +x '{}' '+'
571
572 # The libdir libraries are identical to those under rustlib/. It's easier on
573 # library loading if we keep them in libdir, but we do need them in rustlib/
574 # to support dynamic linking for compiler plugins, so we'll symlink.
575 (cd "%{buildroot}%{rustlibdir}/%{rust_triple}/lib" &&
576 find ../../../../%{_lib} -maxdepth 1 -name '*.so' |
577 while read lib; do
578 if [ -f "${lib##*/}" ]; then
579 # make sure they're actually identical!
580 cmp "$lib" "${lib##*/}"
581 ln -v -f -s -t . "$lib"
582 fi
583 done)
584
585 # Remove installer artifacts (manifests, uninstall scripts, etc.)
586 find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+'
587
588 # Remove backup files from %%configure munging
589 find %{buildroot}%{rustlibdir} -type f -name '*.orig' -exec rm -v '{}' '+'
590
591 # https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error
592 # We don't actually need to ship any of those python scripts in rust-src anyway.
593 find %{buildroot}%{rustlibdir}/src -type f -name '*.py' -exec rm -v '{}' '+'
594
595 # FIXME: __os_install_post will strip the rlibs
596 # -- should we find a way to preserve debuginfo?
597
598 # Remove unwanted documentation files (we already package them)
599 rm -f %{buildroot}%{_docdir}/%{name}/README.md
600 rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT
601 rm -f %{buildroot}%{_docdir}/%{name}/LICENSE
602 rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE
603 rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT
604 rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-THIRD-PARTY
605 rm -f %{buildroot}%{_docdir}/%{name}/*.old
606
607 # Sanitize the HTML documentation
608 find %{buildroot}%{_docdir}/%{name}/html -empty -delete
609 find %{buildroot}%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+'
610
611 # Create the path for crate-devel packages
612 mkdir -p %{buildroot}%{_datadir}/cargo/registry
613
614 # Cargo no longer builds its own documentation
615 # https://github.com/rust-lang/cargo/pull/4904
616 mkdir -p %{buildroot}%{_docdir}/cargo
617 ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html
618
619 %if %without lldb
620 rm -f %{buildroot}%{_bindir}/rust-lldb
621 rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
622 %endif
623
624
625 %check
626 %{?cmake_path:export PATH=%{cmake_path}:$PATH}
627 %{?rustflags:export RUSTFLAGS="%{rustflags}"}
628
629 # The results are not stable on koji, so mask errors and just log it.
630 %{python} ./x.py test --no-fail-fast || :
631 %{python} ./x.py test --no-fail-fast cargo || :
632 %{python} ./x.py test --no-fail-fast clippy || :
633 %{python} ./x.py test --no-fail-fast rls || :
634 %{python} ./x.py test --no-fail-fast rustfmt || :
635
636
637 %{?ldconfig_scriptlets}
638
639
640 %files
641 %license COPYRIGHT LICENSE-APACHE LICENSE-MIT
642 %license vendor/backtrace-sys/src/libbacktrace/LICENSE-libbacktrace
643 %doc README.md
644 %{_bindir}/rustc
645 %{_bindir}/rustdoc
646 %{_libdir}/*.so
647 %{_mandir}/man1/rustc.1*
648 %{_mandir}/man1/rustdoc.1*
649 %dir %{rustlibdir}
650 %dir %{rustlibdir}/%{rust_triple}
651 %dir %{rustlibdir}/%{rust_triple}/lib
652 %{rustlibdir}/%{rust_triple}/lib/*.so
653 %if %defined bootstrap_build_arch
654 %dir %{rustlibdir}/%{target_triple}
655 %dir %{rustlibdir}/%{target_triple}/lib
656 %{rustlibdir}/%{target_triple}/lib/*.so
657 %endif
658
659
660 %files std-static
661 %dir %{rustlibdir}
662 %dir %{rustlibdir}/%{rust_triple}
663 %dir %{rustlibdir}/%{rust_triple}/lib
664 %{rustlibdir}/%{rust_triple}/lib/*.rlib
665 %if %defined bootstrap_build_arch
666 %dir %{rustlibdir}/%{target_triple}
667 %dir %{rustlibdir}/%{target_triple}/lib
668 %{rustlibdir}/%{target_triple}/lib/*.rlib
669 %endif
670
671
672 %files debugger-common
673 %dir %{rustlibdir}
674 %dir %{rustlibdir}/etc
675 %{rustlibdir}/etc/debugger_*.py*
676
677
678 %files gdb
679 %{_bindir}/rust-gdb
680 %{rustlibdir}/etc/gdb_*.py*
681 %exclude %{_bindir}/rust-gdbgui
682
683
684 %if %with lldb
685 %files lldb
686 %{_bindir}/rust-lldb
687 %{rustlibdir}/etc/lldb_*.py*
688 %endif
689
690
691 %files doc
692 %docdir %{_docdir}/%{name}
693 %dir %{_docdir}/%{name}
694 %dir %{_docdir}/%{name}/html
695 %{_docdir}/%{name}/html/*/
696 %{_docdir}/%{name}/html/*.html
697 %{_docdir}/%{name}/html/*.css
698 %{_docdir}/%{name}/html/*.ico
699 %{_docdir}/%{name}/html/*.js
700 %{_docdir}/%{name}/html/*.png
701 %{_docdir}/%{name}/html/*.svg
702 %{_docdir}/%{name}/html/*.woff
703 %license %{_docdir}/%{name}/html/*.txt
704 %license %{_docdir}/%{name}/html/*.md
705
706
707 %files -n cargo
708 %license src/tools/cargo/LICENSE-APACHE src/tools/cargo/LICENSE-MIT src/tools/cargo/LICENSE-THIRD-PARTY
709 %doc src/tools/cargo/README.md
710 %{_bindir}/cargo
711 %{_mandir}/man1/cargo*.1*
712 %{_sysconfdir}/bash_completion.d/cargo
713 %{_datadir}/zsh/site-functions/_cargo
714 %dir %{_datadir}/cargo
715 %dir %{_datadir}/cargo/registry
716
717
718 %files -n cargo-doc
719 %docdir %{_docdir}/cargo
720 %dir %{_docdir}/cargo
721 %{_docdir}/cargo/html
722
723
724 %files -n rustfmt
725 %{_bindir}/rustfmt
726 %{_bindir}/cargo-fmt
727 %doc src/tools/rustfmt/{README,CHANGELOG,Configurations}.md
728 %license src/tools/rustfmt/LICENSE-{APACHE,MIT}
729
730
731 %files -n rls
732 %{_bindir}/rls
733 %doc src/tools/rls/{README.md,COPYRIGHT,debugging.md}
734 %license src/tools/rls/LICENSE-{APACHE,MIT}
735
736
737 %files -n clippy
738 %{_bindir}/cargo-clippy
739 %{_bindir}/clippy-driver
740 %doc src/tools/clippy/{README.md,CHANGELOG.md}
741 %license src/tools/clippy/LICENSE-{APACHE,MIT}
742
743
744 %files src
745 %dir %{rustlibdir}
746 %{rustlibdir}/src
747
748
749 %files analysis
750 %{rustlibdir}/%{rust_triple}/analysis/
751 %if %defined bootstrap_build_arch
752 %{rustlibdir}/%{target_triple}/analysis/
753 %endif

  ViewVC Help
Powered by ViewVC 1.1.30