2016-09-06 18:11:34 +02:00
|
|
|
#
|
|
|
|
# spec file for package rust
|
|
|
|
#
|
2016-10-24 09:34:54 +02:00
|
|
|
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
2016-09-06 18:11:34 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
2016-10-24 09:34:54 +02:00
|
|
|
|
|
|
|
|
2016-12-24 00:13:37 +01:00
|
|
|
%global prev_version 1.13.0
|
2016-12-18 09:17:52 +01:00
|
|
|
%bcond_with bootstrap
|
2016-09-06 18:11:34 +02:00
|
|
|
Name: rust
|
2016-12-24 00:13:37 +01:00
|
|
|
Version: 1.14.0
|
2016-09-06 18:11:34 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: A systems programming language
|
|
|
|
License: MIT or Apache-2.0
|
|
|
|
Group: Development/Languages/Other
|
|
|
|
Url: http://www.rust-lang.org
|
|
|
|
Source0: https://static.rust-lang.org/dist/rustc-%{version}-src.tar.gz
|
|
|
|
Source100: %{name}-rpmlintrc
|
2016-10-24 09:34:54 +02:00
|
|
|
# PATCH-FIX-OPENSUSE: Set DT_SONAME when building dylibs
|
2016-12-18 09:17:52 +01:00
|
|
|
Patch1: add-soname.patch
|
2016-12-18 01:34:00 +01:00
|
|
|
BuildRequires: cmake
|
2016-09-06 18:11:34 +02:00
|
|
|
BuildRequires: curl
|
2016-12-18 01:34:00 +01:00
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: python
|
|
|
|
Recommends: cargo
|
|
|
|
#FIXME: currently there's no way to have rustc and rustc-beta installed
|
2016-12-18 10:11:16 +01:00
|
|
|
|
|
|
|
Conflicts: rust < %{version}
|
|
|
|
Conflicts: rustc <= %{version}
|
|
|
|
Conflicts: rustc-bootstrap <= %{version}
|
|
|
|
|
2016-12-18 01:34:00 +01:00
|
|
|
Obsoletes: rustc-1_9
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
|
2016-09-06 18:11:34 +02:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
BuildRequires: fdupes
|
|
|
|
%endif
|
2016-12-18 01:34:00 +01:00
|
|
|
%if %{with bootstrap}
|
|
|
|
BuildRequires: rustc-bootstrap <= %{prev_version}
|
|
|
|
BuildRequires: rustc-bootstrap >= %{prev_version}
|
|
|
|
%else
|
2016-12-24 00:13:37 +01:00
|
|
|
%ifnarch armv7hl
|
2016-12-18 01:34:00 +01:00
|
|
|
BuildRequires: rust <= %{version}
|
|
|
|
BuildRequires: rust >= %{prev_version}
|
|
|
|
%endif
|
2016-12-24 00:13:37 +01:00
|
|
|
%ifarch armv7hl
|
|
|
|
BuildRequires: rustc-bootstrap <= %{prev_version}
|
|
|
|
BuildRequires: rustc-bootstrap >= %{prev_version}
|
|
|
|
%endif
|
|
|
|
%endif
|
2016-09-06 18:11:34 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
Rust is a systems programming language focused on three goals:
|
|
|
|
safety, speed, and concurrency. It maintains these goals without
|
|
|
|
having a garbage collector, making it a useful language for a
|
|
|
|
number of use cases other languages are not good at: embedding
|
|
|
|
in other languages, programs with specific space and time
|
|
|
|
requirements, and writing low-level code, like device drivers
|
|
|
|
and operating systems. It improves on current languages targeting
|
|
|
|
this space by having a number of compile-time safety checks
|
|
|
|
that produce no runtime overhead, while eliminating all
|
|
|
|
data races. Rust also aims to achieve "zero-cost abstractions",
|
|
|
|
even though some of these abstractions feel like those of a
|
|
|
|
high-level language. Even then, Rust still allows precise
|
|
|
|
control like a low-level language would.
|
|
|
|
|
|
|
|
%package doc
|
|
|
|
Summary: Rust documentation
|
|
|
|
Group: Development/Languages/Other
|
|
|
|
|
|
|
|
%description doc
|
|
|
|
Documentation for the Rust language.
|
|
|
|
|
2016-09-09 13:49:01 +02:00
|
|
|
%package gdb
|
2016-09-06 18:11:34 +02:00
|
|
|
Summary: Gdb integration for rust binaries
|
|
|
|
Group: Development/Languages/Other
|
2016-12-18 01:34:00 +01:00
|
|
|
Supplements: packageand(%{name}:gdb)
|
2016-09-09 13:49:01 +02:00
|
|
|
Provides: rust-%{rustc_version}-gdb = %{version}
|
2016-12-18 01:34:00 +01:00
|
|
|
Provides: rustc:%{_bindir}/rust-gdb
|
2016-10-26 10:48:07 +02:00
|
|
|
Obsoletes: rust-1_9-gdb = %{version}
|
|
|
|
Provides: rust-1_9-gdb <= %{version}
|
|
|
|
Obsoletes: rustc-1_9-gdb = %{version}
|
|
|
|
Provides: rustc-1_9-gdb <= %{version}
|
|
|
|
Obsoletes: rust-1_10-gdb = %{version}
|
|
|
|
Provides: rust-1_10-gdb <= %{version}
|
|
|
|
Obsoletes: rustc-1_10-gdb = %{version}
|
|
|
|
Provides: rustc-1_10-gdb <= %{version}
|
2016-09-06 18:11:34 +02:00
|
|
|
|
2016-09-09 13:49:01 +02:00
|
|
|
%description gdb
|
2016-09-06 18:11:34 +02:00
|
|
|
This subpackage provides pretty printers and a wrapper script for
|
|
|
|
invoking gdb on rust binaries.
|
|
|
|
|
|
|
|
%prep
|
2016-12-17 00:28:41 +01:00
|
|
|
%setup -q -n rustc-%{version}
|
2016-09-06 18:11:34 +02:00
|
|
|
%patch1 -p1
|
|
|
|
|
|
|
|
%build
|
2016-12-18 01:34:00 +01:00
|
|
|
export CPPFLAGS="%{optflags}" # eliminate complain from RPMlint
|
|
|
|
# FIXME: you should use the %%configure macro
|
2016-09-06 18:11:34 +02:00
|
|
|
./configure \
|
|
|
|
--enable-local-rust \
|
2016-12-17 00:28:41 +01:00
|
|
|
--local-rust-root=%{_prefix} \
|
2016-10-31 20:32:47 +01:00
|
|
|
--prefix=%{_prefix} \
|
|
|
|
--release-channel=stable
|
2016-09-06 18:11:34 +02:00
|
|
|
make %{?_smp_mflags}
|
2016-12-17 00:28:41 +01:00
|
|
|
%if %{with bootstrap_tarball}
|
|
|
|
make %{?_smp_mflags} dist-tar-bins
|
|
|
|
%endif
|
2016-09-06 18:11:34 +02:00
|
|
|
|
|
|
|
%install
|
2016-12-18 01:34:00 +01:00
|
|
|
make %{?_smp_mflags} DESTDIR=%{buildroot} install
|
2016-09-06 18:11:34 +02:00
|
|
|
|
|
|
|
# Remove executable permission from HTML documentation
|
|
|
|
# to prevent RPMLINT errors.
|
2016-12-18 01:34:00 +01:00
|
|
|
chmod -R -x+X %{buildroot}%{_datadir}/doc/rust/html
|
2016-09-06 18:11:34 +02:00
|
|
|
|
|
|
|
# Remove files which mention buildroot to prevent RPMLINT errors.
|
2016-12-18 01:34:00 +01:00
|
|
|
rm %{buildroot}%{_prefix}/lib/rustlib/manifest-rust*
|
|
|
|
rm %{buildroot}%{_prefix}/lib/rustlib/install.log
|
2016-09-06 18:11:34 +02:00
|
|
|
|
|
|
|
# Remove lockfile to avoid errors.
|
2016-12-18 01:34:00 +01:00
|
|
|
rm %{buildroot}%{_datadir}/doc/rust/html/.lock
|
2016-09-06 18:11:34 +02:00
|
|
|
|
|
|
|
# allow parallel installation of docs
|
2016-12-18 01:34:00 +01:00
|
|
|
mv %{buildroot}%{_datadir}/doc/rust \
|
|
|
|
%{buildroot}%{_datadir}/doc/rust-%{version}
|
2016-09-06 18:11:34 +02:00
|
|
|
|
|
|
|
%if 0%{?suse_version}
|
2016-12-18 01:34:00 +01:00
|
|
|
%fdupes %{buildroot}%{_prefix}
|
2016-12-17 00:28:41 +01:00
|
|
|
%endif
|
|
|
|
|
2016-09-06 18:11:34 +02:00
|
|
|
%post -p /sbin/ldconfig
|
|
|
|
%postun -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%{_bindir}/rustc
|
|
|
|
%{_bindir}/rustdoc
|
|
|
|
%{_mandir}/*/rust*
|
2016-12-18 01:34:00 +01:00
|
|
|
%exclude %{_datadir}/doc/rust
|
2016-09-06 18:11:34 +02:00
|
|
|
%{_prefix}/lib/*.so
|
|
|
|
%{_prefix}/lib/rustlib
|
2016-12-18 01:34:00 +01:00
|
|
|
%exclude %{_prefix}/lib/rustlib%{_sysconfdir}/gdb_load_rust_pretty_printers.py
|
|
|
|
%exclude %{_prefix}/lib/rustlib%{_sysconfdir}/gdb_rust_pretty_printing.py
|
2016-09-06 18:11:34 +02:00
|
|
|
|
|
|
|
%files doc
|
|
|
|
%defattr(-,root,root)
|
2016-12-18 01:34:00 +01:00
|
|
|
%{_datadir}/doc/rust-%{version}
|
2016-09-06 18:11:34 +02:00
|
|
|
|
2016-09-09 13:49:01 +02:00
|
|
|
%files gdb
|
2016-09-06 18:11:34 +02:00
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%{_bindir}/rust-gdb
|
2016-12-18 01:34:00 +01:00
|
|
|
%{_prefix}/lib/rustlib%{_sysconfdir}/gdb_load_rust_pretty_printers.py
|
|
|
|
%{_prefix}/lib/rustlib%{_sysconfdir}/gdb_rust_pretty_printing.py
|
2016-12-17 00:28:41 +01:00
|
|
|
|
2016-09-06 18:11:34 +02:00
|
|
|
%changelog
|