File python-htmlmin.spec of Package python-htmlmin

# spec file for package python-htmlmin
# Copyright (c) 2020 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

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-htmlmin
Version:        0.1.12
Release:        0
Summary:        An HTML Minifier
License:        BSD-3-Clause
Group:          Development/Languages/Python
Source1:        tests.tar.bz2
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python-setuptools
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch:      noarch
# SECTION test requirements
BuildRequires:  %{python_module pytest}

A configurable HTML Minifier with safety features.

%setup -q -n htmlmin-%{version} -a1
# is installed without exec permissions (and they're actually not needed) so
# we remove the shebang
sed -ie "s,#!%{_bindir}/env python,##!%{_bindir}/python3," htmlmin/


%python_clone -a %{buildroot}%{_bindir}/htmlmin
%python_expand %fdupes %{buildroot}%{$python_sitelib}


%python_install_alternative htmlmin

%python_uninstall_alternative htmlmin

%files %{python_files}
%doc README.rst
%license LICENSE
%python_alternative %{_bindir}/htmlmin

openSUSE Build Service is sponsored by