File python-scour.spec of Package python-scour

#
# spec file for package python-scour
#
# Copyright (c) 2015 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 http://bugs.opensuse.org/
#

# https://en.opensuse.org/openSUSE:Packaging_Python
%define pythons python3
%{?!python_module:%define python_module() python-%{**} python3-%{**}}

Name:           python-scour
Version:        0.37
Release:        0
Summary:        An SVG scrubber
License:        Apache-2.0
Group:          System/Libraries
Url:            https://github.com/oberstet/scour
Source:         python-scour-%{version}.tar.xz

BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  unzip
BuildRequires:  fdupes

# Modules required for running scour.
Requires:       %{python_module setuptools}
Requires:       %{python_module xml}

Requires(post):		update-alternatives
Requires(postun):	update-alternatives

Provides:       scour = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%python_subpackages

%description
Scour is an open-source Python script that aggressively cleans SVG files, removing a lot of 'cruft' that certain tools or authors embed into their documents. The goal of scour is to provide an identically rendered image.

%prep
%setup -q -n python-scour-%{version}
# fix end of line encoding
sed -i 's/\r$//' scour/scour.py
# remove unwanted shebang
sed -i '/^#!/ d' scour/{scour.py,yocto_css.py,svg_transform.py}

%build
%python_build

%install
%python_install
%python3_fix_shebang
%python_expand %fdupes %{buildroot}

%files %{python_files}
%defattr(-,root,root)
%{python_sitelib}/*
%{_bindir}/*

%changelog

openSUSE Build Service is sponsored by