Blob Blame History Raw
# Generated by rust2rpm 20
%bcond_without check
%global debug_package %{nil}

%global crate asyncgit

Name:           rust-%{crate}
Version:        0.20.1
Release:        %autorelease
Summary:        Allow using git2 in a asynchronous context

# Upstream license specification: MIT
License:        MIT
URL:            https://crates.io/crates/asyncgit
Source:         %{crates_source}
# Initial patched metadata
# * No vendored
Patch0:         asyncgit-fix-metadata.diff

ExclusiveArch:  %{rust_arches}

BuildRequires:  rust-packaging

%global _description %{expand:
Allow using git2 in a asynchronous context.}

%description %{_description}

%package        devel
Summary:        %{summary}
BuildArch:      noarch

%description    devel %{_description}

This package contains library source intended for building other packages which
use the "%{crate}" crate.

%files          devel
%license LICENSE.md
%doc README.md
%{cargo_registry}/%{crate}-%{version_no_tilde}/

%package     -n %{name}+default-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+default-devel %{_description}

This package contains library source intended for building other packages which
use the "default" feature of the "%{crate}" crate.

%files       -n %{name}+default-devel
%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml

%package     -n %{name}+trace-libgit-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+trace-libgit-devel %{_description}

This package contains library source intended for building other packages which
use the "trace-libgit" feature of the "%{crate}" crate.

%files       -n %{name}+trace-libgit-devel
%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml

%prep
%autosetup -n %{crate}-%{version_no_tilde} -p1
sed -i -e 's|/usr/bin/env python|/usr/bin/python3|' src/sync/hooks.rs
%cargo_prep

%generate_buildrequires
%cargo_generate_buildrequires
%if %{with check}
echo '/usr/bin/git'
%endif

%build
%cargo_build

%install
%cargo_install

%if %{with check}
%check
# Some tests require an internet connection
%cargo_test -- -- --skip sync::remotes::tests::test_smoke --skip sync::remotes::tests::test_default_remote --skip sync::remotes::tests::test_default_remote_out_of_order
%endif

%changelog
%autochangelog