]> git.pld-linux.org Git - SPECS.git/blob - python-slimit.spec
SPECS updated Sun 1 Aug 20:13:02 CEST 2021
[SPECS.git] / python-slimit.spec
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
9 Release:        4
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
18 BuildRequires:  rpmbuild(macros) >= 1.710
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
41 %py_build
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
50 %py_install
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
65 %dir %{py_sitescriptdir}/%{module}
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
This page took 0.03895 seconds and 3 git commands to generate.