gh/gh.spec
2024-06-24 20:34:31 +00:00

60 lines
1.1 KiB
RPMSpec

%define debug %nil
%define debug_package %nil
%define secscan 1
Name: gh
Version: 2.52.0
Release: 1
Summary: github cli
URL: https://cli.github.com
Source0: https://github.com/cli/cli/archive/v%{version}/%{name}-%{version}.tar.gz
License: MIT
Group: Development/Other
BuildRequires: go > 1.16
BuildRequires: git-core
BuildRequires: upx
%if %{secscan}
BuildRequires: clamav
BuildRequires: trivy
%endif
%description
gh is GitHub on the command line, and it's now available
in beta. It brings pull requests, issues, and other GitHub
concepts to the terminal next to where you are already
2working with git and your code
%prep
%setup -qn cli-%{version}
%if %{secscan}
clamscan -ir .
trivy fs --scanners vuln --format cosign-vuln .
%endif
%build
export GOPROXY=https://proxy.golang.org/cached-only
%make VERSION=%{version}
# bin package
upx bin/%{name}
%install
install -Dm0755 bin/%{name} %{buildroot}%{_bindir}/%{name}
%files
%doc README.md LICENSE
%{_bindir}/%{name}
%check
export GOPROXY=direct
go test ./...
%if %{secscan}
clamscan -ir %{buildroot}
%endif
%{buildroot}%{_bindir}/%{name} --version