From 9f20441b6a8152227d2c6e2fa306c6241c650066ba0a4ff24c92fb4a40f58783 Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Wed, 24 Jan 2018 06:37:34 +0000 Subject: [PATCH] Accepting request 568505 from openSUSE:Factory:Staging:O - Format with spec-cleaner - Use python3 to run the install/build script as python2 is being phased out - State exclusivearch for all of ix86 and then specify we build as i686 which is bit more obvious OBS-URL: https://build.opensuse.org/request/show/568505 OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=144 --- rust.changes | 9 +++++++ rust.spec | 73 +++++++++++++++++++++------------------------------- 2 files changed, 38 insertions(+), 44 deletions(-) diff --git a/rust.changes b/rust.changes index 8a6a28d..7e93aad 100644 --- a/rust.changes +++ b/rust.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Jan 23 09:18:27 UTC 2018 - tchvatal@suse.com + +- Format with spec-cleaner +- Use python3 to run the install/build script as python2 is being + phased out +- State exclusivearch for all of ix86 and then specify we build as + i686 which is bit more obvious + ------------------------------------------------------------------- Mon Jan 22 11:21:42 UTC 2018 - mmanu84@outlook.de diff --git a/rust.spec b/rust.spec index d64e182..40ed45c 100644 --- a/rust.spec +++ b/rust.spec @@ -19,8 +19,6 @@ %global prev_rust 1.22.1 %global cargo_version 0.24.0 -%bcond_with rust_bootstrap - %global rust_arch %{_arch} %global abi gnu %ifarch armv7hl @@ -38,20 +36,19 @@ %global rust_arch powerpc64le %endif # Must restrict the x86 build to i686 since i586 is currently unsupported -%ifarch %ix86 +%ifarch %{ix86} %global rust_arch i686 %endif %global rust_triple %{rust_arch}-unknown-linux-%{abi} - %global dl_url https://static.rust-lang.org/dist %global common_libdir %{_prefix}/lib %global rustlibdir %{common_libdir}/rustlib - +%bcond_with rust_bootstrap Name: rust Version: 1.23.0 Release: 0 Summary: A systems programming language -License: MIT or Apache-2.0 +License: MIT OR Apache-2.0 Group: Development/Languages/Other Url: http://www.rust-lang.org Source0: %{dl_url}/rustc-%{version}-src.tar.gz @@ -69,31 +66,23 @@ Source107: cargo-%{cargo_version}-s390x-unknown-linux-gnu.tar.gz BuildRequires: ccache BuildRequires: cmake >= 3.4.3 BuildRequires: curl +BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: llvm-devel BuildRequires: ninja BuildRequires: procps -BuildRequires: python -Recommends: cargo +BuildRequires: python3-base Recommends: %{name}-doc Recommends: %{name}-std - -Conflicts: otherproviders(rust) +Recommends: cargo Conflicts: rustc-bootstrap - -BuildRoot: %{_tmppath}/%{name}-%{version}-build +Conflicts: rust # Restrict the architectures as building rust relies on being initially # bootstrapped before we can build the n+1 release -ExclusiveArch: x86_64 %{arm} aarch64 ppc64 ppc64le s390x -%ifarch %ix86 -ExclusiveArch: i586 i686 +ExclusiveArch: x86_64 %{arm} aarch64 ppc64 ppc64le s390x %{ix86} +%ifarch %{ix86} BuildArch: i686 %endif - -%if 0%{?suse_version} -BuildRequires: fdupes -%endif - %if %{with rust_bootstrap} BuildRequires: rust-std-bootstrap = %{prev_rust} BuildRequires: rustc-bootstrap = %{prev_rust} @@ -122,8 +111,8 @@ control like a low-level language would. %package -n rust-std Summary: Standard library for Rust Group: Development/Languages/Other -Conflicts: otherproviders(rust-std) -Requires: %{name} == %{version} +Requires: %{name} = %{version} +Conflicts: rust-std %description -n rust-std This package includes the standard libraries for building @@ -132,8 +121,8 @@ applications written in Rust. %package -n rust-doc Summary: Rust documentation Group: Development/Languages/Other -Conflicts: otherproviders(rust-doc) -Requires: %{name} == %{version} +Requires: %{name} = %{version} +Conflicts: rust-doc %description -n rust-doc Documentation for the Rust language. @@ -141,10 +130,10 @@ Documentation for the Rust language. %package -n rust-gdb Summary: Gdb integration for rust binaries Group: Development/Languages/Other +Requires: %{name} = %{version} Supplements: packageand(%{name}:gdb) +Conflicts: rust-gdb Provides: rustc:%{_bindir}/rust-gdb -Conflicts: otherproviders(rust-gdb) -Requires: %{name} == %{version} %description -n rust-gdb This subpackage provides pretty printers and a wrapper script for @@ -153,8 +142,8 @@ invoking gdb on rust binaries. %package -n rust-src Summary: Sources for the Rust standard library Group: Development/Languages/Other +Requires: %{name} = %{version} BuildArch: noarch -Requires: %{name} == %{version} %description -n rust-src This package includes source files for the Rust standard library. This @@ -165,7 +154,7 @@ as RLS or racer. %ifarch x86_64 %setup -q -T -b 100 -n cargo-%{cargo_version}-%{rust_triple} %endif -%ifarch %ix86 +%ifarch %{ix86} %setup -q -T -b 101 -n cargo-%{cargo_version}-i686-unknown-linux-%{abi} %endif %ifarch aarch64 @@ -200,14 +189,17 @@ sed -e 's::%{cargo_bin}:g' \ -e 's::%{_docdir}/%{name}:g' \ %{SOURCE1} > config.toml +# use python3 +sed -i -e "1s|#!.*|#!/usr/bin/python3|" x.py + %build export CPPFLAGS="%{optflags}" # eliminate complain from RPMlint -RUST_BACKTRACE=1 ./x.py build --config config.toml -./x.py doc --config config.toml +RUST_BACKTRACE=1 python3 ./x.py build --config config.toml +python3 ./x.py doc --config config.toml %install -DESTDIR=%{buildroot} ./x.py install -DESTDIR=%{buildroot} ./x.py install src +DESTDIR=%{buildroot} python3 ./x.py install +DESTDIR=%{buildroot} python3 ./x.py install src # Remove executable permission from HTML documentation # to prevent RPMLINT errors. @@ -240,15 +232,12 @@ sed -e '/*\//q' src/libbacktrace/backtrace.h > src/libbacktrace/LICENSE-libbackt # Remove the license files from _docdir: make install put duplicates there rm %{buildroot}%{_docdir}/%{name}/{README.md,COPYRIGHT,LICENSE-APACHE,LICENSE-MIT} -%if 0%{?suse_version} %fdupes %{buildroot}%{_prefix} -%endif %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files -%defattr(-,root,root,-) %if 0%{?suse_version} == 1315 %doc COPYRIGHT LICENSE-APACHE LICENSE-MIT %doc src/libbacktrace/LICENSE-libbacktrace @@ -269,7 +258,6 @@ rm %{buildroot}%{_docdir}/%{name}/{README.md,COPYRIGHT,LICENSE-APACHE,LICENSE-MI %exclude %{rustlibdir}/src %files -n rust-std -%defattr(-,root,root) %dir %{rustlibdir} %dir %{rustlibdir}/%{rust_triple} %dir %{rustlibdir}/%{rust_triple}/lib @@ -277,23 +265,20 @@ rm %{buildroot}%{_docdir}/%{name}/{README.md,COPYRIGHT,LICENSE-APACHE,LICENSE-MI %{rustlibdir}/%{rust_triple}/lib/*.so %files -n rust-gdb -%defattr(-,root,root,-) %{_bindir}/rust-gdb %dir %{rustlibdir} -%dir %{rustlibdir}/etc -%{rustlibdir}/etc/debugger_pretty_printers_common.py -%{rustlibdir}/etc/gdb_load_rust_pretty_printers.py -%{rustlibdir}/etc/gdb_rust_pretty_printing.py -%{rustlibdir}/etc/lldb_rust_formatters.py +%dir %{rustlibdir}%{_sysconfdir} +%{rustlibdir}%{_sysconfdir}/debugger_pretty_printers_common.py +%{rustlibdir}%{_sysconfdir}/gdb_load_rust_pretty_printers.py +%{rustlibdir}%{_sysconfdir}/gdb_rust_pretty_printing.py +%{rustlibdir}%{_sysconfdir}/lldb_rust_formatters.py %files -n rust-doc -%defattr(-,root,root) %dir %{_docdir}/%{name} %dir %{_docdir}/%{name}/html %doc %{_docdir}/%{name}/html/* %files -n rust-src -%defattr(-,root,root) %dir %{rustlibdir} %{rustlibdir}/src