# Generated by rust2rpm 27
%bcond check 0

%global __brp_mangle_shebangs_exclude_from ^/usr/src/.*$
%global crate bottom

Name:           rust-bottom
Version:        0.12.3
Release:        1%?dist
Summary:        Customizable cross-platform graphical process/system monitor for the terminal

License:        MIT
URL:            https://crates.io/crates/bottom
Source:         %{crates_source}
# Automatically generated patch to strip dependencies and normalize metadata
Patch:          bottom-fix-metadata-auto.diff

BuildRequires:  anda-srpm-macros
BuildRequires:  cargo-rpm-macros >= 24

%global _description %{expand:
A customizable cross-platform graphical process/system monitor for the
terminal. Supports Linux, macOS, and Windows.}

%description %{_description}

%package     -n %{crate}
Summary:        %{summary}
License:        (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 (BSD-2-Clause OR MIT OR Apache-2.0) AND ISC AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND MPL-2.0 AND (Unlicense OR MIT) AND Zlib AND (Zlib OR Apache-2.0 OR MIT)
Packager:       Ben Woods <git@ben.woods.am>

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

%files       -n %{crate}
%license LICENSE
%license LICENSE.dependencies
%doc README.md
%{_bindir}/btm
%{_bindir}/schema
%{_mandir}/man1/btm.1*

%pkg_completion -Bfz -n %crate btm

%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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

%description -n %{name}+nvml-wrapper-devel %{_description}

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

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

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

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

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

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

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

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

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

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

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

%description -n %{name}+starship-battery-devel %{_description}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

%prep
%autosetup -n %{crate}-%{version} -p1
%cargo_prep_online

%build
#cargo_build -f generate_schema
%{cargo_license_summary_online -f generate_schema}
%{cargo_license_online -f generate_schema} > LICENSE.dependencies

%install
# https://github.com/ClementTsang/bottom/blob/main/docs/content/contribution/packaging-and-distribution.md#manpage-and-completion-generation
export BTM_GENERATE=true
%cargo_install -f generate_schema
# Completions
ls target/tmp/bottom
install -Dpm 0644 target/tmp/bottom/completion/btm.bash %{buildroot}%{_datadir}/bash-completion/completions/btm
install -Dpm 0644 target/tmp/bottom/completion/btm.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/btm.fish
install -Dpm 0644 target/tmp/bottom/completion/_btm %{buildroot}%{_datadir}/zsh/site-functions/_btm
install -Dpm 0644 target/tmp/bottom/manpage/btm.1 %{buildroot}%{_mandir}/man1/btm.1

%if %{with check}
%check
%cargo_test -f generate_schema
%endif

%changelog
%autochangelog
