File oh-my-posh.spec of Package oh-my-posh

#
# spec file for package oh-my-posh
#
# 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:           oh-my-posh
Version:        26.26.3
Release:        0
Summary:	The most customisable and low-latency cross platform/shell prompt renderer
License:        MIT
URL:            https://ohmyposh.dev
Source:         https://github.com/JanDeDobbeleer/oh-my-posh/archive/refs/tags/v%{version}.tar.xz#/%{name}-%{version}.tar.xz
Source1:	vendor.tar.xz
BuildRequires:  golang(API) >= 1.25
BuildRequires:  golang-packaging
Recommends:	%{name}-themes

%description
oh-my-posh is a custom prompt engine for any shell that has the ability to adjust the prompt string withi
a function or variable.

%package themes
Summary:	Oh My Posh predefined themes
BuildArch:      noarch

%description themes
oh-my-posh is a custom prompt engine for any shell that has the ability to adjust the prompt string withi
a function or variable.

This package contains the predefined themes.

%prep
%autosetup
cd src
tar xfv %{SOURCE1}

%build
go build -C src -buildmode=pie -mod=vendor -ldflags "
   -X github.com/jandedobbeleer/oh-my-posh/src/build.Version=%{version} \
   -X github.com/jandedobbeleer/oh-my-posh/src/build.Date=%(date -r oh-my-posh.changes --rfc-3339=seconds) \
  " -o %{name}

%install
install -D -m 755 --target-directory %{buildroot}%{_bindir} src/%{name}
install -D -m 644 --target-directory %{buildroot}%{_datadir}/%{name}/themes themes/*

%check

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

%files themes
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/themes

%changelog

openSUSE Build Service is sponsored by