]>
Commit | Line | Data |
---|---|---|
0629bc99 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # don't build doc | |
2d624667 | 4 | %bcond_with tests # do not perform "make test" |
0629bc99 ER |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
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} | |
f9043881 | 12 | Version: 2.1.1 |
0fd60ad1 | 13 | Release: 6 |
0629bc99 ER |
14 | License: MIT |
15 | Group: Libraries/Python | |
fc9139c1 | 16 | Source0: https://files.pythonhosted.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz |
f9043881 | 17 | # Source0-md5: 5e74141076b70272149ed07e6ce0ea56 |
fc9139c1 | 18 | URL: http://django-compressor.readthedocs.io/ |
0629bc99 ER |
19 | BuildRequires: rpm-pythonprov |
20 | BuildRequires: rpmbuild(macros) >= 1.714 | |
21 | %if %{with python2} | |
22 | BuildRequires: python-modules | |
23 | BuildRequires: python-setuptools | |
24 | %endif | |
25 | %if %{with python3} | |
26 | BuildRequires: python3-modules | |
27 | BuildRequires: python3-setuptools | |
28 | %endif | |
0629bc99 ER |
29 | BuildArch: noarch |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
9e40f158 | 33 | Django Compressor combines and compresses linked and inline JavaScript |
0629bc99 ER |
34 | or CSS in a Django templates into cacheable static files. |
35 | ||
36 | %package -n python3-django-compressor | |
37 | Summary: Compresses linked and inline JavaScript or CSS into single cached files | |
38 | Group: Libraries/Python | |
0629bc99 ER |
39 | |
40 | %description -n python3-django-compressor | |
9e40f158 | 41 | Django Compressor combines and compresses linked and inline JavaScript |
0629bc99 ER |
42 | or CSS in a Django templates into cacheable static files. |
43 | ||
44 | %prep | |
45 | %setup -q -n %{pypi_name}-%{version} | |
46 | ||
47 | %build | |
48 | %if %{with python2} | |
49 | %py_build %{?with_tests:test} | |
50 | %endif | |
51 | ||
52 | %if %{with python3} | |
53 | %py3_build %{?with_tests:test} | |
54 | %endif | |
55 | ||
56 | %install | |
57 | rm -rf $RPM_BUILD_ROOT | |
58 | %if %{with python2} | |
59 | %py_install | |
9c25fb59 ER |
60 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/compressor/tests |
61 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/compressor/test_*.py* | |
0629bc99 ER |
62 | %py_postclean |
63 | %endif | |
64 | ||
65 | %if %{with python3} | |
66 | %py3_install | |
9c25fb59 ER |
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 | |
0629bc99 ER |
70 | %endif |
71 | ||
72 | %clean | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %files | |
76 | %defattr(644,root,root,755) | |
77 | %doc README.rst LICENSE | |
78 | %{py_sitescriptdir}/compressor | |
79 | %{py_sitescriptdir}/%{pypi_name}-%{version}-py*.egg-info | |
80 | ||
81 | %if %{with python3} | |
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 | |
87 | %endif |