File lazygit.spec of Package lazygit

#
# spec file for package gh
#
# Copyright (c) 2023 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/
#


%define goflags "-buildmode=pie -trimpath -mod=vendor -modcacherw"
%define sname lazygit
Name:           lazygit
Version:        0.38.2
Release:        0
Summary:        Simple terminal UI for git commands
License:        MIT
Group:          Development/Tools/Other
URL:            https://github.com/jesseduffield/lazygit
Source0:        %{name}-%{version}.tar.gz
Source1:        vendor.tar.gz
BuildRequires:  golang(API) >= 1.18
Requires:       git-core

%description
Rant time: You've heard it before, git is powerful, but what good is that power
when everything is so damn hard to do? Interactive rebasing requires you to
edit a goddamn TODO file in your editor? Are you kidding me? To stage part of a
file you need to use a command line program to step through each hunk and if a
hunk can't be split down any further but contains code you don't want to stage,
you have to edit an arcane patch file by hand? Are you KIDDING me?! Sometimes
you get asked to stash your changes when switching branches only to realise
that after you switch and unstash that there weren't even any conflicts and it
would have been fine to just checkout the branch directly? YOU HAVE GOT TO BE
KIDDING ME!

If you're a mere mortal like me and you're tired of hearing how powerful git is
when in your daily life it's a powerful pain in your ass, lazygit might be for
you.

%prep
%autosetup -n %{sname}-%{version} -a 1

%build
export GOFLAGS="-buildmode=pie -trimpath -mod=vendor -modcacherw -ldflags=-linkmode=external"
go build \
   -mod=vendor \
   -buildmode=pie

%install
install -Dm755 lazygit %{buildroot}%{_bindir}/lazygit

%files
%doc README.md
%license LICENSE
%{_bindir}/lazygit

%changelog
openSUSE Build Service is sponsored by