3 %bcond_without doc # don't build doc
4 %bcond_with tests # do not perform "make test"
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 %define pypi_name django_compressor
9 %define module django-compressor
10 Summary: Compresses linked and inline JavaScript or CSS into single cached files
11 Name: python-%{module}
15 Group: Libraries/Python
16 Source0: https://files.pythonhosted.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
17 # Source0-md5: 5e74141076b70272149ed07e6ce0ea56
18 URL: http://django-compressor.readthedocs.io/
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
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 Django Compressor combines and compresses linked and inline JavaScript
34 or CSS in a Django templates into cacheable static files.
36 %package -n python3-django-compressor
37 Summary: Compresses linked and inline JavaScript or CSS into single cached files
38 Group: Libraries/Python
40 %description -n python3-django-compressor
41 Django Compressor combines and compresses linked and inline JavaScript
42 or CSS in a Django templates into cacheable static files.
45 %setup -q -n %{pypi_name}-%{version}
49 %py_build %{?with_tests:test}
53 %py3_build %{?with_tests:test}
57 rm -rf $RPM_BUILD_ROOT
60 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/compressor/tests
61 %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/compressor/test_*.py*
67 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/compressor/tests
68 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/compressor/__pycache__/test_*.pyc
69 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/compressor/test_*.py
73 rm -rf $RPM_BUILD_ROOT
76 %defattr(644,root,root,755)
77 %doc README.rst LICENSE
78 %{py_sitescriptdir}/compressor
79 %{py_sitescriptdir}/%{pypi_name}-%{version}-py*.egg-info
82 %files -n python3-django-compressor
83 %defattr(644,root,root,755)
84 %doc README.rst LICENSE
85 %{py3_sitescriptdir}/compressor
86 %{py3_sitescriptdir}/%{pypi_name}-%{version}-py*.egg-info