3 %bcond_without doc # don't build doc
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
8 %define egg_name rjsmin
9 %define pypi_name rjsmin
10 Summary: rJSmin is a JavaScript minifier written in Python
11 Name: python-%{pypi_name}
15 Group: Libraries/Python
16 Source0: https://pypi.python.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
17 # Source0-md5: 9f67e133c88df5497d3da847603da9bf
18 URL: http://opensource.perlig.de/rjsmin/
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 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 The minifier is based on the semantics of jsmin.c by Douglas
35 The module is a re-implementation aiming for speed, so it can be used
36 at runtime (rather than during a preprocessing step). Usually it
37 produces the same results as the original jsmin.c.
39 %package -n python3-%{pypi_name}
40 Summary: rJSmin is a JavaScript minifier written in Python
41 Group: Libraries/Python
43 %description -n python3-%{pypi_name}
44 The minifier is based on the semantics of jsmin.c by Douglas
47 The module is a re-implementation aiming for speed, so it can be used
48 at runtime (rather than during a preprocessing step). Usually it
49 produces the same results as the original jsmin.c.
52 Summary: Javascript Minifier - docs
60 %setup -q -n %{pypi_name}-%{version}
62 # strip bang path from rjsmin.py
75 rm -rf $RPM_BUILD_ROOT
85 rm -r $RPM_BUILD_ROOT%{_docdir}/%{module}
88 rm -rf $RPM_BUILD_ROOT
92 %defattr(644,root,root,755)
93 %doc README.rst LICENSE
94 %{py_sitedir}/%{module}.py[co]
95 %attr(755,root,root) %{py_sitedir}/_%{module}.so
96 %{py_sitedir}/%{pypi_name}-%{version}-py*.egg-info
100 %files -n python3-%{pypi_name}
101 %defattr(644,root,root,755)
102 %doc README.rst LICENSE
103 %{py3_sitedir}/%{module}.py
104 %{py3_sitedir}/__pycache__/%{module}.*.pyc
105 %attr(755,root,root) %{py3_sitedir}/_%{module}.*.so
106 %{py3_sitedir}/%{egg_name}-%{version}-py*.egg-info
111 %defattr(644,root,root,755)