Blame SPECS/cargo-vendor.spec

e799b9
# Only x86_64 and i686 are Tier 1 platforms at this time.
e799b9
# https://forge.rust-lang.org/platform-support.html
e799b9
#global rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x
86518c
%global rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x
e799b9
e799b9
# libgit2-sys expects to use its bundled library, which is sometimes just a
e799b9
# snapshot of libgit2's master branch.  This can mean the FFI declarations
e799b9
# won't match our released libgit2.so, e.g. having changed struct fields.
e799b9
# So, tread carefully if you toggle this...
e799b9
%bcond_without bundled_libgit2
e799b9
e799b9
%if 0%{?rhel}
e799b9
%bcond_without bundled_libssh2
e799b9
%else
e799b9
%bcond_with bundled_libssh2
e799b9
%endif
e799b9
e799b9
Name:           cargo-vendor
71c945
Version:        0.1.23
71c945
Release:        2%{?dist}
e799b9
Summary:        Cargo subcommand to vendor crates.io dependencies
e799b9
License:        ASL 2.0 or MIT
e799b9
URL:            https://github.com/alexcrichton/cargo-vendor
e799b9
ExclusiveArch:  %{rust_arches}
e799b9
e799b9
Source0:        https://crates.io/api/v1/crates/%{name}/%{version}/download#/%{name}-%{version}.crate
e799b9
e799b9
# Use vendored crate dependencies so we can build offline.
e799b9
# Created using cargo-vendor itself!
e799b9
# It's so big because some of the -sys crates include the C library source they
e799b9
# want to link to.  With our -devel buildreqs in place, they'll be used instead.
e799b9
# FIXME: These should all eventually be packaged on their own!
e799b9
Source1:        %{name}-%{version}-vendor.tar.xz
e799b9
e799b9
BuildRequires:  rust-toolset >= 1.30
e799b9
e799b9
# Indirect dependencies for vendored -sys crates above
e799b9
BuildRequires:  make
e799b9
BuildRequires:  cmake
e799b9
BuildRequires:  gcc
e799b9
BuildRequires:  libcurl-devel
e799b9
BuildRequires:  openssl-devel
e799b9
BuildRequires:  zlib-devel
e799b9
BuildRequires:  pkgconfig
e799b9
e799b9
%if %with bundled_libgit2
e799b9
Provides:       bundled(libgit2) = 0.27.0
e799b9
%else
e799b9
BuildRequires:  libgit2-devel >= 0.24
e799b9
%endif
e799b9
e799b9
%if %with bundled_libssh2
e799b9
Provides:       bundled(libssh2) = 1.8.1~dev
e799b9
%else
e799b9
# needs libssh2_userauth_publickey_frommemory
e799b9
BuildRequires:  libssh2-devel >= 1.6.0
e799b9
%endif
e799b9
e799b9
# It only supports being called as a subcommand, "cargo vendor"
e799b9
Requires:       cargo
e799b9
e799b9
%description
e799b9
This is a Cargo subcommand which vendors all crates.io dependencies into a
e799b9
local directory using Cargo's support for source replacement.
e799b9
e799b9
e799b9
%prep
e799b9
%setup -q -n %{name}-%{version}
e799b9
e799b9
# Source1 is vendored dependencies
e799b9
%cargo_prep -V 1
e799b9
e799b9
e799b9
%build
e799b9
e799b9
%if %without bundled_libgit2
e799b9
# convince libgit2-sys to use the distro libgit2
e799b9
export LIBGIT2_SYS_USE_PKG_CONFIG=1
e799b9
%endif
e799b9
e799b9
%if %without bundled_libssh2
e799b9
# convince libssh2-sys to use the distro libssh2
e799b9
export LIBSSH2_SYS_USE_PKG_CONFIG=1
e799b9
%endif
e799b9
e799b9
# cargo-vendor doesn't use a configure script, but we still want to use
e799b9
# CFLAGS in case of the odd C file in vendored dependencies.
e799b9
%{?__global_cflags:export CFLAGS="%{__global_cflags}"}
e799b9
%{!?__global_cflags:%{?optflags:export CFLAGS="%{optflags}"}}
e799b9
%{?__global_ldflags:export LDFLAGS="%{__global_ldflags}"}
e799b9
e799b9
%cargo_build
e799b9
e799b9
e799b9
%install
e799b9
%cargo_install
e799b9
e799b9
e799b9
#check
e799b9
# the tests don't work offline
e799b9
e799b9
e799b9
%files
e799b9
%license LICENSE-APACHE LICENSE-MIT
e799b9
%doc README.md
e799b9
%{_bindir}/cargo-vendor
e799b9
e799b9
e799b9
%changelog
71c945
* Fri May 24 2019 Josh Stone <jistone@redhat.com> - 0.1.23-2
71c945
- Rebuild with Rust 1.35
71c945
71c945
* Tue Apr 09 2019 Josh Stone <jistone@redhat.com> - 0.1.23-1
71c945
- Update to 0.1.23
Pablo Greco 9e6e0b
e799b9
* Thu Dec 13 2018 Josh Stone <jistone@redhat.com> - 0.1.22-1
e799b9
- Update to 0.1.22
e799b9
e799b9
* Thu Oct 04 2018 Josh Stone <jistone@redhat.com> - 0.1.15-3
e799b9
- Rebuild without SCL packaging. (rhbz1635067)
e799b9
e799b9
* Tue Jul 31 2018 Josh Stone <jistone@redhat.com> - 0.1.15-2
e799b9
- Rebuild for the rust-toolset-1.26 module.
e799b9
- Update vendored dependencies.
e799b9
e799b9
* Fri May 18 2018 Josh Stone <jistone@redhat.com> - 0.1.15-1
e799b9
- Update to 0.1.15.
e799b9
e799b9
* Wed Dec 13 2017 Josh Stone <jistone@redhat.com> - 0.1.13-1
e799b9
- Update to 0.1.13.
e799b9
e799b9
* Mon Sep 11 2017 Josh Stone <jistone@redhat.com> - 0.1.12-1
e799b9
- Update to 0.1.12.
e799b9
e799b9
* Mon Jul 24 2017 Josh Stone <jistone@redhat.com> - 0.1.11-1
e799b9
- Update to 0.1.11.
e799b9
e799b9
* Thu Jun 15 2017 Josh Stone <jistone@redhat.com> - 0.1.7-1
e799b9
- Initial packaging.