Blob Blame History Raw
# Generated by rust2rpm 25
%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.27+cargo-0.74.0

Name:           rust-cargo-c
Version:        0.9.27
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:        macros.cargo-c
# Automatically generated patch to strip dependencies and normalize metadata
Patch:          cargo-c-fix-metadata-auto.diff
# 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

BuildRequires:  cargo-rpm-macros >= 24

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

%description %{_description}

%package     -n %{crate}
Summary:        %{summary}
# (Apache-2.0 OR MIT) AND BSD-3-Clause
# (MIT OR Apache-2.0) AND BSD-3-Clause AND GPL-2.0-only WITH GCC-exception-2.0 AND MIT
# (MIT OR Apache-2.0) AND Unicode-DFS-2016
# 0BSD OR MIT OR Apache-2.0
# Apache-2.0
# Apache-2.0 OR BSL-1.0
# Apache-2.0 OR MIT
# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
# BSD-3-Clause
# ISC
# MIT
# MIT OR Apache-2.0
# MIT OR Apache-2.0 OR BSD-1-Clause
# MIT OR Apache-2.0 OR Zlib
# MIT OR Zlib OR Apache-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 ISC AND MPL-2.0 AND Unicode-DFS-2016 AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (MIT OR Apache-2.0 OR BSD-1-Clause) AND (MIT OR Apache-2.0 OR Zlib) AND (Unlicense OR MIT)
# LICENSE.dependencies contains a full license breakdown

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

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

%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 %{crate_instdir}/LICENSE
%doc %{crate_instdir}/README.md
%{crate_instdir}/

%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 %{crate_instdir}/Cargo.toml

%prep
%autosetup -n %{crate}-%{upstream_version} -p1
%cargo_prep

%generate_buildrequires
%cargo_generate_buildrequires

%build
%cargo_build
%{cargo_license_summary}
%{cargo_license} > LICENSE.dependencies

%install
%cargo_install
install -D -p -m 0644 -t %{buildroot}/%{_rpmmacrodir} %{SOURCE1}

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

%changelog
%autochangelog