Blob Blame History Raw
# Generated by rust2rpm 26
%bcond_without check

%global crate handlebars

Name:           rust-handlebars
Version:        5.1.2
Release:        %autorelease
Summary:        Handlebars templating implemented in Rust

License:        MIT
URL:            https://crates.io/crates/handlebars
Source:         %{crates_source}
# Manually created patch for downstream crate metadata changes
# * drop unused, benchmark-only criterion and pprof dev-dependencies
# * drop tiny_http dev-dependency that is only used in example code
Patch:          handlebars-fix-metadata.diff

BuildRequires:  cargo-rpm-macros >= 24

%global _description %{expand:
Handlebars templating implemented in Rust.}

%description %{_description}

%package     -n %{crate}
Summary:        %{summary}
# Apache-2.0 OR BSL-1.0
# MIT
# MIT OR Apache-2.0
# Unlicense OR MIT
License:        MIT AND (Apache-2.0 OR BSL-1.0) AND (MIT OR Apache-2.0) AND (Unlicense OR MIT)
# LICENSE.dependencies contains a full license breakdown

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

%files       -n %{crate}
%license LICENSE
%license LICENSE.dependencies
%doc CHANGELOG.md
%doc README.md
%{_bindir}/handlebars-cli

%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}/CHANGELOG.md
%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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

%prep
%autosetup -n %{crate}-%{version} -p1
%cargo_prep
# * drop example binary that depends on tiny_http
rm examples/dev_mode.rs
# * we are not doing anything with wasm
rm -rv wasm

%generate_buildrequires
%cargo_generate_buildrequires

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

%install
%cargo_install

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

%changelog
%autochangelog