Blob Blame History Raw
# Generated by rust2rpm 22
# * tests can only be run in-tree
%bcond_with check
%global debug_package %{nil}

%global crate cargo

# drop unnecessary debuginfo generation to fix OOM problems on 32-bit arches
%global rustflags_debuginfo 0

Name:           rust-cargo
Version:        0.64.0
Release:        %autorelease
Summary:        Package manager for Rust

License:        MIT OR Apache-2.0
URL:            https://crates.io/crates/cargo
Source:         %{crates_source}
# Automatically generated patch to strip foreign dependencies
Patch:          cargo-fix-metadata-auto.diff
# Manually created patch for downstream crate metadata changes
# * drop dependencies on compiler internals
# * drop feature for vendored OpenSSL
# * drop cargo binary (shipped with rust)
Patch:          cargo-fix-metadata.diff

ExclusiveArch:  %{rust_arches}

BuildRequires:  rust-packaging >= 21

%global _description %{expand:
Package manager for Rust.}

%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 %{crate_instdir}/LICENSE-APACHE
%license %{crate_instdir}/LICENSE-MIT
%doc %{crate_instdir}/CHANGELOG.md
%doc %{crate_instdir}/CONTRIBUTING.md
%doc %{crate_instdir}/README.md
%{crate_instdir}/
%exclude %{crate_instdir}//{ci/,publish.py,triagebot.toml}

%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

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

%description -n %{name}+deny-warnings-devel %{_description}

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

%files       -n %{name}+deny-warnings-devel
%ghost %{crate_instdir}/Cargo.toml

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

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

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

%files       -n %{name}+openssl-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+pretty-env-logger-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+pretty-env-logger-devel %{_description}

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

%files       -n %{name}+pretty-env-logger-devel
%ghost %{crate_instdir}/Cargo.toml

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

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

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

%files       -n %{name}+pretty_env_logger-devel
%ghost %{crate_instdir}/Cargo.toml

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

%generate_buildrequires
%cargo_generate_buildrequires

%build
%cargo_build

%install
%cargo_install

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

%changelog
%autochangelog