File git-delta.spec of Package git-delta
#
# spec file for package git-delta
#
# 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/
#
%define short_name delta
Name: git-delta
Version: 0.18.2+git20250803.d5e0565
Release: 0
Summary: A syntax-highlighting pager for git, diff, and grep output
License: MIT
URL: https://github.com/dandavison/%{short_name}
Source0: %{name}-%{version}.tar.gz
Source1: vendor.tar.zst
BuildRequires: cargo
BuildRequires: cargo-packaging
BuildRequires: meson
BuildRequires: rust
%description
Code evolves, and we all spend time studying diffs. Delta aims to make this
both efficient and enjoyable: it allows you to make extensive changes to the
layout and styling of diffs, as well as allowing you to stay arbitrarily
close to the default git/diff output.
%prep
%autosetup -a1
%build
cargo build --frozen --release
%install
install -v -Dm755 target/release/%{short_name} %{buildroot}%{_bindir}/%{short_name}
sed -e 's,#!/bin/bash,,' -i %{_builddir}/%{name}-%{version}%{_sysconfdir}/completion/completion.bash
install -v -Dm644 %{_builddir}/%{name}-%{version}%{_sysconfdir}/completion/completion.bash %{buildroot}%{_datadir}/bash-completion/completions/delta
install -v -Dm644 %{_builddir}/%{name}-%{version}%{_sysconfdir}/completion/completion.fish %{buildroot}%{_datadir}/fish/completions/delta.fish
install -v -Dm644 %{_builddir}/%{name}-%{version}%{_sysconfdir}/completion/completion.zsh %{buildroot}%{_datadir}/zsh/site-functions/_delta
install -v -Dm644 %{_builddir}/%{name}-%{version}/themes.gitconfig %{buildroot}%{_defaultdocdir}/%{name}/themes.gitconfig
%files
%{_bindir}/%{short_name}
%license LICENSE
%doc README.md
%doc themes.gitconfig
%{_datadir}/bash-completion/completions/%{short_name}
%dir %{_datadir}/fish
### fish >= v4.0 is providing this (now)
#%%dir %%{_datadir}/fish/completions
%exclude %{_datadir}/fish/completions/%{short_name}.fish
#####
%{_datadir}/zsh/site-functions/_%{short_name}
%changelog