File lazydocker.spec of Package lazydocker

#
# spec file for package lazydocker
#
# Copyright (c) 2025 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:           lazydocker
Version:        0.24.2+git20251114.4137d21
Release:        0
Summary:        The lazier way to manage everything docker
License:        MIT
Group:          Productivity/Text/Utilities
URL:            https://github.com/jesseduffield/%{name}
Source0:        %{name}-%{version}.tar.gz
Source1:        vendor.tar.gz
BuildRequires:  golang-packaging

%description
A simple terminal UI for both docker and docker-compose, written in Go with the gocui library.

Memorising docker commands is hard. Memorising aliases is slightly less hard.
Keeping track of your containers across multiple terminal windows is near impossible.
What if you had all the information you needed in one terminal window with every common command
living one keypress away (and the ability to add custom commands as well). Lazydocker's goal is
to make that dream a reality.

%prep
%setup -q
#%%setup -q -a 1

%build
%define main_commit $(echo %{version} | awk -F+ '{print $2}' | awk -F. '{print $2}')
%define main_date $(echo %{version} | awk -F+ '{print $2}' | awk -F. '{print $1}' | tr -d 'git')
%define main_version $(echo %{version} | awk -F+ '{print $1}')
go build \
  -mod=vendor \
  -buildmode=pie \
  -ldflags "-X main.commit=%{main_commit} -X main.date=%{main_date} -X main.version=%{main_version} -X main.buildSource=OBS"

%install
install -D -m0755 %{name} %{buildroot}%{_bindir}/%{name}

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

%changelog

openSUSE Build Service is sponsored by