# Generated by go2rpm 1.18.0 %bcond check 1 # https://github.com/cli/cli %global goipath github.com/cli/cli/v2 Version: 2.97.0 %gometa -L -f Name: gh Release: %autorelease Summary: GitHub's official command line tool # Generated by go-vendor-tools License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unlicense URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml Patch: 0001-Downstream-only-make-telemetry-sending-opt-in.patch BuildRequires: git-core BuildRequires: go-vendor-tools 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 command line, eliminating the need to switch between your terminal and the GitHub website. %prep %goprep -p1 tar -xf %{S:1} %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build %global gomodulesmode GO111MODULE=on 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)" for cmd in cmd/%{name} cmd/gen-docs; do %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done # Generate manpages %{gobuilddir}/bin/gen-docs --man-page --doc-path ./share/man/man1 # Generate shell completions %{gobuilddir}/bin/%{name} completion -s bash > %{name}.bash %{gobuilddir}/bin/%{name} completion -s fish > %{name}.fish %{gobuilddir}/bin/%{name} completion -s zsh > %{name}.zsh %install %go_vendor_license_install -c %{S:2} # We are deliberately excluding cmd/gen-docs. It is only needed for building. install -Dpm 0755 %{gobuilddir}/bin/%{name} -t %{buildroot}%{_bindir}/ # Install manpages install -Dpm 0644 ./share/man/man1/%{name}*.1 -t %{buildroot}%{_mandir}/man1/ # Install shell completions install -Dpm 0644 %{name}.bash %{buildroot}%{bash_completions_dir}/%{name} install -Dpm 0644 %{name}.fish %{buildroot}%{fish_completions_dir}/%{name}.fish install -Dpm 0644 %{name}.zsh %{buildroot}%{zsh_completions_dir}/_%{name} %check %go_vendor_license_check -c %{S:2} %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}/%{name} %{_mandir}/man1/%{name}*.1* %{bash_completions_dir}/%{name} %{fish_completions_dir}/%{name}.fish %{zsh_completions_dir}/_%{name} %changelog %autochangelog