File cargo-vendor.spec of Package cargo-vendor

# spec file for package cargo-vendor
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 Luke Jones,
# 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

Name:           cargo-vendor
Version:        0.1.13
Release:        0
Summary:        A Cargo subcommand to vendor Rust dependencies
License:        MIT or Apache-2.0
Group:          Development/Languages/Rust
Source0:        %{name}-%{version}.tar.gz
Source1:        vendor.tar.xz
BuildRequires:  cargo
BuildRequires:  cmake
# BuildRequires:  pkgconfig(libgit2)
BuildRequires:  rust
BuildRequires:  rust-std
BuildRequires:  pkgconfig(libssl)
BuildRequires:  pkgconfig(openssl)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

This is a Cargo subcommand which vendors all dependencies into a local directory using Cargo's support for source replacement.

%setup -q
%setup -q -D -T -a 1
mkdir cargo-home
cat >cargo-home/config <<EOF
registry = ''
replace-with = 'vendored-sources'
directory = './vendor'

export CARGO_HOME=`pwd`/cargo-home/
cargo build --release %{?_smp_mflags}

mkdir build
export CARGO_HOME=`pwd`/cargo-home/
cargo install --root=build
mkdir -p %{buildroot}%{_bindir}
install -Dm0755 build/bin/cargo-vendor %{buildroot}%{_bindir}/cargo-vendor


openSUSE Build Service is sponsored by