]> git.pld-linux.org Git - packages/python-cssutils.git/blame - python-cssutils.spec
rebuild with python 3.10
[packages/python-cssutils.git] / python-cssutils.spec
CommitLineData
9565b208
JB
1#
2# Conditional build:
e1cf6bb3
JB
3%bcond_without python2 # CPython 2.x module
4%bcond_without python3 # CPython 3.x module
5%bcond_without tests # unit tests
6%bcond_with tests_net # unit tests using network
9565b208 7
326d111c 8%define module cssutils
11143ddf 9%define encutils_ver 0.9.8
9565b208
JB
10Summary: A CSS Cascading Style Sheets library for Python 2
11Summary(pl.UTF-8): Biblioteka CSS (Cascading Style Sheets) dla Pythona 2
326d111c 12Name: python-%{module}
9565b208 13Version: 1.0.2
e72c597e 14Release: 8
2c1855bc 15Epoch: 1
6d86ddd7 16License: LGPL v3+
326d111c 17Group: Libraries/Python
94d72300 18Source0: https://files.pythonhosted.org/packages/source/c/cssutils/%{module}-%{version}.tar.gz
9565b208
JB
19# Source0-md5: dc66d96c2d78f1687f59ac412fe9d318
20Patch0: %{name}-tests.patch
21Patch1: %{name}-mock.patch
326d111c 22URL: http://cthedot.de/cssutils/
9565b208 23%if %{with python2}
326d111c 24BuildRequires: python-devel >= 1:2.5
9565b208 25%{?with_tests:BuildRequires: python-mock}
52e73fa6 26BuildRequires: python-setuptools
9565b208
JB
27%endif
28%if %{with python3}
29BuildRequires: python3-2to3 >= 1:3.2
30BuildRequires: python3-devel >= 1:3.2
31BuildRequires: python3-setuptools
32%endif
ce56d868 33BuildRequires: rpm-pythonprov
9565b208
JB
34BuildRequires: rpmbuild(macros) >= 1.714
35Requires: python-modules >= 1:2.5
6d86ddd7
AF
36Provides: python-encutils = %{encutils_ver}
37Obsoletes: python-encutils < %{encutils_ver}
fb9c2bb1 38BuildArch: noarch
326d111c
AF
39BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41%description
42A Python package to parse and build CSS Cascading Style Sheets. Partly
ce56d868
JB
43implements the DOM Level 2 Stylesheets and DOM Level 2 CSS interfaces.
44
fc31ca58 45%description -l pl.UTF-8
ce56d868 46Pakiet Pythona do analizy i tworzenia CSS (Cascading Style Sheets).
fc31ca58 47Częściowo implementuje interfejsy DOM Level 2 Stylesheets oraz DOM
ce56d868 48Level 2 CSS.
326d111c 49
9565b208
JB
50%package -n python3-%{module}
51Summary: A CSS Cascading Style Sheets library for Python 3
52Summary(pl.UTF-8): Biblioteka CSS (Cascading Style Sheets) dla Pythona 3
53Group: Libraries/Python
54Requires: python3-modules >= 1:3.2
55
56%description -n python3-%{module}
57A Python package to parse and build CSS Cascading Style Sheets. Partly
58implements the DOM Level 2 Stylesheets and DOM Level 2 CSS interfaces.
59
60%description -n python3-%{module} -l pl.UTF-8
61Pakiet Pythona do analizy i tworzenia CSS (Cascading Style Sheets).
62Częściowo implementuje interfejsy DOM Level 2 Stylesheets oraz DOM
63Level 2 CSS.
64
326d111c 65%prep
ab760d3b 66%setup -q -n %{module}-%{version}
9565b208
JB
67%patch0 -p1
68%patch1 -p1
69
6d86ddd7
AF
70eval $(PYTHONPATH=src python -c "from encutils import VERSION;print 'VERSION=%%s' %% VERSION")
71if [ $VERSION != %{encutils_ver} ]; then
72 echo "Please set encutils_ver to $VERSION"
73 exit 1
74fi
326d111c 75
e1cf6bb3
JB
76%if %{without tests_net}
77%{__sed} -i -e 's/def test_parseUrl/def skip_parseUrl/' src/cssutils/tests/test_parse.py
78%{__sed} -i -e 's/def test_handlers/def skip_handlers/' src/cssutils/tests/test_errorhandler.py
79%endif
80
326d111c 81%build
9565b208 82%if %{with python2}
7737135b 83%py_build
326d111c 84
9565b208
JB
85%if %{with tests}
86%{__python} -m unittest discover -t build-2/lib -s build-2/lib/cssutils/tests
87%endif
88%endif
89
90%if %{with python3}
91%py3_build
92
93%if %{with tests}
94%{__python3} -m unittest discover -t build-3/lib -s build-3/lib/cssutils/tests
95%endif
96%endif
97
326d111c
AF
98%install
99rm -rf $RPM_BUILD_ROOT
100
9565b208
JB
101%if %{with python3}
102%py3_install
103
104for f in csscapture csscombine cssparse ; do
105 %{__mv} $RPM_BUILD_ROOT%{_bindir}/$f $RPM_BUILD_ROOT%{_bindir}/${f}-3
106done
107
108%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/cssutils/tests
109%endif
110
111%if %{with python2}
112%py_install
113
114for f in csscapture csscombine cssparse ; do
115 %{__mv} $RPM_BUILD_ROOT%{_bindir}/$f $RPM_BUILD_ROOT%{_bindir}/${f}-2
116 ln -sf ${f}-2 $RPM_BUILD_ROOT%{_bindir}/$f
117done
326d111c 118
e2bea7fd 119%py_postclean
9565b208
JB
120%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/cssutils/tests
121%endif
e2bea7fd 122
326d111c
AF
123%clean
124rm -rf $RPM_BUILD_ROOT
125
9565b208 126%if %{with python2}
326d111c
AF
127%files
128%defattr(644,root,root,755)
129%doc README.txt
e2bea7fd 130%attr(755,root,root) %{_bindir}/csscapture
131%attr(755,root,root) %{_bindir}/csscombine
ce56d868 132%attr(755,root,root) %{_bindir}/cssparse
9565b208
JB
133%attr(755,root,root) %{_bindir}/csscapture-2
134%attr(755,root,root) %{_bindir}/csscombine-2
135%attr(755,root,root) %{_bindir}/cssparse-2
136%{py_sitescriptdir}/cssutils
137%{py_sitescriptdir}/encutils
138%{py_sitescriptdir}/cssutils-%{version}-py*.egg-info
139%endif
140
141%if %{with python3}
142%files -n python3-%{module}
143%defattr(644,root,root,755)
144%attr(755,root,root) %{_bindir}/csscapture-3
145%attr(755,root,root) %{_bindir}/csscombine-3
146%attr(755,root,root) %{_bindir}/cssparse-3
147%{py3_sitescriptdir}/cssutils
148%{py3_sitescriptdir}/encutils
149%{py3_sitescriptdir}/cssutils-%{version}-py*.egg-info
150%endif
This page took 0.107201 seconds and 4 git commands to generate.