Blame SPECS/cargo-vendor.spec

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