File diff-highlight.spec of Package diff-highlight
#
# spec file for package diff-highlight
#
# Copyright (c) 2021 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-highlight
Version: 1.0
Release: 0
Summary: Script to highlight modified parts of diff output
License: GPL-2.0-only
Group: Productivity/Text/Utilities
URL: https://github.com/git/git/tree/master/contrib/diff-highlight
Source0: diff-highlight
Source1: README
Source2: COPYING
Requires: perl
Recommends: colordiff
BuildArch: noarch
%description
With diff-highlight, you can post-process diff output to see character based modifications:
diff -u a.txt b.txt | diff-highlight
or, to get colored output:
colordiff -u a.txt b.txt | diff-highlight
Diff-highlight expects a unified diff output ("diff -u") as pipe input.
It's a contributed script to git and is located in the "contrib" directory of the git repository.
%prep
#---The following code snippet is used to prepare sources:
#urlbase="https://github.com/git/git/raw/master"
#curl -sSf -L -OR "$urlbase/contrib/diff-highlight/README"
#curl -sSf -L -OR "$urlbase/COPYING"
#{
# echo "#!/usr/bin/perl"
# curl -sSf -L "$urlbase/contrib/diff-highlight/DiffHighlight.pm"
# echo ""
# curl -sSf -L "$urlbase/contrib/diff-highlight/diff-highlight.perl"
#} > diff-highlight
#chmod 755 diff-highlight
cp -a %{SOURCE1} %{SOURCE2} .
%build
%install
install -d -m 755 %{buildroot}%{_bindir}
install -m 755 %{SOURCE0} %{buildroot}%{_bindir}/%{name}
%files
%doc README
%license COPYING
%{_bindir}/%{name}
%changelog