Blame python-cssmin.spec

c5abe1
#
c5abe1
# spec file for package python-cssmin
c5abe1
#
6ae9f8
# Copyright (c) 2025 SUSE LLC
c5abe1
#
c5abe1
# All modifications and additions to the file contributed by third parties
c5abe1
# remain the property of their copyright owners, unless otherwise agreed
c5abe1
# upon. The license for this file, and modifications and additions to the
c5abe1
# file, is the same license as for the pristine package itself (unless the
c5abe1
# license for the pristine package is not an Open Source License, in which
c5abe1
# case the license is the MIT License). An "Open Source License" is a
c5abe1
# license that conforms to the Open Source Definition (Version 1.9)
c5abe1
# published by the Open Source Initiative.
c5abe1
c5abe1
# Please submit bugfixes or comments via https://bugs.opensuse.org/
c5abe1
#
c5abe1
c5abe1
6ae9f8
%bcond_without libalternatives
c5abe1
Name:           python-cssmin
c5abe1
Version:        0.2.0
c5abe1
Release:        0
c5abe1
Summary:        YUI CSS compression algorithm
c5abe1
License:        BSD-3-Clause AND MIT
c5abe1
Group:          Development/Languages/Python
c5abe1
URL:            https://github.com/zacharyvoase/cssmin
c5abe1
Source:         https://files.pythonhosted.org/packages/source/c/cssmin/cssmin-%{version}.tar.gz
c5abe1
BuildRequires:  %{python_module packaging}
6ae9f8
BuildRequires:  %{python_module pip}
c5abe1
BuildRequires:  %{python_module setuptools}
6ae9f8
BuildRequires:  %{python_module wheel}
6ae9f8
BuildRequires:  alts
c5abe1
BuildRequires:  fdupes
c5abe1
BuildRequires:  python-rpm-macros
6ae9f8
Requires:       alts
c5abe1
BuildArch:      noarch
c5abe1
%python_subpackages
c5abe1
c5abe1
%description
c5abe1
This is a Python port of the YUI CSS Compressor.
c5abe1
c5abe1
%prep
6ae9f8
%autosetup -p1 -n cssmin-%{version}
c5abe1
c5abe1
%build
6ae9f8
%pyproject_wheel
c5abe1
c5abe1
%install
6ae9f8
%pyproject_install
c5abe1
%{python_expand chmod a+x %{buildroot}%{$python_sitelib}/cssmin.py
c5abe1
sed -i "s|^#!.*env python$|#!%{__$python}|" %{buildroot}%{$python_sitelib}/cssmin.py
c5abe1
}
c5abe1
%python_clone -a %{buildroot}%{_bindir}/cssmin
c5abe1
%python_expand %fdupes %{buildroot}%{$python_sitelib}
c5abe1
6ae9f8
%check
6ae9f8
# Good upstream have never even heard about the idea of tests
c5abe1
6ae9f8
%pre
6ae9f8
%python_libalternatives_reset_alternative cssmin
c5abe1
c5abe1
%files %{python_files}
c5abe1
%python_alternative %{_bindir}/cssmin
6ae9f8
%{python_sitelib}/cssmin.py
6ae9f8
%{python_sitelib}/cssmin-%{version}*-info
c5abe1
%pycache_only %{python_sitelib}/__pycache__
c5abe1
c5abe1
%changelog