3 %bcond_with tests # unit tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 %define module css_parser
8 %define egg_name css_parser
9 %define pypi_name css-parser
10 Summary: A CSS Cascading Style Sheets library for Python
11 Name: python-%{module}
15 Group: Libraries/Python
16 Source0: https://files.pythonhosted.org/packages/source/c/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
17 # Source0-md5: c6caae4db5557a07b7353c97baa13767
18 URL: https://pypi.org/project/css-parser/
19 BuildRequires: rpm-pythonprov
20 BuildRequires: rpmbuild(macros) >= 1.714
22 BuildRequires: python-modules
23 BuildRequires: python-setuptools
26 BuildRequires: python3-modules
27 BuildRequires: python3-setuptools
29 Requires: python-modules
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 A fork of the cssutils project based on version 1.0.2. This fork
35 includes general bug fixes and extensions specific to editing and
38 %package -n python3-%{module}
39 Summary: A CSS Cascading Style Sheets library for Python
40 Group: Libraries/Python
41 Requires: python3-modules
43 %description -n python3-%{module}
44 A fork of the cssutils project based on version 1.0.2. This fork
45 includes general bug fixes and extensions specific to editing and
49 %setup -q -n %{pypi_name}-%{version}
53 %py_build %{?with_tests:test}
57 %py3_build %{?with_tests:test}
61 rm -rf $RPM_BUILD_ROOT
66 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
67 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
77 rm -rf $RPM_BUILD_ROOT
81 %defattr(644,root,root,755)
83 %{py_sitescriptdir}/%{module}
84 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
88 %files -n python3-%{module}
89 %defattr(644,root,root,755)
91 %{py3_sitescriptdir}/%{module}
92 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info