## START: Set by rpmautospec
## (rpmautospec version 0.2.5)
%define autorelease(e:s:pb:) %{?-p:0.}%{lua:
    release_number = 6;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{?dist}
## END: Set by rpmautospec

# Generated by rust2rpm 20
%bcond_without check

%global crate cargo-c
%global upstream_version 0.9.2+cargo-0.55

Name:           rust-%{crate}
Version:        0.9.2
Release:        %autorelease
Summary:        Helper program to build and install c-like libraries

# Upstream license specification: MIT
License:        MIT
URL:            https://crates.io/crates/cargo-c
Source:         %{crates_source %{crate} %{upstream_version}}
# Initial patched metadata
# * drop +cargo version suffix from crate version
# * remove vendored OpenSSL feature
Patch0:         cargo-c-fix-metadata.diff

ExclusiveArch:  %{rust_arches}

BuildRequires:  rust-packaging

%global _description %{expand:
Helper program to build and install c-like libraries.}

%description %{_description}

%package     -n %{crate}
Summary:        %{summary}
# ASL 2.0
# ASL 2.0 or Boost
# ASL 2.0 or MIT
# MIT
# MIT or ASL 2.0
# MIT or ASL 2.0 or zlib
# MPLv2.0
# Unlicense or MIT
# zlib or ASL 2.0 or MIT
License:        MIT and ASL 2.0 and MPLv2.0

%description -n %{crate} %{_description}

%files       -n %{crate}
%license LICENSE
%doc README.md
%{_bindir}/cargo-ctest
%{_bindir}/cargo-capi
%{_bindir}/cargo-cinstall
%{_bindir}/cargo-cbuild

%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
%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

%prep
%autosetup -n %{crate}-%{upstream_version} -p1
%cargo_prep
# drop debuginfo verbosity in an attempt to fix armv7hl OOM problems
sed -i "s/debuginfo=2/debuginfo=1/" .cargo/config

%generate_buildrequires
%cargo_generate_buildrequires

%build
%cargo_build

%install
%cargo_install

%if %{with check}
%check
%cargo_test
%endif

%changelog
* Tue Jan 25 2022 Fabio Valentini <decathorpe@gmail.com> 0.9.2-6
- Rebuild with thread_local 1.1.4 for RUSTSEC-2022-0006

* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> 0.9.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Sun Nov 28 2021 Igor Raits <ignatenkobrain@fedoraproject.org> 0.9.2-4
- Rebuild for libgit2 1.3.x

* Tue Sep 14 2021 Sahana Prasad <sahana@redhat.com> 0.9.2-3
- Rebuilt with OpenSSL 3.0.0

* Thu Aug 26 2021 Fabio Valentini <decathorpe@gmail.com> 0.9.2-2
- Drop debuginfo verbosity in an attempt to fix armv7hl OOM problems

* Thu Aug 26 2021 Fabio Valentini <decathorpe@gmail.com> 0.9.2-1
- Update to version 0.9.2+cargo-0.55; Fixes RHBZ#1945899

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Mon Mar 29 2021 Fabio Valentini <decathorpe@gmail.com> - 0.7.3-2
- Update to version 0.7.3+cargo-0.51.

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.18-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Tue Dec 29 14:21:55 CET 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.6.18-2
- Rebuild against libgit2 1.1.x

* Sun Nov 29 2020 Fabio Valentini <decathorpe@gmail.com> - 0.6.18-1
- Update to version 0.6.18+cargo-0.49.
- Fixes RHBZ#1887871

* Mon Sep 21 2020 Fabio Valentini <decathorpe@gmail.com> - 0.6.13-1
- Update to version 0.6.13.

* Sun Aug 23 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.6.10-2
- Rebuild

* Wed Jul 29 2020 Josh Stone <jistone@redhat.com> - 0.6.10-1
- Update to 0.6.10

* Fri Jul 10 2020 Josh Stone <jistone@redhat.com> - 0.6.8-1
- Update to 0.6.8

* Wed Jun 10 2020 Josh Stone <jistone@redhat.com> - 0.6.7-1
- Update to 0.6.7

* Tue May 05 2020 Josh Stone <jistone@redhat.com> - 0.6.5-1
- Update to 0.6.5

* Fri Apr 24 2020 Josh Stone <jistone@redhat.com> - 0.6.4-1
- Update to 0.6.4

* Thu Apr 23 2020 Josh Stone <jistone@redhat.com> - 0.6.3-2
- Bump to cargo 0.44

* Fri Apr 17 2020 Josh Stone <jistone@redhat.com> - 0.6.3-1
- Update to 0.6.3

* Wed Apr 15 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.6.2-2
- Rebuild for libgit2 1.0.0

* Wed Apr 01 2020 Josh Stone <jistone@redhat.com> - 0.6.2-1
- Update to 0.6.2

* Tue Mar 17 2020 Josh Stone <jistone@redhat.com> - 0.5.3-1
- Update to 0.5.3

* Wed Feb 26 2020 Josh Stone <jistone@redhat.com> - 0.5.2-4
- Update cbindgen to 0.13

* Tue Feb 11 13:41:07 CET 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.5.2-3
- Update pretty_env_logger to 0.4

* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Thu Jan 23 2020 Josh Stone <jistone@redhat.com> - 0.5.2-1
- Update to 0.5.2

* Thu Dec 19 19:13:31 CET 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.5.1-1
- Initial package