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
This commit is contained in:
Luke Jones 2018-01-24 06:37:34 +00:00 committed by Git OBS Bridge
parent 9333a7c5fd
commit 9f20441b6a
2 changed files with 38 additions and 44 deletions

View File

@ -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 Mon Jan 22 11:21:42 UTC 2018 - mmanu84@outlook.de

View File

@ -19,8 +19,6 @@
%global prev_rust 1.22.1 %global prev_rust 1.22.1
%global cargo_version 0.24.0 %global cargo_version 0.24.0
%bcond_with rust_bootstrap
%global rust_arch %{_arch} %global rust_arch %{_arch}
%global abi gnu %global abi gnu
%ifarch armv7hl %ifarch armv7hl
@ -38,20 +36,19 @@
%global rust_arch powerpc64le %global rust_arch powerpc64le
%endif %endif
# Must restrict the x86 build to i686 since i586 is currently unsupported # Must restrict the x86 build to i686 since i586 is currently unsupported
%ifarch %ix86 %ifarch %{ix86}
%global rust_arch i686 %global rust_arch i686
%endif %endif
%global rust_triple %{rust_arch}-unknown-linux-%{abi} %global rust_triple %{rust_arch}-unknown-linux-%{abi}
%global dl_url https://static.rust-lang.org/dist %global dl_url https://static.rust-lang.org/dist
%global common_libdir %{_prefix}/lib %global common_libdir %{_prefix}/lib
%global rustlibdir %{common_libdir}/rustlib %global rustlibdir %{common_libdir}/rustlib
%bcond_with rust_bootstrap
Name: rust Name: rust
Version: 1.23.0 Version: 1.23.0
Release: 0 Release: 0
Summary: A systems programming language Summary: A systems programming language
License: MIT or Apache-2.0 License: MIT OR Apache-2.0
Group: Development/Languages/Other Group: Development/Languages/Other
Url: http://www.rust-lang.org Url: http://www.rust-lang.org
Source0: %{dl_url}/rustc-%{version}-src.tar.gz 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: ccache
BuildRequires: cmake >= 3.4.3 BuildRequires: cmake >= 3.4.3
BuildRequires: curl BuildRequires: curl
BuildRequires: fdupes
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: llvm-devel BuildRequires: llvm-devel
BuildRequires: ninja BuildRequires: ninja
BuildRequires: procps BuildRequires: procps
BuildRequires: python BuildRequires: python3-base
Recommends: cargo
Recommends: %{name}-doc Recommends: %{name}-doc
Recommends: %{name}-std Recommends: %{name}-std
Recommends: cargo
Conflicts: otherproviders(rust)
Conflicts: rustc-bootstrap Conflicts: rustc-bootstrap
Conflicts: rust
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# Restrict the architectures as building rust relies on being initially # Restrict the architectures as building rust relies on being initially
# bootstrapped before we can build the n+1 release # bootstrapped before we can build the n+1 release
ExclusiveArch: x86_64 %{arm} aarch64 ppc64 ppc64le s390x ExclusiveArch: x86_64 %{arm} aarch64 ppc64 ppc64le s390x %{ix86}
%ifarch %ix86 %ifarch %{ix86}
ExclusiveArch: i586 i686
BuildArch: i686 BuildArch: i686
%endif %endif
%if 0%{?suse_version}
BuildRequires: fdupes
%endif
%if %{with rust_bootstrap} %if %{with rust_bootstrap}
BuildRequires: rust-std-bootstrap = %{prev_rust} BuildRequires: rust-std-bootstrap = %{prev_rust}
BuildRequires: rustc-bootstrap = %{prev_rust} BuildRequires: rustc-bootstrap = %{prev_rust}
@ -122,8 +111,8 @@ control like a low-level language would.
%package -n rust-std %package -n rust-std
Summary: Standard library for Rust Summary: Standard library for Rust
Group: Development/Languages/Other Group: Development/Languages/Other
Conflicts: otherproviders(rust-std) Requires: %{name} = %{version}
Requires: %{name} == %{version} Conflicts: rust-std
%description -n rust-std %description -n rust-std
This package includes the standard libraries for building This package includes the standard libraries for building
@ -132,8 +121,8 @@ applications written in Rust.
%package -n rust-doc %package -n rust-doc
Summary: Rust documentation Summary: Rust documentation
Group: Development/Languages/Other Group: Development/Languages/Other
Conflicts: otherproviders(rust-doc) Requires: %{name} = %{version}
Requires: %{name} == %{version} Conflicts: rust-doc
%description -n rust-doc %description -n rust-doc
Documentation for the Rust language. Documentation for the Rust language.
@ -141,10 +130,10 @@ Documentation for the Rust language.
%package -n rust-gdb %package -n rust-gdb
Summary: Gdb integration for rust binaries Summary: Gdb integration for rust binaries
Group: Development/Languages/Other Group: Development/Languages/Other
Requires: %{name} = %{version}
Supplements: packageand(%{name}:gdb) Supplements: packageand(%{name}:gdb)
Conflicts: rust-gdb
Provides: rustc:%{_bindir}/rust-gdb Provides: rustc:%{_bindir}/rust-gdb
Conflicts: otherproviders(rust-gdb)
Requires: %{name} == %{version}
%description -n rust-gdb %description -n rust-gdb
This subpackage provides pretty printers and a wrapper script for This subpackage provides pretty printers and a wrapper script for
@ -153,8 +142,8 @@ invoking gdb on rust binaries.
%package -n rust-src %package -n rust-src
Summary: Sources for the Rust standard library Summary: Sources for the Rust standard library
Group: Development/Languages/Other Group: Development/Languages/Other
Requires: %{name} = %{version}
BuildArch: noarch BuildArch: noarch
Requires: %{name} == %{version}
%description -n rust-src %description -n rust-src
This package includes source files for the Rust standard library. This This package includes source files for the Rust standard library. This
@ -165,7 +154,7 @@ as RLS or racer.
%ifarch x86_64 %ifarch x86_64
%setup -q -T -b 100 -n cargo-%{cargo_version}-%{rust_triple} %setup -q -T -b 100 -n cargo-%{cargo_version}-%{rust_triple}
%endif %endif
%ifarch %ix86 %ifarch %{ix86}
%setup -q -T -b 101 -n cargo-%{cargo_version}-i686-unknown-linux-%{abi} %setup -q -T -b 101 -n cargo-%{cargo_version}-i686-unknown-linux-%{abi}
%endif %endif
%ifarch aarch64 %ifarch aarch64
@ -200,14 +189,17 @@ sed -e 's:<cargo-bin>:%{cargo_bin}:g' \
-e 's:<docdir>:%{_docdir}/%{name}:g' \ -e 's:<docdir>:%{_docdir}/%{name}:g' \
%{SOURCE1} > config.toml %{SOURCE1} > config.toml
# use python3
sed -i -e "1s|#!.*|#!/usr/bin/python3|" x.py
%build %build
export CPPFLAGS="%{optflags}" # eliminate complain from RPMlint export CPPFLAGS="%{optflags}" # eliminate complain from RPMlint
RUST_BACKTRACE=1 ./x.py build --config config.toml RUST_BACKTRACE=1 python3 ./x.py build --config config.toml
./x.py doc --config config.toml python3 ./x.py doc --config config.toml
%install %install
DESTDIR=%{buildroot} ./x.py install DESTDIR=%{buildroot} python3 ./x.py install
DESTDIR=%{buildroot} ./x.py install src DESTDIR=%{buildroot} python3 ./x.py install src
# Remove executable permission from HTML documentation # Remove executable permission from HTML documentation
# to prevent RPMLINT errors. # 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 # Remove the license files from _docdir: make install put duplicates there
rm %{buildroot}%{_docdir}/%{name}/{README.md,COPYRIGHT,LICENSE-APACHE,LICENSE-MIT} rm %{buildroot}%{_docdir}/%{name}/{README.md,COPYRIGHT,LICENSE-APACHE,LICENSE-MIT}
%if 0%{?suse_version}
%fdupes %{buildroot}%{_prefix} %fdupes %{buildroot}%{_prefix}
%endif
%post -p /sbin/ldconfig %post -p /sbin/ldconfig
%postun -p /sbin/ldconfig %postun -p /sbin/ldconfig
%files %files
%defattr(-,root,root,-)
%if 0%{?suse_version} == 1315 %if 0%{?suse_version} == 1315
%doc COPYRIGHT LICENSE-APACHE LICENSE-MIT %doc COPYRIGHT LICENSE-APACHE LICENSE-MIT
%doc src/libbacktrace/LICENSE-libbacktrace %doc src/libbacktrace/LICENSE-libbacktrace
@ -269,7 +258,6 @@ rm %{buildroot}%{_docdir}/%{name}/{README.md,COPYRIGHT,LICENSE-APACHE,LICENSE-MI
%exclude %{rustlibdir}/src %exclude %{rustlibdir}/src
%files -n rust-std %files -n rust-std
%defattr(-,root,root)
%dir %{rustlibdir} %dir %{rustlibdir}
%dir %{rustlibdir}/%{rust_triple} %dir %{rustlibdir}/%{rust_triple}
%dir %{rustlibdir}/%{rust_triple}/lib %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 %{rustlibdir}/%{rust_triple}/lib/*.so
%files -n rust-gdb %files -n rust-gdb
%defattr(-,root,root,-)
%{_bindir}/rust-gdb %{_bindir}/rust-gdb
%dir %{rustlibdir} %dir %{rustlibdir}
%dir %{rustlibdir}/etc %dir %{rustlibdir}%{_sysconfdir}
%{rustlibdir}/etc/debugger_pretty_printers_common.py %{rustlibdir}%{_sysconfdir}/debugger_pretty_printers_common.py
%{rustlibdir}/etc/gdb_load_rust_pretty_printers.py %{rustlibdir}%{_sysconfdir}/gdb_load_rust_pretty_printers.py
%{rustlibdir}/etc/gdb_rust_pretty_printing.py %{rustlibdir}%{_sysconfdir}/gdb_rust_pretty_printing.py
%{rustlibdir}/etc/lldb_rust_formatters.py %{rustlibdir}%{_sysconfdir}/lldb_rust_formatters.py
%files -n rust-doc %files -n rust-doc
%defattr(-,root,root)
%dir %{_docdir}/%{name} %dir %{_docdir}/%{name}
%dir %{_docdir}/%{name}/html %dir %{_docdir}/%{name}/html
%doc %{_docdir}/%{name}/html/* %doc %{_docdir}/%{name}/html/*
%files -n rust-src %files -n rust-src
%defattr(-,root,root)
%dir %{rustlibdir} %dir %{rustlibdir}
%{rustlibdir}/src %{rustlibdir}/src