2016-09-06 18:11:34 +02:00
|
|
|
#
|
|
|
|
# spec file for package rust
|
|
|
|
#
|
2017-01-31 04:15:13 +01:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
2017-02-06 09:25:50 +01:00
|
|
|
# Copyright (c) 2017 Luke Jones, luke.nukem.jones@gmail.com
|
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
|
|
|
|
|
|
|
|
2017-02-06 09:25:50 +01:00
|
|
|
%global prev_version 1.14.0
|
2017-02-06 10:07:11 +01:00
|
|
|
%global abi gnu
|
|
|
|
%ifarch armv7hl
|
2017-02-06 10:56:52 +01:00
|
|
|
%global _arch armv7
|
2017-02-06 10:07:11 +01:00
|
|
|
%global abi gnueabihf
|
|
|
|
%endif
|
|
|
|
%ifarch ppc64
|
2017-02-06 10:56:52 +01:00
|
|
|
%global _arch powerpc64
|
2017-02-06 10:07:11 +01:00
|
|
|
%endif
|
|
|
|
%ifarch ppc64le
|
2017-02-06 10:56:52 +01:00
|
|
|
%global _arch powerpc64le
|
2017-02-06 10:07:11 +01:00
|
|
|
%endif
|
|
|
|
%ifarch x86_64
|
2017-02-06 10:56:52 +01:00
|
|
|
%global _arch x86_64
|
2017-02-06 10:07:11 +01:00
|
|
|
%endif
|
|
|
|
%ifarch %{ix86}
|
2017-02-06 10:56:52 +01:00
|
|
|
%global _arch i586
|
2017-02-06 10:07:11 +01:00
|
|
|
%endif
|
|
|
|
%global rust_triple %{_arch}-unknown-linux-%{abi}
|
2017-02-11 19:49:10 +01:00
|
|
|
%bcond_with bootstrap
|
2016-09-06 18:11:34 +02:00
|
|
|
Name: rust
|
2017-02-11 10:48:47 +01:00
|
|
|
Version: 1.15.1
|
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
|
2017-02-06 09:25:50 +01:00
|
|
|
Source1: config.toml
|
2016-09-06 18:11:34 +02:00
|
|
|
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++
|
2017-02-06 09:25:50 +01:00
|
|
|
BuildRequires: llvm-devel
|
|
|
|
BuildRequires: procps
|
2016-12-18 01:34:00 +01:00
|
|
|
BuildRequires: python
|
2017-02-06 09:38:07 +01:00
|
|
|
Recommends: cargo
|
2017-02-06 09:25:50 +01:00
|
|
|
Recommends: %{name}-doc
|
|
|
|
Recommends: %{name}-std
|
2017-01-31 10:42:28 +01:00
|
|
|
Conflicts: rustc-bootstrap
|
2017-02-06 09:25:50 +01:00
|
|
|
Provides: rustc = %{version}
|
|
|
|
Provides: rustc-stable = %{version}
|
2016-12-18 01:34:00 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2017-02-01 10:35:55 +01:00
|
|
|
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64 ppc64le
|
2016-09-06 18:11:34 +02:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
BuildRequires: fdupes
|
|
|
|
%endif
|
2017-02-11 10:48:47 +01:00
|
|
|
%if %{with bootstrap}
|
2017-02-08 05:40:17 +01:00
|
|
|
BuildRequires: cargo-bootstrap
|
2017-02-13 05:04:45 +01:00
|
|
|
BuildRequires: rustc-bootstrap == %{prev_version}
|
2017-02-11 19:39:02 +01:00
|
|
|
%else
|
2017-02-13 05:04:45 +01:00
|
|
|
%ifarch %{arm} aarch64 ppc64 ppc64le
|
|
|
|
BuildRequires: cargo-bootstrap
|
2017-02-13 05:09:18 +01:00
|
|
|
BuildRequires: rustc-bootstrap == %{prev_version}
|
2017-02-13 05:13:22 +01:00
|
|
|
%else
|
|
|
|
%if 0%{?leap_version} == 420200
|
2017-02-13 05:09:18 +01:00
|
|
|
BuildRequires: cargo-bootstrap
|
2017-02-13 05:04:45 +01:00
|
|
|
BuildRequires: rustc-bootstrap == %{prev_version}
|
2017-02-13 05:13:22 +01:00
|
|
|
%else
|
2017-02-08 05:40:17 +01:00
|
|
|
BuildRequires: cargo
|
2017-02-13 04:45:30 +01:00
|
|
|
BuildRequires: rust == %{prev_version}
|
2017-02-13 05:13:22 +01:00
|
|
|
%endif
|
2017-02-13 05:04:45 +01:00
|
|
|
%endif
|
2016-12-24 00:13:37 +01:00
|
|
|
%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.
|
|
|
|
|
2017-02-06 09:25:50 +01:00
|
|
|
%package std
|
|
|
|
Summary: Standard library for Rust
|
|
|
|
Group: Development/Languages/Other
|
|
|
|
|
|
|
|
%description std
|
|
|
|
This package includes the standard libraries for building
|
|
|
|
applications written in Rust.
|
|
|
|
|
2016-09-06 18:11:34 +02:00
|
|
|
%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)
|
|
|
|
Provides: rustc:%{_bindir}/rust-gdb
|
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
|
2017-02-06 09:25:50 +01:00
|
|
|
%setup -q -n rustc-%{version}-src
|
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
|
2017-02-06 10:07:11 +01:00
|
|
|
%configure --disable-option-checking \
|
2017-02-06 10:09:48 +01:00
|
|
|
--build=%{rust_triple} \
|
|
|
|
--host=%{rust_triple} \
|
2017-02-06 10:07:11 +01:00
|
|
|
--target=%{rust_triple} \
|
2016-09-06 18:11:34 +02:00
|
|
|
--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} \
|
2017-02-10 21:47:02 +01:00
|
|
|
--libdir=%{_prefix}/lib \
|
2017-02-06 09:25:50 +01:00
|
|
|
--docdir=%{_docdir}/%{name} \
|
|
|
|
--disable-rpath \
|
|
|
|
--disable-codegen-tests \
|
|
|
|
--disable-rustbuild \
|
|
|
|
--enable-vendor \
|
2016-10-31 20:32:47 +01:00
|
|
|
--release-channel=stable
|
2016-09-06 18:11:34 +02:00
|
|
|
make %{?_smp_mflags}
|
|
|
|
|
|
|
|
%install
|
2017-02-06 09:25:50 +01:00
|
|
|
%make_install
|
2016-09-06 18:11:34 +02:00
|
|
|
|
|
|
|
# Remove executable permission from HTML documentation
|
|
|
|
# to prevent RPMLINT errors.
|
2017-02-06 09:25:50 +01:00
|
|
|
chmod -R -x+X %{buildroot}%{_docdir}/%{name}/html
|
2016-09-06 18:11:34 +02:00
|
|
|
|
2017-02-06 09:25:50 +01:00
|
|
|
# Remove surplus files
|
2017-02-10 21:47:02 +01:00
|
|
|
rm %{buildroot}%{_prefix}/lib/rustlib/components
|
|
|
|
rm %{buildroot}%{_prefix}/lib/rustlib/manifest-rust*
|
|
|
|
rm %{buildroot}%{_prefix}/lib/rustlib/install.log
|
|
|
|
rm %{buildroot}%{_prefix}/lib/rustlib/uninstall.sh
|
2017-02-11 06:21:44 +01:00
|
|
|
rm %{buildroot}%{_prefix}/lib/rustlib/rust-installer-version
|
2016-09-06 18:11:34 +02:00
|
|
|
# Remove lockfile to avoid errors.
|
2017-02-06 09:25:50 +01:00
|
|
|
rm %{buildroot}%{_docdir}/%{name}/html/.lock
|
|
|
|
|
|
|
|
# The remaining shared libraries should be executable for debuginfo extraction.
|
2017-02-10 21:47:02 +01:00
|
|
|
find %{buildroot}/%{_prefix}/lib/ -type f -name '*.so' -exec chmod -v +x '{}' '+'
|
2016-09-06 18:11:34 +02:00
|
|
|
|
2017-02-06 09:25:50 +01:00
|
|
|
# extract bundled licenses for packaging - From fedora spec
|
|
|
|
cp src/rt/hoedown/LICENSE src/rt/hoedown/LICENSE-hoedown
|
|
|
|
sed -e '/*\//q' src/libbacktrace/backtrace.h \
|
|
|
|
>src/libbacktrace/LICENSE-libbacktrace
|
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,-)
|
2017-02-06 09:25:50 +01:00
|
|
|
%license COPYRIGHT LICENSE-APACHE LICENSE-MIT
|
|
|
|
%license src/libbacktrace/LICENSE-libbacktrace
|
|
|
|
%license src/rt/hoedown/LICENSE-hoedown
|
|
|
|
%doc README.md
|
2016-09-06 18:11:34 +02:00
|
|
|
%{_bindir}/rustc
|
|
|
|
%{_bindir}/rustdoc
|
2017-02-06 09:25:50 +01:00
|
|
|
%{_mandir}/man1/rustc.1*
|
|
|
|
%{_mandir}/man1/rustdoc.1*
|
2017-02-11 06:21:44 +01:00
|
|
|
%{_prefix}/lib/lib*.so
|
|
|
|
%exclude %{_docdir}/%{name}/html
|
2016-09-06 18:11:34 +02:00
|
|
|
|
2017-02-06 09:25:50 +01:00
|
|
|
%files std
|
2016-09-06 18:11:34 +02:00
|
|
|
%defattr(-,root,root)
|
2017-02-10 21:47:02 +01:00
|
|
|
%dir %{_prefix}/lib/rustlib
|
|
|
|
%dir %{_prefix}/lib/rustlib/%{rust_triple}
|
|
|
|
%dir %{_prefix}/lib/rustlib/%{rust_triple}/lib
|
|
|
|
%{_prefix}/lib/rustlib/%{rust_triple}/lib/*.rlib
|
2017-02-11 06:21:44 +01:00
|
|
|
%{_prefix}/lib/rustlib/%{rust_triple}/lib/*.so
|
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
|
2017-02-10 21:47:02 +01:00
|
|
|
%dir %{_prefix}/lib/rustlib
|
|
|
|
%dir %{_prefix}/lib/rustlib/etc
|
2017-02-11 06:21:44 +01:00
|
|
|
%{_prefix}/lib/rustlib/etc/debugger_pretty_printers_common.py
|
|
|
|
%{_prefix}/lib/rustlib/etc/gdb_load_rust_pretty_printers.py
|
|
|
|
%{_prefix}/lib/rustlib/etc/gdb_rust_pretty_printing.py
|
2017-02-06 09:25:50 +01:00
|
|
|
|
|
|
|
%files doc
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%license %{_docdir}/%{name}/html/FiraSans-LICENSE.txt
|
|
|
|
%license %{_docdir}/%{name}/html/Heuristica-LICENSE.txt
|
|
|
|
%license %{_docdir}/%{name}/html/LICENSE-APACHE.txt
|
|
|
|
%license %{_docdir}/%{name}/html/LICENSE-MIT.txt
|
|
|
|
%license %{_docdir}/%{name}/html/SourceCodePro-LICENSE.txt
|
|
|
|
%license %{_docdir}/%{name}/html/SourceSerifPro-LICENSE.txt
|
|
|
|
%dir %{_docdir}/%{name}
|
|
|
|
%dir %{_docdir}/%{name}/html
|
|
|
|
%doc %{_docdir}/%{name}/html/alloc
|
|
|
|
%doc %{_docdir}/%{name}/html/book
|
|
|
|
%doc %{_docdir}/%{name}/html/collections
|
|
|
|
%doc %{_docdir}/%{name}/html/core
|
|
|
|
%doc %{_docdir}/%{name}/html/extra
|
|
|
|
%doc %{_docdir}/%{name}/html/implementors
|
|
|
|
%doc %{_docdir}/%{name}/html/libc
|
|
|
|
%doc %{_docdir}/%{name}/html/nomicon
|
|
|
|
%doc %{_docdir}/%{name}/html/src
|
|
|
|
%doc %{_docdir}/%{name}/html/std
|
|
|
|
%doc %{_docdir}/%{name}/html/std_unicode
|
|
|
|
%doc %{_docdir}/%{name}/html/COPYRIGHT.txt
|
|
|
|
%doc %{_docdir}/%{name}/html/*.html
|
|
|
|
%doc %{_docdir}/%{name}/html/*.inc
|
|
|
|
%doc %{_docdir}/%{name}/html/*.woff
|
|
|
|
%doc %{_docdir}/%{name}/html/*.js
|
|
|
|
%doc %{_docdir}/%{name}/html/*.css
|
2016-12-17 00:28:41 +01:00
|
|
|
|
2017-02-11 06:21:44 +01:00
|
|
|
%changelog
|