]>
Commit | Line | Data |
---|---|---|
1 | # TODO | |
2 | # - consider a rust-std package containing .../rustlib/$target | |
3 | # This might allow multilib cross-compilation to work naturally. | |
4 | # - package additional tools | |
5 | # | |
6 | # Conditional build: | |
7 | %bcond_with bootstrap # bootstrap using precompiled binaries | |
8 | %bcond_with full_debuginfo # full debuginfo vs only std debuginfo (full takes gigabytes of memory to build) | |
9 | %bcond_without system_llvm # system LLVM | |
10 | %bcond_with tests # build without tests | |
11 | ||
12 | # The channel can be stable, beta, or nightly | |
13 | %define channel stable | |
14 | ||
15 | %if "%{channel}" == "stable" | |
16 | %define rustc_package rustc-%{version}-src | |
17 | %else | |
18 | %define rustc_package rustc-%{channel}-src | |
19 | %endif | |
20 | ||
21 | # To bootstrap from scratch, set the channel and date from src/stage0.json | |
22 | # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 | |
23 | # or nightly wants some beta-YYYY-MM-DD | |
24 | %define bootstrap_rust 1.60.0 | |
25 | %define bootstrap_cargo %{bootstrap_rust} | |
26 | %define bootstrap_date 2022-04-07 | |
27 | ||
28 | %ifarch x32 | |
29 | %define with_cross 1 | |
30 | %endif | |
31 | ||
32 | %if %{without full_debuginfo} | |
33 | %define _enable_debug_packages 0 | |
34 | %endif | |
35 | ||
36 | Summary: The Rust Programming Language | |
37 | Summary(pl.UTF-8): Język programowania Rust | |
38 | Name: rust | |
39 | Version: 1.61.0 | |
40 | Release: 2 | |
41 | # Licenses: (rust itself) and (bundled libraries) | |
42 | License: (Apache v2.0 or MIT) and (BSD and ISC and MIT) | |
43 | Group: Development/Languages | |
44 | Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz | |
45 | # Source0-md5: ba939433d8926a1bc8956acaa6dedf06 | |
46 | Source1: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-x86_64-unknown-linux-gnu.tar.xz | |
47 | # Source1-md5: c8d7fead7bb02d9a0ff886d7f728aa73 | |
48 | Source2: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-i686-unknown-linux-gnu.tar.xz | |
49 | # Source2-md5: cfdb78b2a27fef9bc0154ef9e95af3b8 | |
50 | Source3: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-aarch64-unknown-linux-gnu.tar.xz | |
51 | # Source3-md5: e7f442e50e4f2537c8a0f1cf3c06f432 | |
52 | Source4: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-arm-unknown-linux-gnueabihf.tar.xz | |
53 | # Source4-md5: c1f4a41616406af908201ca1515110b2 | |
54 | Source5: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-armv7-unknown-linux-gnueabihf.tar.xz | |
55 | # Source5-md5: e4eaace7266dddc8ecf68d9798486e1e | |
56 | URL: https://www.rust-lang.org/ | |
57 | # for src/compiler-rt | |
58 | BuildRequires: cmake >= 3.4.3 | |
59 | BuildRequires: curl | |
60 | # make check needs "ps" for src/test/run-pass/wait-forked-but-failed-child.rs | |
61 | BuildRequires: procps | |
62 | BuildRequires: python3 | |
63 | BuildRequires: python3-modules | |
64 | BuildRequires: rpm-build >= 4.6 | |
65 | BuildRequires: rpmbuild(macros) >= 1.752 | |
66 | %if %{without cross} | |
67 | BuildRequires: curl-devel | |
68 | BuildRequires: libgit2-devel >= 1.4.0 | |
69 | BuildRequires: libstdc++-devel | |
70 | %if %{with system_llvm} | |
71 | BuildRequires: llvm >= 12.0 | |
72 | BuildRequires: llvm-devel >= 12.0 | |
73 | %endif | |
74 | BuildRequires: openssl-devel >= 1.0.1 | |
75 | BuildRequires: tar >= 1:1.22 | |
76 | BuildRequires: xz | |
77 | BuildRequires: zlib-devel | |
78 | %endif | |
79 | %if %{without bootstrap} | |
80 | BuildRequires: %{name} >= %{bootstrap_rust} | |
81 | BuildRequires: cargo >= %{bootstrap_cargo} | |
82 | BuildConflicts: %{name} > %{version} | |
83 | %endif | |
84 | %ifarch x32 | |
85 | BuildRequires: glibc-devel(x86-64) | |
86 | BuildRequires: glibc-devel(x86-x32) | |
87 | %if "%{_host_cpu}" == "x86_64" | |
88 | # building on x86_64 host with --target x32-pld-linux | |
89 | BuildRequires: curl-devel | |
90 | BuildRequires: gcc-multilib-x32 | |
91 | BuildRequires: libgit2-devel >= 1.4.0 | |
92 | BuildRequires: libstdc++-devel | |
93 | %{?with_system_llvm:BuildRequires: llvm-devel >= 12.0} | |
94 | BuildRequires: openssl-devel >= 1.0.1 | |
95 | BuildRequires: zlib-devel | |
96 | %else | |
97 | # building x86_64-hosted crosscompiler on x32 host | |
98 | BuildRequires: curl-devel(x86-64) | |
99 | BuildRequires: curl-devel(x86-x32) | |
100 | BuildRequires: gcc-multilib-64 | |
101 | BuildRequires: libgit2-devel(x86-64) >= 1.4.0 | |
102 | BuildRequires: libgit2-devel(x86-x32) >= 1.4.0 | |
103 | BuildRequires: libstdc++-multilib-64-devel | |
104 | %if %{with system_llvm} | |
105 | BuildRequires: llvm-devel(x86-64) >= 12.0 | |
106 | BuildRequires: llvm-devel(x86-x32) >= 12.0 | |
107 | %endif | |
108 | BuildRequires: openssl-devel(x86-64) | |
109 | BuildRequires: openssl-devel(x86-x32) | |
110 | BuildRequires: zlib-devel(x86-64) | |
111 | BuildRequires: zlib-devel(x86-x32) | |
112 | %endif | |
113 | %endif | |
114 | # The C compiler is needed at runtime just for linking. Someday rustc might | |
115 | # invoke the linker directly, and then we'll only need binutils. | |
116 | # https://github.com/rust-lang/rust/issues/11937 | |
117 | Requires: gcc | |
118 | Requires: %{name}-std%{?_isa} = %{version}-%{release} | |
119 | %ifarch x32 | |
120 | Requires: %{name}-std(x86-64) = %{version}-%{release} | |
121 | Requires: gcc-multilib-64 | |
122 | %endif | |
123 | Obsoletes: rust-analyzer < 1.53.0 | |
124 | # Only x86_64 and i686 are Tier 1 platforms at this time. | |
125 | # x32 is Tier 2, only rust-std is available (no rustc or cargo). | |
126 | # https://doc.rust-lang.org/nightly/rustc/platform-support.html | |
127 | ExclusiveArch: %{x8664} %{ix86} x32 aarch64 armv6hl armv7hl armv7hnl | |
128 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
129 | ||
130 | %ifarch x32 | |
131 | %define rust_triple x86_64-unknown-linux-gnux32 | |
132 | %define rust_host_triple x86_64-unknown-linux-gnu | |
133 | %define rust_bootstrap_triple x86_64-unknown-linux-gnu | |
134 | # libs in _libdir are x86_64 64bit | |
135 | %define _lib lib64 | |
136 | %define _libdir %{_prefix}/lib64 | |
137 | %else | |
138 | %ifarch armv6hl | |
139 | %define rust_triple arm-unknown-linux-gnueabihf | |
140 | %define rust_host_triple %{rust_triple} | |
141 | %define rust_bootstrap_triple %{rust_triple} | |
142 | %else | |
143 | %ifarch armv7hl armv7hnl | |
144 | %define rust_triple armv7-unknown-linux-gnueabihf | |
145 | %define rust_host_triple %{rust_triple} | |
146 | %define rust_bootstrap_triple %{rust_triple} | |
147 | %define rust_suppl_targets thumbv7neon-unknown-linux-gnueabihf | |
148 | %else | |
149 | %define rust_triple %{_target_cpu}-unknown-linux-gnu | |
150 | %define rust_host_triple %{rust_triple} | |
151 | %define rust_bootstrap_triple %{rust_triple} | |
152 | %endif | |
153 | %endif | |
154 | %endif | |
155 | ||
156 | %define rust_targets %rust_triple %{?rust_suppl_targets} | |
157 | ||
158 | %if %{without bootstrap} | |
159 | %define local_rust_root %{_prefix} | |
160 | %else | |
161 | %define bootstrap_root rust-%{bootstrap_rust}-%{rust_bootstrap_triple} | |
162 | %define local_rust_root %{_builddir}/%{rustc_package}/%{bootstrap_root} | |
163 | %endif | |
164 | ||
165 | # We're going to override --libdir when configuring to get rustlib into a | |
166 | # common path, but we'll fix the shared libraries during install. | |
167 | # Without this ugly hack, rust would not be able to build itself | |
168 | # for non-bootstrap build, lib64 is just too complicated for it. | |
169 | %define common_libdir %{_prefix}/lib | |
170 | %define rustlibdir %{common_libdir}/rustlib | |
171 | ||
172 | # once_call/once_callable non-function libstdc++ symbols | |
173 | %define skip_post_check_so 'librustc.*llvm.*\.so.*' | |
174 | ||
175 | # ALL Rust libraries are private, because they don't keep an ABI. | |
176 | %define _noautoreqfiles lib.*-[[:xdigit:]]{8}[.]so.* | |
177 | %define _noautoprovfiles lib.*-[[:xdigit:]]{8}[.]so.* | |
178 | ||
179 | %define x_py { \ | |
180 | x_py() { \ | |
181 | local cmd="$1"; \ | |
182 | shift; \ | |
183 | %{?__jobs:CARGO_BUILD_JOBS=%__jobs }%{__python3} ./x.py "$cmd" %{?__jobs:-j %__jobs} "$@"; \ | |
184 | }; x_py } | |
185 | ||
186 | ||
187 | %description | |
188 | Rust is a systems programming language that runs blazingly fast, | |
189 | prevents segfaults, and guarantees thread safety. | |
190 | ||
191 | This package includes the Rust compiler, standard library, and | |
192 | documentation generator. | |
193 | ||
194 | %description -l pl.UTF-8 | |
195 | Rust to systemowy język programowania działający bardzo szybko, | |
196 | zapobiegający naruszeniom ochrony pamięci i gwarantujący | |
197 | bezpieczną wielowątkowość. | |
198 | ||
199 | %package analysis | |
200 | Summary: Metadata about the standard library | |
201 | Summary(pl.UTF-8): Metadane o standardowej bibliotece | |
202 | Group: Development/Tools | |
203 | Requires: %{name} = %{version}-%{release} | |
204 | ||
205 | %description analysis | |
206 | Metadata about the standard library. | |
207 | ||
208 | %description analysis -l pl.UTF-8 | |
209 | Metadane o standardowej bibliotece. | |
210 | ||
211 | %package std | |
212 | Summary: Standard library for Rust | |
213 | Summary(pl.UTF-8): Standardowa biblioteka Rusta | |
214 | Group: Development/Tools | |
215 | Requires: %{name} = %{version}-%{release} | |
216 | ||
217 | %description std | |
218 | Standard library for Rust. | |
219 | ||
220 | %description std -l pl.UTF-8 | |
221 | Standardowa biblioteka Rusta. | |
222 | ||
223 | %package debugger-common | |
224 | Summary: Common debugger pretty printers for Rust | |
225 | Summary(pl.UTF-8): Narzędzia wypisujące struktury Rusa wspólne dla różnych debuggerów | |
226 | Group: Development/Debuggers | |
227 | BuildArch: noarch | |
228 | ||
229 | %description debugger-common | |
230 | This package includes the common functionality for rust-gdb and | |
231 | rust-lldb. | |
232 | ||
233 | %description debugger-common -l pl.UTF-8 | |
234 | Ten pakiet zawiera wspólny kod dla pakietów rust-gdb i rust-lldb. | |
235 | ||
236 | %package gdb | |
237 | Summary: GDB pretty printers for Rust | |
238 | Summary(pl.UTF-8): Ładne wypisywanie struktur Rusta w GDB | |
239 | Group: Development/Debuggers | |
240 | Requires: %{name}-debugger-common = %{version}-%{release} | |
241 | Requires: gdb | |
242 | BuildArch: noarch | |
243 | ||
244 | %description gdb | |
245 | This package includes the rust-gdb script, which allows easier | |
246 | debugging of Rust programs. | |
247 | ||
248 | %description gdb -l pl.UTF-8 | |
249 | Ten pakiet zawiera skrypt rust-gdb, pozwalający na łatwiejsze | |
250 | odpluskwianie programów w języku Rust. | |
251 | ||
252 | %package lldb | |
253 | Summary: LLDB pretty printers for Rust | |
254 | Summary(pl.UTF-8): Ładne wypisywanie struktur Rusta w LLDB | |
255 | Group: Development/Debuggers | |
256 | Requires: %{name}-debugger-common = %{version}-%{release} | |
257 | Requires: lldb | |
258 | BuildArch: noarch | |
259 | ||
260 | %description lldb | |
261 | This package includes the rust-lldb script, which allows easier | |
262 | debugging of Rust programs. | |
263 | ||
264 | %description lldb -l pl.UTF-8 | |
265 | Ten pakiet zawiera skrypt rust-lldb, pozwalający na łatwiejsze | |
266 | odpluskwianie programów w języku Rust. | |
267 | ||
268 | %package rls | |
269 | Summary: Rust Language Server for IDE integration | |
270 | Summary(pl.UTF-8): Rust Language Server do integracji z IDE | |
271 | Group: Development/Tools | |
272 | Requires: %{name} = %{version}-%{release} | |
273 | Requires: %{name}-analysis = %{version}-%{release} | |
274 | ||
275 | %description rls | |
276 | Rust Language Server for IDE integration. | |
277 | ||
278 | %description rls -l pl.UTF-8 | |
279 | Rust Language Server do integracji z IDE. | |
280 | ||
281 | %package doc | |
282 | Summary: Documentation for Rust | |
283 | Summary(pl.UTF-8): Dokumentacja do Rusta | |
284 | Group: Documentation | |
285 | BuildArch: noarch | |
286 | ||
287 | %description doc | |
288 | This package includes HTML documentation for the Rust programming | |
289 | language and its standard library. | |
290 | ||
291 | %description doc -l pl.UTF-8 | |
292 | Ten pakiet zawiera dokumentację w formacie HTML do języka | |
293 | programowania Rust i jego biblioteki standardowej. | |
294 | ||
295 | %package -n cargo | |
296 | Summary: Rust's package manager and build tool | |
297 | Summary(pl.UTF-8): Zarządca pakietów i narzędzie do budowania | |
298 | Group: Development/Tools | |
299 | Requires: %{name}%{?_isa} | |
300 | ||
301 | %description -n cargo | |
302 | Cargo is a tool that allows Rust projects to declare their various | |
303 | dependencies and ensure that you'll always get a repeatable build. | |
304 | ||
305 | %description -n cargo -l pl.UTF-8 | |
306 | Cargo to narzędzie pozwalające projektom w języku Rust deklarować ich | |
307 | zależności i zapewniające powtarzalność procesu budowania. | |
308 | ||
309 | %package -n bash-completion-cargo | |
310 | Summary: Bash completion for cargo command | |
311 | Summary(pl.UTF-8): Bashowe dopełnianie parametrów polecenia cargo | |
312 | Group: Applications/Shells | |
313 | Requires: %{name} = %{version}-%{release} | |
314 | Requires: bash-completion | |
315 | ||
316 | %description -n bash-completion-cargo | |
317 | Bash completion for cargo command. | |
318 | ||
319 | %description -n bash-completion-cargo -l pl.UTF-8 | |
320 | Bashowe dopełnianie parametrów polecenia cargo. | |
321 | ||
322 | %package -n zsh-completion-cargo | |
323 | Summary: Zsh completion for cargo command | |
324 | Summary(pl.UTF-8): Dopełnianie parametrów polecenia cargo w powłoce Zsh | |
325 | Group: Applications/Shells | |
326 | Requires: %{name} = %{version}-%{release} | |
327 | Requires: zsh | |
328 | ||
329 | %description -n zsh-completion-cargo | |
330 | Zsh completion for cargo command. | |
331 | ||
332 | %description -n zsh-completion-cargo -l pl.UTF-8 | |
333 | Dopełnianie parametrów polecenia cargo w powłoce Zsh. | |
334 | ||
335 | %prep | |
336 | %setup -q -n %{rustc_package} | |
337 | ||
338 | %if %{with bootstrap} | |
339 | %ifarch %{x8664} x32 | |
340 | tar xf %{SOURCE1} | |
341 | %endif | |
342 | %ifarch %{ix86} | |
343 | tar xf %{SOURCE2} | |
344 | %endif | |
345 | %ifarch aarch64 | |
346 | tar xf %{SOURCE3} | |
347 | %endif | |
348 | %ifarch armv6hl | |
349 | tar xf %{SOURCE4} | |
350 | %endif | |
351 | %ifarch armv7hl armv7hnl | |
352 | tar xf %{SOURCE5} | |
353 | %endif | |
354 | %{__mv} %{bootstrap_root} %{bootstrap_root}-root | |
355 | %{bootstrap_root}-root/install.sh \ | |
356 | --components=cargo,rustc,rust-std-%{rust_bootstrap_triple} \ | |
357 | --prefix=%{local_rust_root} \ | |
358 | --disable-ldconfig | |
359 | test -f %{local_rust_root}/bin/cargo | |
360 | test -f %{local_rust_root}/bin/rustc | |
361 | %endif | |
362 | ||
363 | # unbundle | |
364 | # We're disabling jemalloc, but rust-src still wants it. | |
365 | #%{__rm} -r src/jemalloc | |
366 | %if %{with system_llvm} | |
367 | %{__rm} -r src/llvm-project | |
368 | mkdir -p src/llvm-project/libunwind | |
369 | %endif | |
370 | ||
371 | # rust-gdb has hardcoded SYSROOT/lib -- let's make it noarch | |
372 | sed -i -e 's#DIRECTORY=".*"#DIRECTORY="%{_datadir}/%{name}/etc"#' \ | |
373 | src/etc/rust-gdb | |
374 | ||
375 | # cargo has hardcoded libexec path - honour rpm _libexecdir | |
376 | %if "%{_libexecdir}" != "%{_prefix}/libexec" | |
377 | suffix="%(echo "%{_libexecdir}" | %{__sed} -e 's,^%{_prefix}/,,')" | |
378 | %{__sed} -i -e 's,"libexec","'${suffix}'",' \ | |
379 | src/bootstrap/dist.rs \ | |
380 | src/tools/cargo/src/cargo/ops/registry/auth.rs | |
381 | %{__sed} -i -e 's,libexec/,'${suffix}'/,' src/tools/cargo/tests/testsuite/credential_process.rs | |
382 | %endif | |
383 | ||
384 | # The configure macro will modify some autoconf-related files, which upsets | |
385 | # cargo when it tries to verify checksums in those files. If we just truncate | |
386 | # that file list, cargo won't have anything to complain about. | |
387 | find vendor -name .cargo-checksum.json \ | |
388 | -exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+' | |
389 | ||
390 | %build | |
391 | export CC="%{__cc}" | |
392 | export CXX="%{__cxx}" | |
393 | export AR="%{__ar}" | |
394 | %configure \ | |
395 | --build=%{rust_bootstrap_triple} \ | |
396 | --host=%{rust_host_triple} \ | |
397 | --target="%(echo %rust_targets | tr ' ' ,)" \ | |
398 | --libdir=%{common_libdir} \ | |
399 | --disable-codegen-tests \ | |
400 | --disable-debuginfo-lines \ | |
401 | %if %{with full_debuginfo} | |
402 | --disable-debuginfo-only-std \ | |
403 | --enable-debuginfo \ | |
404 | %else | |
405 | --enable-debuginfo-only-std \ | |
406 | --disable-debuginfo \ | |
407 | %endif | |
408 | --disable-jemalloc \ | |
409 | --disable-option-checking \ | |
410 | --disable-rpath \ | |
411 | --enable-extended \ | |
412 | --enable-llvm-link-shared \ | |
413 | --enable-vendor \ | |
414 | --local-rust-root=%{local_rust_root} \ | |
415 | --llvm-root=%{_prefix} \ | |
416 | --release-channel=%{channel} \ | |
417 | --set=llvm.static-libstdcpp=false | |
418 | ||
419 | export RUST_BACKTRACE=full | |
420 | %x_py dist --verbose | |
421 | ||
422 | %{?with_tests:%x_py test} | |
423 | ||
424 | %install | |
425 | rm -rf $RPM_BUILD_ROOT | |
426 | ||
427 | export CC="%{__cc}" | |
428 | export CXX="%{__cxx}" | |
429 | export AR="%{__ar}" | |
430 | export DESTDIR=$RPM_BUILD_ROOT | |
431 | %x_py install | |
432 | ||
433 | # Make sure the shared libraries are in the proper libdir | |
434 | %if "%{_libdir}" != "%{common_libdir}" | |
435 | mkdir -p %{buildroot}%{_libdir} | |
436 | find $RPM_BUILD_ROOT%{common_libdir} -maxdepth 1 -type f -name '*.so' \ | |
437 | -exec mv -v -t $RPM_BUILD_ROOT%{_libdir} '{}' '+' | |
438 | %endif | |
439 | ||
440 | # The shared libraries should be executable for debuginfo extraction. | |
441 | find $RPM_BUILD_ROOT%{_libdir}/ -type f -name '*.so' -exec chmod -v +x '{}' '+' | |
442 | ||
443 | # The libdir libraries are identical to those under rustlib/. It's easier on | |
444 | # library loading if we keep them in libdir, but we do need them in rustlib/ | |
445 | # to support dynamic linking for compiler plugins, so we'll symlink. | |
446 | for rust_target in %rust_targets; do | |
447 | for l in libstd libtest ; do | |
448 | liblib=$RPM_BUILD_ROOT%{_libdir}/${l}-*.so | |
449 | libstd=$RPM_BUILD_ROOT%{rustlibdir}/${rust_target}/lib/${l}-*.so | |
450 | if [ "$(basename ${liblib})" = "$(basename ${libstd})" ]; then | |
451 | ln -vfsr ${libstd} $RPM_BUILD_ROOT%{_libdir}/ | |
452 | fi | |
453 | done | |
454 | done | |
455 | ||
456 | # Remove installer artifacts (manifests, uninstall scripts, etc.) | |
457 | find $RPM_BUILD_ROOT%{rustlibdir}/ -maxdepth 1 -type f -exec rm -v '{}' '+' | |
458 | ||
459 | # FIXME: __os_install_post will strip the rlibs | |
460 | # -- should we find a way to preserve debuginfo? | |
461 | ||
462 | # Remove unwanted documentation files (we already package them) | |
463 | %{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}/README.md | |
464 | %{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}/COPYRIGHT | |
465 | %{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}/LICENSE-APACHE | |
466 | %{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}/LICENSE-MIT | |
467 | ||
468 | # Sanitize the HTML documentation | |
469 | find $RPM_BUILD_ROOT%{_docdir}/%{name}/html -empty -delete | |
470 | find $RPM_BUILD_ROOT%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+' | |
471 | ||
472 | # Move rust-gdb's python scripts so they're noarch | |
473 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name} | |
474 | %{__mv} $RPM_BUILD_ROOT%{rustlibdir}/etc $RPM_BUILD_ROOT%{_datadir}/%{name} | |
475 | ||
476 | # We don't need stdlib source | |
477 | %{__rm} -r $RPM_BUILD_ROOT%{rustlibdir}/src | |
478 | ||
479 | # Create the path for crate-devel packages | |
480 | install -d $RPM_BUILD_ROOT%{_datadir}/cargo/registry | |
481 | ||
482 | %clean | |
483 | rm -rf $RPM_BUILD_ROOT | |
484 | ||
485 | %post -p /sbin/ldconfig | |
486 | %postun -p /sbin/ldconfig | |
487 | ||
488 | %files | |
489 | %defattr(644,root,root,755) | |
490 | %doc COPYRIGHT LICENSE-APACHE LICENSE-MIT README.md | |
491 | %attr(755,root,root) %{_bindir}/rust-demangler | |
492 | %attr(755,root,root) %{_bindir}/rustc | |
493 | %attr(755,root,root) %{_bindir}/rustdoc | |
494 | %attr(755,root,root) %{_bindir}/rustfmt | |
495 | %attr(755,root,root) %{_libdir}/librustc_driver-*.so | |
496 | %attr(755,root,root) %{_libdir}/libstd-*.so | |
497 | %attr(755,root,root) %{_libdir}/libtest-*.so | |
498 | %{_mandir}/man1/rustc.1* | |
499 | %{_mandir}/man1/rustdoc.1* | |
500 | %dir %{rustlibdir} | |
501 | ||
502 | %files analysis | |
503 | %defattr(644,root,root,755) | |
504 | %(for rust_target in %rust_targets; do | |
505 | echo "%{rustlibdir}/$rust_target/analysis" | |
506 | done | |
507 | ) | |
508 | ||
509 | %files std | |
510 | %defattr(644,root,root,755) | |
511 | %(for rust_target in %rust_targets; do | |
512 | cat <<EOF | |
513 | %dir %{rustlibdir}/$rust_target | |
514 | %dir %{rustlibdir}/$rust_target/lib | |
515 | %attr(755,root,root) %{rustlibdir}/$rust_target/lib/*.so | |
516 | %{rustlibdir}/$rust_target/lib/*.rlib | |
517 | EOF | |
518 | done | |
519 | ) | |
520 | ||
521 | %files debugger-common | |
522 | %defattr(644,root,root,755) | |
523 | %dir %{_datadir}/%{name} | |
524 | %dir %{_datadir}/%{name}/etc | |
525 | %{_datadir}/%{name}/etc/lldb_commands | |
526 | %{_datadir}/%{name}/etc/rust_types.py | |
527 | ||
528 | %files lldb | |
529 | %defattr(644,root,root,755) | |
530 | %attr(755,root,root) %{_bindir}/rust-lldb | |
531 | %{_datadir}/%{name}/etc/lldb_*.py* | |
532 | ||
533 | %files gdb | |
534 | %defattr(644,root,root,755) | |
535 | %attr(755,root,root) %{_bindir}/rust-gdb | |
536 | %attr(755,root,root) %{_bindir}/rust-gdbgui | |
537 | %{_datadir}/%{name}/etc/gdb_*.py* | |
538 | ||
539 | %files rls | |
540 | %defattr(644,root,root,755) | |
541 | %attr(755,root,root) %{_bindir}/rls | |
542 | ||
543 | %files doc | |
544 | %defattr(644,root,root,755) | |
545 | %dir %{_docdir}/%{name} | |
546 | %doc %{_docdir}/%{name}/html | |
547 | ||
548 | %files -n cargo | |
549 | %defattr(644,root,root,755) | |
550 | %attr(755,root,root) %{_bindir}/cargo | |
551 | %attr(755,root,root) %{_bindir}/cargo-clippy | |
552 | %attr(755,root,root) %{_bindir}/cargo-fmt | |
553 | %attr(755,root,root) %{_bindir}/clippy-driver | |
554 | %attr(755,root,root) %{_libexecdir}/cargo-credential-1password | |
555 | %{_mandir}/man1/cargo*.1* | |
556 | %dir %{_datadir}/cargo | |
557 | %dir %{_datadir}/cargo/registry | |
558 | ||
559 | %files -n bash-completion-cargo | |
560 | %defattr(644,root,root,755) | |
561 | %{_sysconfdir}/bash_completion.d/cargo | |
562 | ||
563 | %files -n zsh-completion-cargo | |
564 | %defattr(644,root,root,755) | |
565 | %{zsh_compdir}/_cargo |