]>
Commit | Line | Data |
---|---|---|
ffa1218e ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | ||
5 | %define module slimit | |
6 | Summary: JavaScript minifier written in Python | |
7 | Name: python-slimit | |
8 | Version: 0.7.4 | |
cdcfa61b | 9 | Release: 4 |
ffa1218e ER |
10 | License: MIT |
11 | Group: Development/Languages | |
12 | URL: http://slimit.org/ | |
13 | Source0: http://pypi.python.org/packages/source/s/%{module}/%{module}-%{version}.zip | |
14 | # Source0-md5: 35b50859883a1d8dfd61a77c125f517d | |
15 | BuildRequires: python-devel | |
16 | BuildRequires: python-setuptools | |
17 | BuildRequires: rpm-pythonprov | |
6690fd6f | 18 | BuildRequires: rpmbuild(macros) >= 1.710 |
ffa1218e ER |
19 | BuildRequires: unzip |
20 | %if %{with tests} | |
21 | BuildRequires: python-odict | |
22 | BuildRequires: python-ply >= 3.4 | |
23 | %endif | |
24 | Requires: python-odict | |
25 | Requires: python-ply >= 3.4 | |
26 | BuildArch: noarch | |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %description | |
30 | SlimIt is a JavaScript minifier written in Python. It compiles | |
31 | JavaScript into more compact code so that it downloads and runs | |
32 | faster. | |
33 | ||
34 | SlimIt also provides a library that includes a JavaScript parser, | |
35 | lexer, pretty printer and a tree visitor. | |
36 | ||
37 | %prep | |
38 | %setup -q -n %{module}-%{version} | |
39 | ||
40 | %build | |
80c1b51c | 41 | %py_build |
ffa1218e ER |
42 | |
43 | %if %{with tests} | |
44 | %{__python} setup.py test -m slimit.tests.test_lexer | |
45 | %{__python} setup.py test -m slimit.tests.test_nodevisitor | |
46 | %endif | |
47 | ||
48 | %install | |
49 | rm -rf $RPM_BUILD_ROOT | |
80c1b51c | 50 | %py_install |
ffa1218e ER |
51 | |
52 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/slimit/tests | |
53 | ||
54 | %py_postclean | |
55 | ||
56 | chmod a+x $RPM_BUILD_ROOT%{_bindir}/%{module} | |
57 | ||
58 | %clean | |
59 | rm -rf $RPM_BUILD_ROOT | |
60 | ||
61 | %files | |
62 | %defattr(644,root,root,755) | |
63 | %doc CHANGES README.rst | |
64 | %attr(755,root,root) %{_bindir}/slimit | |
342f7883 | 65 | %dir %{py_sitescriptdir}/%{module} |
ffa1218e ER |
66 | %{py_sitescriptdir}/%{module}/*.py[co] |
67 | %dir %{py_sitescriptdir}/%{module}/visitors | |
68 | %{py_sitescriptdir}/%{module}/visitors/*.py[co] | |
69 | %{py_sitescriptdir}/%{module}-%{version}*.egg-info |