File diff-so-fancy.spec of Package diff-so-fancy
#
# spec file for package diff-so-fancy
#
# Copyright (c) 2024 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: diff-so-fancy
Version: 1.4.4
Release: 0
Summary: Script to highlight modified parts of diff output
License: MIT
URL: https://github.com/so-fancy/diff-so-fancy
Source: https://github.com/so-fancy/diff-so-fancy/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires: sed
BuildArch: noarch
%description
diff-so-fancy strives to make your diffs human readable instead of machine
readable. This helps improve code quality and helps you spot defects faster.
%prep
%autosetup
%build
%install
install -Dpm 0755 %{name} %{buildroot}%{_bindir}/%{name}
install -Dpm 0644 lib/DiffHighlight.pm %{buildroot}%{_datadir}/%{name}/DiffHighlight.pm
# Fix shebang
sed -i '1 s|/usr/bin/env perl|/usr/bin/perl|' %{buildroot}%{_bindir}/%{name}
# Fix path
sed -i 's|^use lib .*$|use lib "%{_datadir}/%{name}";|' %{buildroot}%{_bindir}/%{name}
%files
%doc README.md
%license LICENSE
%{_bindir}/%{name}
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/DiffHighlight.pm
%changelog