glab/glab.spec

147 lines
4.5 KiB
RPMSpec
Raw Normal View History

#
# spec file for package glab
#
# Copyright (c) 2024 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
Accepting request 1177533 from home:pdostal:branches:devel:tools:scm - Update to version 1.41.0: * feat(issue): add epic and due-date to issue create * chore(deps): update dependency go to v1.22.3 * chore(deps): update module github.com/xanzy/go-gitlab to v0.105.0 * chore(deps): update module github.com/spf13/viper to v1.18.2 * fix(cluster-agent): construct kubeconfig authinfo name with agent id * feat: rename `ask git` to `duo ask` * chore(deps): update module github.com/hashicorp/go-version to v1.7.0 * docs: improve integration test docs * docs: clarify that fill option automatically pushes * chore(deps): update dependency axios to ^1.7.2 * chore(deps): update dependency @commitlint/format to ^19.3.0 * fix(auth status): better output for auth status * chore(deps): update module golang.org/x/term to v0.20.0 * chore(deps): update module github.com/mattn/go-runewidth to v0.0.15 * chore(deps): update module k8s.io/client-go to v0.30.1 * chore(deps): update module golang.org/x/text to v0.15.0 * docs: Fix broken or redirecting links * chore(deps): update module gopkg.in/yaml.v2 to v3 * chore(deps): update module github.com/spf13/cobra to v1.8.0 * chore: update code nagivation to use scip * chore(deps): update module github.com/spf13/cast to v1.6.0 * chore(deps): update module github.com/zalando/go-keyring to v0.2.4 * chore(deps): update module github.com/alecaivazis/survey/v2 to v2.3.7 OBS-URL: https://build.opensuse.org/request/show/1177533 OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/glab?expand=0&rev=53
2024-05-29 13:30:37 +02:00
Version: 1.41.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
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?almalinux_version} || 0%{?rocky_version}
Accepting request 1177533 from home:pdostal:branches:devel:tools:scm - Update to version 1.41.0: * feat(issue): add epic and due-date to issue create * chore(deps): update dependency go to v1.22.3 * chore(deps): update module github.com/xanzy/go-gitlab to v0.105.0 * chore(deps): update module github.com/spf13/viper to v1.18.2 * fix(cluster-agent): construct kubeconfig authinfo name with agent id * feat: rename `ask git` to `duo ask` * chore(deps): update module github.com/hashicorp/go-version to v1.7.0 * docs: improve integration test docs * docs: clarify that fill option automatically pushes * chore(deps): update dependency axios to ^1.7.2 * chore(deps): update dependency @commitlint/format to ^19.3.0 * fix(auth status): better output for auth status * chore(deps): update module golang.org/x/term to v0.20.0 * chore(deps): update module github.com/mattn/go-runewidth to v0.0.15 * chore(deps): update module k8s.io/client-go to v0.30.1 * chore(deps): update module golang.org/x/text to v0.15.0 * docs: Fix broken or redirecting links * chore(deps): update module gopkg.in/yaml.v2 to v3 * chore(deps): update module github.com/spf13/cobra to v1.8.0 * chore: update code nagivation to use scip * chore(deps): update module github.com/spf13/cast to v1.6.0 * chore(deps): update module github.com/zalando/go-keyring to v0.2.4 * chore(deps): update module github.com/alecaivazis/survey/v2 to v2.3.7 OBS-URL: https://build.opensuse.org/request/show/1177533 OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/glab?expand=0&rev=53
2024-05-29 13:30:37 +02:00
BuildRequires: golang >= 1.22
%else
BuildRequires: golang-packaging
Accepting request 1177533 from home:pdostal:branches:devel:tools:scm - Update to version 1.41.0: * feat(issue): add epic and due-date to issue create * chore(deps): update dependency go to v1.22.3 * chore(deps): update module github.com/xanzy/go-gitlab to v0.105.0 * chore(deps): update module github.com/spf13/viper to v1.18.2 * fix(cluster-agent): construct kubeconfig authinfo name with agent id * feat: rename `ask git` to `duo ask` * chore(deps): update module github.com/hashicorp/go-version to v1.7.0 * docs: improve integration test docs * docs: clarify that fill option automatically pushes * chore(deps): update dependency axios to ^1.7.2 * chore(deps): update dependency @commitlint/format to ^19.3.0 * fix(auth status): better output for auth status * chore(deps): update module golang.org/x/term to v0.20.0 * chore(deps): update module github.com/mattn/go-runewidth to v0.0.15 * chore(deps): update module k8s.io/client-go to v0.30.1 * chore(deps): update module golang.org/x/text to v0.15.0 * docs: Fix broken or redirecting links * chore(deps): update module gopkg.in/yaml.v2 to v3 * chore(deps): update module github.com/spf13/cobra to v1.8.0 * chore: update code nagivation to use scip * chore(deps): update module github.com/spf13/cast to v1.6.0 * chore(deps): update module github.com/zalando/go-keyring to v0.2.4 * chore(deps): update module github.com/alecaivazis/survey/v2 to v2.3.7 OBS-URL: https://build.opensuse.org/request/show/1177533 OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/glab?expand=0&rev=53
2024-05-29 13:30:37 +02:00
BuildRequires: golang(API) >= 1.22
%endif
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
%autosetup -p 1 -a 1 -n %{name}-%{version}
%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