# Generated by rust2rpm 27 %bcond check 1 %global crate codeberg-cli Name: codeberg-cli Version: 0.4.11 Release: %autorelease Summary: CLI Tool for codeberg similar to gh and glab License: AGPL-3.0-or-later URL: https://crates.io/crates/codeberg-cli Source: %{crates_source} BuildRequires: cargo-rpm-macros >= 24 BuildRequires: openssl-devel BuildRequires: zlib-devel %global _description %{expand: CLI Tool for codeberg similar to gh and glab.} %description %{_description} %files -n %{crate} %license LICENSE %license LICENSE.dependencies %doc CHANGELOG.md %doc CONTRIBUTING.md %doc README.md %{_bindir}/berg %{bash_completions_dir}/berg.bash %{zsh_completions_dir}/_berg %{fish_completions_dir}/berg.fish %prep %autosetup -n %{crate}-%{version} -p1 # rust version too low for EPEL 9 and below %if 0%{?el8} || 0%{?el9} bash <(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs) --profile=minimal -y %define __rustc $HOME/.cargo/bin/rustc %define __cargo /usr/bin/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 RUSTFLAGS='%{build_rustflags}' "$HOME/.cargo/bin/cargo" %define __rustdoc $HOME/.cargo/bin/rustdoc %endif %__cargo vendor %cargo_prep -v vendor %build %cargo_build %{cargo_license} > LICENSE.dependencies BERG=./target/release/berg $BERG completion bash > berg.bash $BERG completion fish > berg.fish $BERG completion zsh > _berg %install %define cargo_install_lib 0 %cargo_install install -Dpm 0644 berg.bash -t %{buildroot}%{bash_completions_dir} install -Dpm 0644 berg.fish -t %{buildroot}%{fish_completions_dir} install -Dpm 0644 _berg -t %{buildroot}%{zsh_completions_dir} %if %{with check} %check %cargo_test %endif %changelog %autochangelog