From 0e4a38e467f840759a965ddebefba6b20f06f76ce397f3edb82384994cd2bb94 Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Sun, 18 Dec 2016 00:34:00 +0000 Subject: [PATCH] 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 --- rust.spec | 96 +++++++++++++++++++++++-------------------------------- 1 file changed, 40 insertions(+), 56 deletions(-) diff --git a/rust.spec b/rust.spec index da00c01..74a0139 100644 --- a/rust.spec +++ b/rust.spec @@ -16,11 +16,8 @@ # -%bcond_without bootstrap_tarball - -%global rustc_version 1_11 -%global rustc_build_version 1_10 - +%global prev_version 1.10.0 +%bcond_without bootstrap Name: rust Version: 1.11.0 Release: 0 @@ -28,22 +25,7 @@ Summary: A systems programming language License: MIT or Apache-2.0 Group: Development/Languages/Other 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 - -#use snap.sh to update following lines from "magic" constanst from src/snapshots.txt Source100: %{name}-rpmlintrc # PATCH-FIX-OPENSUSE: Disable embedding timestamp information Patch1: 0003-Disable-embedding-timestamp-information.patch @@ -53,16 +35,30 @@ Patch2: add-soname.patch Patch3: 0001-Fix-armv7-autodetection.patch # PATCH-FIX-UPSTREAM build arm on armv6 Patch4: 0002-Add-armv6l-autodetection.patch - -BuildRoot: %{_tmppath}/%{name}-%{version}-build - +BuildRequires: cmake 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} BuildRequires: fdupes %endif -BuildRequires: cmake -BuildRequires: gcc-c++ -BuildRequires: python +%if %{with bootstrap} +BuildRequires: rustc-bootstrap <= %{prev_version} +BuildRequires: rustc-bootstrap >= %{prev_version} +%else +BuildRequires: rust <= %{version} +BuildRequires: rust >= %{prev_version} +%endif %description Rust is a systems programming language focused on three goals: @@ -89,8 +85,9 @@ Documentation for the Rust language. %package gdb Summary: Gdb integration for rust binaries Group: Development/Languages/Other +Supplements: packageand(%{name}:gdb) Provides: rust-%{rustc_version}-gdb = %{version} -Provides: rustc:/usr/bin/rust-gdb +Provides: rustc:%{_bindir}/rust-gdb Obsoletes: rust-1_9-gdb = %{version} Provides: rust-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} Obsoletes: rustc-1_10-gdb = %{version} Provides: rustc-1_10-gdb <= %{version} -Supplements: packageand(%{name}:gdb) %description gdb This subpackage provides pretty printers and a wrapper script for invoking gdb on rust binaries. - %if %{with bootstrap_tarball} %package bootstrap-tarball Summary: Bootstrap tarball with rust binaries @@ -124,7 +119,8 @@ package. %patch4 -p1 %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 \ --enable-local-rust \ --local-rust-root=%{_prefix} \ @@ -136,30 +132,25 @@ make %{?_smp_mflags} dist-tar-bins %endif %install -make %{?_smp_mflags} install DESTDIR=$RPM_BUILD_ROOT +make %{?_smp_mflags} DESTDIR=%{buildroot} install # Remove executable permission from HTML documentation # 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. -rm $RPM_BUILD_ROOT%{_prefix}/lib/rustlib/manifest-rust* -rm $RPM_BUILD_ROOT%{_prefix}/lib/rustlib/install.log +rm %{buildroot}%{_prefix}/lib/rustlib/manifest-rust* +rm %{buildroot}%{_prefix}/lib/rustlib/install.log # 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 -mv %{buildroot}%{_prefix}/share/doc/rust \ - %{buildroot}%{_prefix}/share/doc/rust-%{version} +mv %{buildroot}%{_datadir}/doc/rust \ + %{buildroot}%{_datadir}/doc/rust-%{version} %if 0%{?suse_version} -%fdupes $RPM_BUILD_ROOT%{_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 +%fdupes %{buildroot}%{_prefix} %endif %post -p /sbin/ldconfig @@ -170,27 +161,20 @@ mv dist/rustc-*.tar.gz %{buildroot}%{_prefix}/share/rust-bootstrap-tarball %{_bindir}/rustc %{_bindir}/rustdoc %{_mandir}/*/rust* -%exclude %{_prefix}/share/doc/rust +%exclude %{_datadir}/doc/rust %{_prefix}/lib/*.so %{_prefix}/lib/rustlib -%exclude %{_prefix}/lib/rustlib/etc/gdb_load_rust_pretty_printers.py -%exclude %{_prefix}/lib/rustlib/etc/gdb_rust_pretty_printing.py +%exclude %{_prefix}/lib/rustlib%{_sysconfdir}/gdb_load_rust_pretty_printers.py +%exclude %{_prefix}/lib/rustlib%{_sysconfdir}/gdb_rust_pretty_printing.py %files doc %defattr(-,root,root) -%{_prefix}/share/doc/rust-%{version} +%{_datadir}/doc/rust-%{version} %files gdb %defattr(-,root,root,-) %{_bindir}/rust-gdb -%{_prefix}/lib/rustlib/etc/gdb_load_rust_pretty_printers.py -%{_prefix}/lib/rustlib/etc/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 +%{_prefix}/lib/rustlib%{_sysconfdir}/gdb_load_rust_pretty_printers.py +%{_prefix}/lib/rustlib%{_sysconfdir}/gdb_rust_pretty_printing.py %changelog