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