File gitea-tea.spec of Package gitea-tea

#
# spec file for package gitea-tea
#
# Copyright (c) 2022 SUSE LLC
#
# 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/
#


%global provider_prefix gitea.com/gitea/tea
%global import_path	%{provider_prefix}
Name:           gitea-tea
Version:        0.11.1
Release:        0
Summary:        A command line tool to interact with Gitea servers
License:        MIT
Group:          Development/Tools/Version Control
URL:            https://gitea.com/gitea/tea/
Source0:        tea-%{version}.tar.gz
Source1:        vendor.tar.gz
BuildRequires:  golang(API) >= 1.24.3
BuildRequires:  golang-packaging
Conflicts:      tea
%{go_nostrip}
%{go_provides}

%description
This is a command line tool to interact with Gitea servers.

%package bash-completion
Summary:        Bash Completion for Gitea's tea CLI
BuildRequires:  bash-completion
Requires:       %{name} = %{version}
Requires:       bash-completion
Supplements:    (%{name} and bash-completion)
BuildArch:      noarch

%description bash-completion
Bash command line completion support for Gitea's tea CLI.

%package zsh-completion
Summary:        Zsh Completion for Gitea's tea CLI
BuildRequires:  zsh
Requires:       %{name} = %{version}
Requires:       zsh
Supplements:    (%{name} and zsh)
BuildArch:      noarch

%description zsh-completion
Zsh command line completion support for Gitea's tea CLI.

%prep
%setup -q -n tea-%{version}
tar -xvzf %{SOURCE1}

%build
%{goprep} %{import_path}
export GOFLAGS="$GOFLAGS -buildmode=pie -mod=vendor"
#%%gobuild .
go build \
  -mod=vendor \
  -buildmode=pie \
  -ldflags "-X main.Version=%{version}"

%install
%{goinstall}
#%%{gosrc}
%{gofilelist}
install -d %{buildroot}%{_bindir}
install -D tea %{buildroot}%{_bindir}
install -m 0644 -D contrib/autocomplete.sh %{buildroot}%{_datadir}/bash-completion/completions/tea
install -m 0644 -D contrib/autocomplete.zsh %{buildroot}%{_datadir}/zsh/site-functions/_tea

%check
#%%gotest %%{import_path}

%files -f file.lst
%license LICENSE
%doc README.md
%{_bindir}/tea

%files bash-completion
%{_datadir}/bash-completion/completions/tea

%files zsh-completion
%{_datadir}/zsh/site-functions/_tea

%changelog
openSUSE Build Service is sponsored by