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