# Generated by go2rpm 1.8.2 %bcond_without check # https://github.com/cli/cli %global goipath github.com/cli/cli/v2 Version: 2.28.0 %gometa -f %global goname gh %global common_description %{expand: GitHub’s official command line tool.} %global godevelheader %{expand: Obsoletes: golang-github-cli-devel < 2.4.0-3 } %global golicenses LICENSE %global godocs README.md Name: %{goname} Release: %autorelease Summary: GitHub’s official command line tool License: MIT URL: %{gourl} Source: %{gosource} BuildRequires: git-core BuildRequires: sed Requires: git-core %description %{common_description} %gopkg %prep %goprep # Use golang-github-cli-cyrpto forked module # https://github.com/cli/cli/issues/4731 sed -i "s|golang.org/x/crypto|github.com/cli/crypto|" $(find . -name "*.go" -type f) sed -i "s|github.com/cli/crypto/nacl/box|golang.org/x/crypto/nacl/box|" $(find . -name "*.go" -type f) %generate_buildrequires %go_generate_buildrequires %build export 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 %gopkginstall # 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}%{_datadir}/bash-completion/completions/%{name} install -Dpm 0644 %{name}.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/%{name}.fish install -Dpm 0644 %{name}.zsh %{buildroot}%{_datadir}/zsh/site-functions/_%{name} %if %{with check} %check for test in "TestRebuildContainerIncremental" "TestStartJupyterServerSuccess" \ "TestStartJupyterServerFailure" "TestStartSSHServerFailure" \ "TestStartSSHServerSuccess" "TestRebuildContainerFull" \ "TestRebuildContainerFailure" \ ; do awk -i inplace '/^func.*'"$test"'\(/ { print; print "\tt.Skip(\"disabled failing test\")"; next}1' $(grep -rl $test) done %gocheck %endif %files %license LICENSE %doc README.md %{_bindir}/%{name} %{_mandir}/man1/%{name}*1* %dir %{_datadir}/bash-completion %dir %{_datadir}/bash-completion/completions %{_datadir}/bash-completion/completions/%{name} %dir %{_datadir}/fish %dir %{_datadir}/fish/vendor_completions.d %{_datadir}/fish/vendor_completions.d/%{name}.fish %dir %{_datadir}/zsh %dir %{_datadir}/zsh/site-functions %{_datadir}/zsh/site-functions/_%{name} %gopkgfiles %changelog %autochangelog