Name: gh Version: 2.102.0 Release: %autorelease Summary: GitHub's official command line tool License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unlicense URL: https://github.com/cli/cli Source0: %{url}/archive/refs/tags/v%{version}.tar.gz Source1: vendor-%{version}.tar.xz Source2: vendor-licenses.txt BuildRequires: git-core BuildRequires: go-vendor-tools BuildRequires: golang BuildRequires: sed Requires: git-core %description A command-line interface to GitHub for use in your terminal or your scripts. gh is a tool designed to enhance your workflow when working with GitHub. It provides a seamless way to interact with GitHub repositories and perform various actions right from the terminal. %package bash-completion Summary: Bash completion for %{name} Requires: %{name} = %{version}-%{release} Requires: bash-completion %description bash-completion Bash completion support for %{name}. %package fish-completion Summary: Fish completion for %{name} Requires: %{name} = %{version}-%{release} Requires: fish %description fish-completion Fish completion support for %{name}. %package zsh-completion Summary: Zsh completion for %{name} Requires: %{name} = %{version}-%{release} Requires: zsh %description zsh-completion Zsh completion support for %{name}. %prep %goprep -p1 # Vendor archive generated by go-vendor-tools. tar -xf %{SOURCE1} %generate_buildrequires %go_vendor_license_buildrequires -c %{SOURCE2} %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}" +%Y-%m-%d)" %gobuild -o %{gobuilddir}/bin/gh %{goipath}/cmd/gh %gobuild -o %{gobuilddir}/bin/gen-docs %{goipath}/cmd/gen-docs # Generate man pages. mkdir -p share/man/man1 %{gobuilddir}/bin/gen-docs \ --man-page \ --doc-path ./share/man/man1 # Generate shell completions. %{gobuilddir}/bin/gh completion -s bash > gh.bash %{gobuilddir}/bin/gh completion -s fish > gh.fish %{gobuilddir}/bin/gh completion -s zsh > gh.zsh %install %go_vendor_license_install -c %{SOURCE2} install -Dpm 0755 %{gobuilddir}/bin/gh \ %{buildroot}%{_bindir}/gh # Man pages. install -Dpm 0644 share/man/man1/gh*.1 \ -t %{buildroot}%{_mandir}/man1/ # Shell completions. install -Dpm 0644 gh.bash \ %{buildroot}%{bash_completions_dir}/gh install -Dpm 0644 gh.fish \ %{buildroot}%{fish_completions_dir}/gh.fish install -Dpm 0644 gh.zsh \ %{buildroot}%{zsh_completions_dir}/_gh %check %go_vendor_license_check -c %{SOURCE2} %if %{with check} %gocheck2 -t github.com/cli/cli/v2/third-party \ -s TestNewInspectCmd \ -s 'TestVerifyIntegration\.*' %endif %files -f %{go_vendor_license_filelist} %doc README.md %{_bindir}/gh %{_mandir}/man1/gh*.1* %files bash-completion %{bash_completions_dir}/gh %files fish-completion %{fish_completions_dir}/gh.fish %files zsh-completion %{zsh_completions_dir}/_gh %changelog %autochangelog