glab/glab.spec
Martin Pluskal 5f8e49f6b2 Accepting request 1105202 from home:pdostal:branches:devel:tools:scm
- Update to version 1.32.0:
  * feat: handle response from VertexAI instead of OpenAI
  * feat: add support for child pipelines in ci view
  * fix: Don't add glab-resolved when it already exists in a remote
  * feat(ci): add Pipeline IID to `ci list`
  * fix(deps): upgrade go-gitlab to v0.88.0
  * fix(issue): fix using issue commands from non-git dir
  * test: Fix test Test_repoArchive_Integration integration test
  * chore: use latest tview version
  * chore: downgrade tview
  * fix: Handle trailing slash in remote URL
  * fix(ci run): use correct default branch
  * release: fix assets-links suggestion/help
  * fix: use basereporemote.name as argument to GetDefaultBranch
  * chore: enable better debugging for flaky test
  * docs: clarify possible options for parameters for "ci list"
  * chore(ci): save test log as an artifact
  * chore: bumping go-gitlab to 0.86.0
  * chore(ci): remove ssh key from build
  * fix: goreleaser deprecated replacements, fixing the filename templates
  * fix: Preventing a panic when not using a sub command
  * feat: add incident note command
  * chore: use new test repo for clone integration tests
  * fixup! set error context in mrBody
  * fixup! no index trickery, compare values
  * feat(mr): populate description from commit messages
  * refactor(mr): split mrBody out of mrBodyAndTitle

OBS-URL: https://build.opensuse.org/request/show/1105202
OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/glab?expand=0&rev=31
2023-08-22 09:30:41 +00:00

144 lines
4.3 KiB
RPMSpec

#
# spec file for package glab
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2021-2022 Orville Q. Song <orville@anislet.dev>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true
Name: glab
Version: 1.32.0
Release: 0
Summary: A GitLab command line tool
License: MIT
Group: Development/Tools/Other
URL: https://gitlab.com/gitlab-org/cli
Source0: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
BuildRequires: golang-packaging
BuildRequires: golang(API) >= 1.18
Suggests: glab-doc
%description
glab is a command line tool bringing GitLab's features to the command line.
%package doc
Summary: Documentation for GLab
Group: Documentation/HTML
BuildArch: noarch
%description doc
glab is a command line tool bringing GitLab's features to the command line.
%package bash-completion
Summary: Bash completion for %{name}
Group: System/Shells
Requires: %{name} = %{version}
Supplements: (%{name} and bash)
BuildArch: noarch
%description bash-completion
Bash command line completion support for %{name}.
%package fish-completion
Summary: Fish completion for %{name}
Group: System/Shells
Requires: %{name} = %{version}
Supplements: (%{name} and fish)
BuildArch: noarch
%description fish-completion
Fish command line completion support for %{name}.
%package zsh-completion
Summary: Zsh completion for %{name}
Group: System/Shells
Requires: %{name} = %{version}
Supplements: (%{name} and zsh)
BuildArch: noarch
%description zsh-completion
Zsh command line completion support for %{name}.
%prep
%setup -q -n %{name}-%{version}
%setup -a1 %{SOURCE1}
%build
DATE_FMT="+%%Y-%%m-%%dT%%H:%%M:%%SZ"
BUILD_DATE=$(date -u -d "@${SOURCE_DATE_EPOCH}" "${DATE_FMT}" 2>/dev/null || date -u -r "${SOURCE_DATE_EPOCH}" "${DATE_FMT}" 2>/dev/null || date -u "${DATE_FMT}")
go build \
-mod=vendor \
-buildmode=pie \
-ldflags "-s -w -X main.version=%{version} -X main.build=$BUILD_DATE -X main.debugMode=false" \
./cmd/glab
# Build HTML docs
go run ./cmd/gen-docs/docs.go
# Build manpages
go run -v -p 4 -x -mod=vendor ./cmd/gen-docs/docs.go --manpage --path ./share/man/man1
gzip -r ./share/man/man1
# Generate completion files
go run -v -p 4 -x -mod=vendor ./cmd/glab/ completion -s bash > %{name}.bash
go run -v -p 4 -x -mod=vendor ./cmd/glab/ completion -s zsh > %{name}.zsh
go run -v -p 4 -x -mod=vendor ./cmd/glab/ completion -s fish > %{name}.fish
%install
mkdir -p "%{buildroot}/%{_bindir}/"
install -D -m 0755 %{name} "%{buildroot}/%{_bindir}/%{name}"
# Install HTML docs
mkdir -p "%{buildroot}/%{_docdir}/%{name}/"
cp -vr ./docs/source/* %{buildroot}%{_docdir}/%{name}/
find %{buildroot}%{_docdir}/%{name}/ -type f -exec chmod 644 {} "+"
find %{buildroot}%{_docdir}/%{name}/ -type d -exec chmod 755 {} "+"
# Install manpages
mkdir -p "%{buildroot}/%{_mandir}/man1/"
cp ./share/man/man1/* %{buildroot}%{_mandir}/man1/
find %{buildroot}%{_mandir}/man1/ -type f -exec chmod 644 {} "+"
# Install completion files
install -D -m0644 %{name}.zsh %{buildroot}%{_datadir}/zsh/site-functions/_%{name}
install -D -m0644 %{name}.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/%{name}.fish
install -D -m0644 %{name}.bash %{buildroot}%{_datadir}/bash-completion/completions/%{name}
%files
%license LICENSE
%doc README.md
%{_mandir}/*/*
%{_bindir}/%{name}
%files doc
%{_docdir}/%{name}
%exclude %{_docdir}/%{name}/README.md
%files bash-completion
%dir %{_datadir}/bash-completion/
%{_datadir}/bash-completion/completions/
%files fish-completion
%dir %{_datadir}/fish/
%{_datadir}/fish/vendor_completions.d/
%files zsh-completion
%dir %{_datadir}/zsh/
%{_datadir}/zsh/site-functions/
%changelog