File colout.spec of Package colout

#
# spec file for package colout
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 releasedate 2018-08-04
Name:           colout
Version:        0.6.1
Release:        0
Summary:        Color up arbitrary command output
License:        GPL-3.0
Group:          Productivity/File utilities
URL:            http://nojhan.github.io/colout/
Source0:        https://github.com/nojhan/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        colout.pod
BuildRequires:  fdupes
BuildRequires:  python3 >= 3.7
BuildArch:      noarch

%description
colout is a simple command to add colors to a text stream in your terminal.

The colout command line interface has been carefully designed to be simple.
Basically, you will call it like:
<text stream> | colout <pattern to color> [color [style]]

colout has the ability to use 8 colors mode, 256 colors mode, colormaps, themes
and source code syntax coloring. Patterns are regular expressions.

You can think of colout as an alternative to grep --color which will preserve
the surrounding context, whith more powerful coloring capabilites.

%prep
%setup -q
# remove shebang
sed -i '/^#!/d' colout/colout.py

%build
python3 setup.py build
perldoc -o nroff -w center:" " -w date:%{releasedate} -w release:" " -w section:1 %{SOURCE1} > ./colout.1

%install
python3 setup.py install --skip-build --root=%{buildroot} --prefix=%{_prefix}
install -Dm 0644 colout.1 %{buildroot}%{_mandir}/man1/colout.1
%fdupes -s %{buildroot}%{python3_sitelib}

%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%{python3_sitelib}/%{name}*
%{_mandir}/man1/%{name}.1%{?ext_man}

%changelog
openSUSE Build Service is sponsored by