Accepting request 446855 from home:luke_nukem:branches:devel:languages:rust

Spec file changed to use either the previous packaged version or the rustc-bootstrap for building. v1.11.0 is currently using the bootstrap in an effort to get ARM arch versions up and running.

OBS-URL: https://build.opensuse.org/request/show/446855
OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=18
This commit is contained in:
Luke Jones 2016-12-18 00:34:00 +00:00 committed by Git OBS Bridge
parent a0be3f81a0
commit 0e4a38e467

View File

@ -16,11 +16,8 @@
# #
%bcond_without bootstrap_tarball %global prev_version 1.10.0
%bcond_without bootstrap
%global rustc_version 1_11
%global rustc_build_version 1_10
Name: rust Name: rust
Version: 1.11.0 Version: 1.11.0
Release: 0 Release: 0
@ -28,22 +25,7 @@ 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
ExclusiveArch: %ix86 x86_64 %arm aarch64
# renamed to match upstream and other distros
Obsoletes: rustc-1_9
Provides: rustc = %{version}
Provides: rustc-stable = %{version}
#FIXME: currently there's no way to have rustc and rustc-beta installed
# some alternatives system should be implemented
Conflicts: rustc < %{version}
BuildRequires: rustc-%{rustc_build_version}
Recommends: cargo
Source0: https://static.rust-lang.org/dist/rustc-%{version}-src.tar.gz Source0: https://static.rust-lang.org/dist/rustc-%{version}-src.tar.gz
#use snap.sh to update following lines from "magic" constanst from src/snapshots.txt
Source100: %{name}-rpmlintrc Source100: %{name}-rpmlintrc
# PATCH-FIX-OPENSUSE: Disable embedding timestamp information # PATCH-FIX-OPENSUSE: Disable embedding timestamp information
Patch1: 0003-Disable-embedding-timestamp-information.patch Patch1: 0003-Disable-embedding-timestamp-information.patch
@ -53,16 +35,30 @@ Patch2: add-soname.patch
Patch3: 0001-Fix-armv7-autodetection.patch Patch3: 0001-Fix-armv7-autodetection.patch
# PATCH-FIX-UPSTREAM build arm on armv6 # PATCH-FIX-UPSTREAM build arm on armv6
Patch4: 0002-Add-armv6l-autodetection.patch Patch4: 0002-Add-armv6l-autodetection.patch
BuildRequires: cmake
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: curl BuildRequires: curl
BuildRequires: gcc-c++
BuildRequires: python
Recommends: cargo
#FIXME: currently there's no way to have rustc and rustc-beta installed
# some alternatives system should be implemented
Conflicts: rustc < %{version}
# renamed to match upstream and other distros
Obsoletes: rustc-1_9
Provides: rustc = %{version}
Provides: rustc-stable = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
%if 0%{?suse_version} %if 0%{?suse_version}
BuildRequires: fdupes BuildRequires: fdupes
%endif %endif
BuildRequires: cmake %if %{with bootstrap}
BuildRequires: gcc-c++ BuildRequires: rustc-bootstrap <= %{prev_version}
BuildRequires: python BuildRequires: rustc-bootstrap >= %{prev_version}
%else
BuildRequires: rust <= %{version}
BuildRequires: rust >= %{prev_version}
%endif
%description %description
Rust is a systems programming language focused on three goals: Rust is a systems programming language focused on three goals:
@ -89,8 +85,9 @@ Documentation for the Rust language.
%package gdb %package gdb
Summary: Gdb integration for rust binaries Summary: Gdb integration for rust binaries
Group: Development/Languages/Other Group: Development/Languages/Other
Supplements: packageand(%{name}:gdb)
Provides: rust-%{rustc_version}-gdb = %{version} Provides: rust-%{rustc_version}-gdb = %{version}
Provides: rustc:/usr/bin/rust-gdb Provides: rustc:%{_bindir}/rust-gdb
Obsoletes: rust-1_9-gdb = %{version} Obsoletes: rust-1_9-gdb = %{version}
Provides: rust-1_9-gdb <= %{version} Provides: rust-1_9-gdb <= %{version}
Obsoletes: rustc-1_9-gdb = %{version} Obsoletes: rustc-1_9-gdb = %{version}
@ -99,13 +96,11 @@ Obsoletes: rust-1_10-gdb = %{version}
Provides: rust-1_10-gdb <= %{version} Provides: rust-1_10-gdb <= %{version}
Obsoletes: rustc-1_10-gdb = %{version} Obsoletes: rustc-1_10-gdb = %{version}
Provides: rustc-1_10-gdb <= %{version} Provides: rustc-1_10-gdb <= %{version}
Supplements: packageand(%{name}:gdb)
%description gdb %description gdb
This subpackage provides pretty printers and a wrapper script for This subpackage provides pretty printers and a wrapper script for
invoking gdb on rust binaries. invoking gdb on rust binaries.
%if %{with bootstrap_tarball} %if %{with bootstrap_tarball}
%package bootstrap-tarball %package bootstrap-tarball
Summary: Bootstrap tarball with rust binaries Summary: Bootstrap tarball with rust binaries
@ -124,7 +119,8 @@ package.
%patch4 -p1 %patch4 -p1
%build %build
export CPPFLAGS="$RPM_OPT_FLAGS" # eliminate complain from RPMlint export CPPFLAGS="%{optflags}" # eliminate complain from RPMlint
# FIXME: you should use the %%configure macro
./configure \ ./configure \
--enable-local-rust \ --enable-local-rust \
--local-rust-root=%{_prefix} \ --local-rust-root=%{_prefix} \
@ -136,30 +132,25 @@ make %{?_smp_mflags} dist-tar-bins
%endif %endif
%install %install
make %{?_smp_mflags} install DESTDIR=$RPM_BUILD_ROOT make %{?_smp_mflags} DESTDIR=%{buildroot} install
# Remove executable permission from HTML documentation # Remove executable permission from HTML documentation
# to prevent RPMLINT errors. # to prevent RPMLINT errors.
chmod -R -x+X $RPM_BUILD_ROOT%{_prefix}/share/doc/rust/html chmod -R -x+X %{buildroot}%{_datadir}/doc/rust/html
# Remove files which mention buildroot to prevent RPMLINT errors. # Remove files which mention buildroot to prevent RPMLINT errors.
rm $RPM_BUILD_ROOT%{_prefix}/lib/rustlib/manifest-rust* rm %{buildroot}%{_prefix}/lib/rustlib/manifest-rust*
rm $RPM_BUILD_ROOT%{_prefix}/lib/rustlib/install.log rm %{buildroot}%{_prefix}/lib/rustlib/install.log
# Remove lockfile to avoid errors. # Remove lockfile to avoid errors.
rm $RPM_BUILD_ROOT%{_prefix}/share/doc/rust/html/.lock rm %{buildroot}%{_datadir}/doc/rust/html/.lock
# allow parallel installation of docs # allow parallel installation of docs
mv %{buildroot}%{_prefix}/share/doc/rust \ mv %{buildroot}%{_datadir}/doc/rust \
%{buildroot}%{_prefix}/share/doc/rust-%{version} %{buildroot}%{_datadir}/doc/rust-%{version}
%if 0%{?suse_version} %if 0%{?suse_version}
%fdupes $RPM_BUILD_ROOT%{_prefix} %fdupes %{buildroot}%{_prefix}
%endif
%if %{with bootstrap_tarball}
mkdir -p %{buildroot}%{_prefix}/share/rust-bootstrap-tarball
mv dist/rustc-*.tar.gz %{buildroot}%{_prefix}/share/rust-bootstrap-tarball
%endif %endif
%post -p /sbin/ldconfig %post -p /sbin/ldconfig
@ -170,27 +161,20 @@ mv dist/rustc-*.tar.gz %{buildroot}%{_prefix}/share/rust-bootstrap-tarball
%{_bindir}/rustc %{_bindir}/rustc
%{_bindir}/rustdoc %{_bindir}/rustdoc
%{_mandir}/*/rust* %{_mandir}/*/rust*
%exclude %{_prefix}/share/doc/rust %exclude %{_datadir}/doc/rust
%{_prefix}/lib/*.so %{_prefix}/lib/*.so
%{_prefix}/lib/rustlib %{_prefix}/lib/rustlib
%exclude %{_prefix}/lib/rustlib/etc/gdb_load_rust_pretty_printers.py %exclude %{_prefix}/lib/rustlib%{_sysconfdir}/gdb_load_rust_pretty_printers.py
%exclude %{_prefix}/lib/rustlib/etc/gdb_rust_pretty_printing.py %exclude %{_prefix}/lib/rustlib%{_sysconfdir}/gdb_rust_pretty_printing.py
%files doc %files doc
%defattr(-,root,root) %defattr(-,root,root)
%{_prefix}/share/doc/rust-%{version} %{_datadir}/doc/rust-%{version}
%files gdb %files gdb
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{_bindir}/rust-gdb %{_bindir}/rust-gdb
%{_prefix}/lib/rustlib/etc/gdb_load_rust_pretty_printers.py %{_prefix}/lib/rustlib%{_sysconfdir}/gdb_load_rust_pretty_printers.py
%{_prefix}/lib/rustlib/etc/gdb_rust_pretty_printing.py %{_prefix}/lib/rustlib%{_sysconfdir}/gdb_rust_pretty_printing.py
%if %{with bootstrap_tarball}
%files bootstrap-tarball
%defattr(-,root,root,-)
%dir %{_prefix}/share/rust-bootstrap-tarball
%{_prefix}/share/rust-bootstrap-tarball/rustc-*.tar.gz
%endif
%changelog %changelog