File rapidquilt.spec of Package rapidquilt

#
# spec file for package rapidquilt
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 https://bugs.opensuse.org/
#

# Compatibility cruft
# filesystem before SLE12 SP3 lacks /usr/share/licenses
%if 0%(test ! -d %{_defaultlicensedir} && echo 1)
%define _defaultlicensedir %_defaultdocdir
%endif
# SUSE rpm likes to mess with config.guess files
# see auto-config-update-aarch64-ppc64le.diff for details
%define config_guess_files vendor/backtrace-sys/src/libbacktrace/config.guess
%define save_config_guess \
    for f in %{config_guess_files} ; do	\
        mv "$f" "$f".saved		\
    done
%define restore_config_guess \
    for f in %{config_guess_files} ; do	\
        mv "$f".saved "$f"		\
    done
# End of compatibility cruft

Name:           rapidquilt
Version:        0.6.0
Release:        0
Summary:        A multi-threaded combination of quilt and patch
License:        MIT
Group:          Productivity/Text/Utilities
URL:            https://github.com/openSUSE/rapidquilt
Source:         https://github.com/openSUSE/rapidquilt/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        vendor.tar.xz
BuildRequires:  cargo
BuildRequires:  rust >= 1.31.0

%description
This is multi-threaded reimplementation of quilt and patch in one program.
It supports only the push command. The goal is to be very fast.

%prep
%setup -q
%setup -q -D -T -a 1
mkdir cargo-home
cat >cargo-home/config <<EOF
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'
[source.vendored-sources]
directory = './vendor'
EOF
%save_config_guess

%build
%restore_config_guess
export CARGO_HOME=$PWD/cargo-home
cargo build --release %{?_smp_mflags}

%install
export CARGO_HOME=$PWD/cargo-home
cargo install --path=. --root=%{buildroot}%{_prefix}

# remove residue crate file
rm %{buildroot}%{_prefix}/.crates.toml

%check
export CARGO_HOME=$PWD/cargo-home
cargo test

%files
%license LICENSE.md
%doc README.md
%{_bindir}/rapidquilt

%changelog
openSUSE Build Service is sponsored by