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