]> git.pld-linux.org Git - packages/python-django-compressor.git/blob - python-django-compressor.spec
042fbbaeb526bcc3366c3d5e166544df1e198e32
[packages/python-django-compressor.git] / python-django-compressor.spec
1 #
2 # Conditional build:
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
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}
12 Version:        2.1.1
13 Release:        6
14 License:        MIT
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
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
29 BuildArch:      noarch
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %description
33 Django Compressor combines and compresses linked and inline JavaScript
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
39
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.
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
60 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/compressor/tests
61 %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/compressor/test_*.py*
62 %py_postclean
63 %endif
64
65 %if %{with python3}
66 %py3_install
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
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
This page took 0.052467 seconds and 2 git commands to generate.