# Generated by rust2rpm 26 %bcond_without check %global crate onefetch Name: rust-onefetch Version: 2.21.0 Release: %autorelease Summary: Command-line Git information tool License: MIT URL: https://crates.io/crates/onefetch Source: %{crates_source} # Automatically generated patch to strip dependencies and normalize metadata Patch: onefetch-fix-metadata-auto.diff # Manually created patch for downstream crate metadata changes # * Allow older rstest 0.18 until rust-rstest can be updated # (https://bugzilla.redhat.com/show_bug.cgi?id=2274161) # * Allow human-panic 2.0.0 (see https://github.com/o2sh/onefetch/pull/1373) # * Allow gix 0.63 (see https://github.com/o2sh/onefetch/pull/1348) Patch: onefetch-fix-metadata.diff # * Drop unused shebangs from repo test fixture scripts Patch10: https://github.com/o2sh/onefetch/pull/1375.patch BuildRequires: cargo-rpm-macros >= 24 BuildRequires: help2man BuildRequires: tomcli %global _description %{expand: Command-line Git information tool.} %description %{_description} %package -n %{crate} Summary: %{summary} # (Apache-2.0 OR MIT) AND BSD-3-Clause # (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-2-Clause OR Apache-2.0 OR MIT # BSD-3-Clause # MIT # MIT OR Apache-2.0 # 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: %{shrink: (0BSD OR Apache-2.0 OR MIT) AND Apache-2.0 AND (Apache-2.0 OR Apache-2.0 WITH LLVM-exception OR MIT) AND (Apache-2.0 OR BSD-2-Clause OR MIT) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 OR MIT OR Zlib) AND BSD-3-Clause AND MIT AND (MIT OR Unlicense) AND MPL-2.0 AND Unicode-DFS-2016 } # LICENSE.dependencies contains a full license breakdown %description -n %{crate} %{_description} %files -n %{crate} %license LICENSE.md %license resources/license.cache.zstd %license src/info/license.rs %license LICENSE.dependencies %doc CHANGELOG.md %doc CONTRIBUTING.md %doc README.md %{_bindir}/onefetch %{_mandir}/man1/onefetch.1* %{bash_completions_dir}/onefetch.bash %{fish_completions_dir}/onefetch.fish %{zsh_completions_dir}/_onefetch %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.md %license %{crate_instdir}/resources/license.cache.zstd %license %{crate_instdir}/src/info/license.rs %doc %{crate_instdir}/CHANGELOG.md %doc %{crate_instdir}/CONTRIBUTING.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}+fail-on-deprecated-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+fail-on-deprecated-devel %{_description} This package contains library source intended for building other packages which use the "fail-on-deprecated" feature of the "%{crate}" crate. %files -n %{name}+fail-on-deprecated-devel %ghost %{crate_instdir}/Cargo.toml %prep %autosetup -n %{crate}-%{version} -p1 %cargo_prep # Do not depend on criterion; it is needed only for benchmarks. tomcli set Cargo.toml del dev-dependencies.criterion # We could package gix-testtools as a test dependency, enabling (as of this # writing) five more tests. The maintainer of the gix stack in Fedora does # not intend to package it, citing upstream discouragement in # https://github.com/Byron/gitoxide/discussions/900. For now, we do without # the extra tests that it would enable. tomcli set Cargo.toml del dev-dependencies.gix-testtools # These tests require gix-testools: rm tests/repo.rs %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies # Generate a man page (of adequate quality). This should match the one in # docs/onefetch.1, except that it is guaranteed to be up to date. # See also: https://github.com/o2sh/onefetch/pull/1376 help2man --no-info --output=onefetch.1 --name='%{summary}' target/rpm/onefetch %install %cargo_install # install the generated man page install -t %{buildroot}%{_mandir}/man1 -D -p -m 0644 onefetch.1 # generate and install shell completions target/rpm/onefetch --generate bash > onefetch.bash target/rpm/onefetch --generate fish > onefetch.fish target/rpm/onefetch --generate zsh > _onefetch install -Dpm 0644 onefetch.bash -t %{buildroot}/%{bash_completions_dir} install -Dpm 0644 onefetch.fish -t %{buildroot}/%{fish_completions_dir} install -Dpm 0644 _onefetch -t %{buildroot}/%{zsh_completions_dir} %if %{with check} %check %cargo_test %endif %changelog %autochangelog