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

# Generated by rust2rpm 22
%bcond_without check

# reduce debuginfo verbosity to work around OOM problems on 32-bit arches
%global rustflags_debuginfo 1

%global crate cargo-c
%global upstream_version 0.9.12+cargo-0.64

Name:           rust-cargo-c
Version:        0.9.12
Release:        %autorelease
Summary:        Helper program to build and install c-like libraries

License:        MIT
URL:            https://crates.io/crates/cargo-c
Source0:        %{crates_source %{crate} %{upstream_version}}
Source1:        LICENSE.dependencies
# Manually created patch for downstream crate metadata changes
# * drop +cargo version suffix from crate version
# * remove vendored OpenSSL feature
Patch:          cargo-c-fix-metadata.diff

ExclusiveArch:  %{rust_arches}

BuildRequires:  cargo-rpm-macros >= 21

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

%description %{_description}

%package     -n %{crate}
Summary:        %{summary}
# (MIT OR Apache-2.0) AND Unicode-DFS-2016
# Apache-2.0
# Apache-2.0 OR BSL-1.0
# Apache-2.0 OR MIT
# MIT
# MIT AND GPL-2.0-only WITH GCC-exception-2.0 AND BSD-3-Clause
# MIT OR Apache-2.0
# MIT OR Apache-2.0 OR Zlib
# MPL-2.0
# MPL-2.0+
# Unlicense OR MIT
# Zlib OR Apache-2.0 OR MIT
License:        MIT AND Apache-2.0 AND BSD-3-Clause AND GPL-2.0-only WITH GCC-exception-2.0 AND MPL-2.0 AND Unicode-DFS-2016
# LICENSE.dependencies contains a full license breakdown

%description -n %{crate} %{_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.

%prep
%autosetup -n %{crate}-%{upstream_version} -p1
cp -pav %{SOURCE1} .
#cargo_prep

#generate_buildrequires
#cargo_generate_buildrequires
%{__rm} -f Cargo.toml.orig

%build
%cargo_build

%install
%cargo_install
mv .cargo/bin %{buildroot}%{_prefix}


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

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

%files          devel
%license %{crate_instdir}/LICENSE
%doc %{crate_instdir}/README.md
%{crate_instdir}/

%changelog
* Wed May 03 2023 Fabio Valentini <decathorpe@gmail.com> - 0.9.12-4
- Rebuild for openssl crate >= v0.10.48 (RUSTSEC-2023-{0022,0023,0024})

* Sat Jan 28 2023 Fabio Valentini <decathorpe@gmail.com> - 0.9.12-3
- Rebuild for CVE-2022-24765 and CVE-2022-29187 in libgit2

* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Thu Aug 25 2022 Fabio Valentini <decathorpe@gmail.com> - 0.9.12-1
- Update to version 0.9.12+cargo-0.64; Fixes RHBZ#2058792

* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.7-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Tue Feb 22 2022 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.9.7-4
- Use the new way to set debuginfo level during build

* Tue Feb 22 2022 Fabio Valentini <decathorpe@gmail.com> - 0.9.7-3
- More workarounds for rust-packaging 21 issues

* Tue Feb 22 2022 Fabio Valentini <decathorpe@gmail.com> - 0.9.7-2
- Work around RUSTFLAGS no longer being set in .cargo/config

* Mon Feb 21 2022 Fabio Valentini <decathorpe@gmail.com> - 0.9.7-1
- Update to version 0.9.7+cargo-0.59; Fixes RHBZ#2005017

* Tue Feb 15 2022 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.9.2-8
- Rebuild with package notes

* Tue Feb 15 2022 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.9.2-7
- Rebuild with package notes

* 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

