# Generated by rust2rpm 27 %bcond check 1 %global crate pastel Name: rust-pastel Version: 0.11.0 Release: %autorelease Summary: Command-line tool to generate, analyze, convert and manipulate colors # Upstream license specification: MIT/Apache-2.0 License: MIT OR Apache-2.0 URL: https://crates.io/crates/pastel Source: %{crates_source} # Manually created patch for downstream crate metadata changes # * Remove benchmark-only criterion dev-dependency # * Downstream-only: remove the output_vt100 dependency since it has no effect # except on Windows, and we do not wish to package it. An accompanying patch # removes the call into this crate. # * Exclude doc/demo-scripts/* to avoid generating a dependency on bash # * Exclude generated man pages, completions from the -devel package Patch: pastel-fix-metadata.diff # * Downstream-only: bypass output_vt100 (no-op on non-Windows) Patch10: 0001-Downstream-only-bypass-output_vt100-no-op-on-non-Win.patch BuildRequires: cargo-rpm-macros >= 24 %global _description %{expand: A command-line tool to generate, analyze, convert and manipulate colors.} %description %{_description} %package -n %{crate} Summary: %{summary} # (MIT OR Apache-2.0) AND Unicode-DFS-2016 # Apache-2.0 OR MIT # Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT # BSD-2-Clause OR Apache-2.0 OR MIT # MIT # MIT OR Apache-2.0 # Unlicense OR MIT License: %{shrink: (MIT OR Apache-2.0) AND MIT AND Unicode-DFS-2016 AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND (Unlicense OR MIT) } # LICENSE.dependencies contains a full license breakdown %description -n %{crate} %{_description} %files -n %{crate} %license LICENSE-APACHE %license LICENSE-MIT %license LICENSE.dependencies %doc CHANGELOG.md %doc README.md %{_bindir}/pastel %doc doc/*.* %doc doc/*/ %{bash_completions_dir}/pastel.bash %{fish_completions_dir}/pastel.fish %{zsh_completions_dir}/_pastel %{_mandir}/man1/pastel.1* %{_mandir}/man1/pastel-*.1* %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}/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}-%{version} -p1 %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %build # Control where generated shell completions and man pages are placed export SHELL_COMPLETIONS_DIR='_completions' %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %install %cargo_install pushd _completions install -Dpm 0644 pastel.bash -t %{buildroot}/%{bash_completions_dir} install -Dpm 0644 pastel.fish -t %{buildroot}/%{fish_completions_dir} install -Dpm 0644 _pastel -t %{buildroot}/%{zsh_completions_dir} # There is also a PowerShell completions file, _pastel.ps1, but nowhere useful # to install it. install -Dpm 0644 *.1 -t %{buildroot}%{_mandir}/man1 popd %if %{with check} %check %cargo_test %endif %changelog %autochangelog