%global debug_package %{nil} Name: gh-cli Summary: GitHub’s official command line tool Version: 0.11.0 Release: 1%{?dist} URL: https://github.com/cli/cli License: MIT Source0: %{URL}/archive/v%{version}.tar.gz#/%{name}-v%{version}.tar.gz # BuildRequires: compiler(go-compiler) BuildRequires: git BuildRequires: wget %if 0%{?fedora} > 29 BuildRequires: compiler(go-compiler) BuildRequires: systemd-rpm-macros %else BuildRequires: golang %define _unitdir /usr/lib/systemd/system %endif %define gobuild(o:) %{expand: # https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12 %global _dwz_low_mem_die_limit 0 %ifnarch ppc64 %{?gobuilddir:GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"} \\ go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-}%{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x %{?**}; %else %{?gobuilddir:GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"} \\ go build -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-}%{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x %{?**}; %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 working with git and your code. %prep %setup -q -n cli-%{version} %build export GOPATH=$(pwd)/_build mkdir -p $(pwd)/%{_target_platform} export OUT=$(pwd)/%{_target_platform} %gobuild -o $OUT/gh ./cmd/gh %install mkdir -p %{buildroot}%{_bindir} install -m 0755 -vp %{_target_platform}/* %{buildroot}%{_bindir}/ %files %defattr(-,root,root,-) %{_bindir}/* %changelog