%global debug_package %{nil} Name: gh Version: 2.96.0 Release: 1%{?dist} Summary: GitHub's official command line tool License: MIT URL: https://github.com/cli/cli Source0: %{url}/archive/v%{version}/cli-%{version}.tar.gz Source1: cli-%{version}-vendor.tar.bz2 BuildRequires: golang >= 1.26.0 BuildRequires: git-core BuildRequires: sed Requires: git-core %description gh is GitHub's official command line tool. It brings pull requests, issues, GitHub Actions, and other GitHub features to your terminal. %prep %setup -q -n cli-%{version} tar -xf %{S:1} %build export GO_LDFLAGS="-X github.com/cli/cli/v2/internal/build.Version=%{version} \ -X github.com/cli/cli/v2/internal/build.Date=$(date -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%d)" go build -mod=vendor -buildmode=pie -ldflags "${GO_LDFLAGS}" -o bin/gh ./cmd/gh go build -mod=vendor -buildmode=pie -ldflags "${GO_LDFLAGS}" -o bin/gen-docs ./cmd/gen-docs # Generate manpages ./bin/gen-docs --man-page --doc-path ./share/man/man1 # Generate shell completions ./bin/gh completion -s bash > gh.bash ./bin/gh completion -s fish > gh.fish ./bin/gh completion -s zsh > gh.zsh %install install -Dpm 0755 bin/gh %{buildroot}%{_bindir}/gh # Install manpages install -d %{buildroot}%{_mandir}/man1 install -Dpm 0644 ./share/man/man1/gh*.1 -t %{buildroot}%{_mandir}/man1/ # Install shell completions install -Dpm 0644 gh.bash %{buildroot}%{_datadir}/bash-completion/completions/gh install -Dpm 0644 gh.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/gh.fish install -Dpm 0644 gh.zsh %{buildroot}%{_datadir}/zsh/site-functions/_gh %check ./bin/gh --version | grep %{version} %files %license LICENSE %doc README.md %{_bindir}/gh %{_mandir}/man1/gh*.1* %{_datadir}/bash-completion/completions/gh %{_datadir}/fish/vendor_completions.d/gh.fish %{_datadir}/zsh/site-functions/_gh %changelog * Tue Jul 07 2026 Yonghang Wang - 2.96.0-1 - Update to v2.96.0 (latest, now that Go 1.26 is available) - Security fix: CVE for gh codespace jupyter command execution * Tue Jul 07 2026 Yonghang Wang - 2.87.0-1 - Initial package for AL2023 (COPR al-stream-2023)