File lazygit.spec of Package lazygit
#
# spec file for package lazygit
#
# Copyright (c) 2019 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/
#
Name: lazygit
Version: 0.38.2
Release: 0
Summary: Simple terminal UI for git commands
License: MIT
URL: https://github.com/jesseduffield/lazygit
Source0: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
BuildRequires: fdupes
BuildRequires: go >= 1.11
BuildRequires: go-md2man
BuildRequires: golang-github-kr-pty
BuildRequires: golang-packaging
%description
A simple terminal UI for git commands, written in Go with the gocui library.
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 stepping through each hunk and if a hunk can't be split down any further but contains code you don't want to stage, bad luck? 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
%setup -q
%setup -q -T -D -a 1
%build
export VERSION=%{version}
export COMMIT=%{commit}
export CGO_ENABLED=1
go build \
-mod=vendor \
-buildmode=pie \
-ldflags "-s -w -X main.gitCommit=$COMMIT -X main.version=$VERSION" \
-o %{name} ;
%install
# Install the binary.
install -D -m 0755 %{name} "%{buildroot}/%{_bindir}/%{name}"
# Build the man page.
go-md2man -in README.md -out %{name}.1
# Install the man page.
install -D -m 0644 %{name}.1 "%{buildroot}/%{_mandir}/man1/%{name}.1"
rm %{name}.1
find {README,CONTRIBUTING,CODE-OF-CONDUCT}.md -type f -perm /111 -exec chmod 644 {} \;
%fdupes %{buildroot}
%files
%license LICENSE
%doc README.md CODE-OF-CONDUCT.md CONTRIBUTING.md
%{_bindir}/lazygit
%dir %{_mandir}/man1/
%{_mandir}/man1/lazygit.1%{?ext_man}
%changelog