]>
Commit | Line | Data |
---|---|---|
4edceab9 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: Python LESS Compiler | |
8 | Summary(pl.UTF-8): Kompilator języka LESS w Pythonie | |
9 | Name: python-lesscpy | |
10 | Version: 0.12.0 | |
cb1eee43 | 11 | Release: 2 |
4edceab9 JB |
12 | License: MIT |
13 | Group: Libraries/Python | |
14 | #Source0Download: https://pypi.python.org/simple/lesscpy | |
15 | Source0: https://files.pythonhosted.org/packages/source/l/lesscpy/lesscpy-%{version}.tar.gz | |
16 | # Source0-md5: 0a5a3ca4091ad3fb62ac6f705f8463d4 | |
17 | Patch0: %{name}-tests.patch | |
18 | URL: https://pypi.python.org/pypi/lesscpy | |
19 | BuildRequires: rpm-pythonprov | |
20 | BuildRequires: rpmbuild(macros) >= 1.714 | |
21 | %if %{with python2} | |
22 | BuildRequires: python-modules >= 1:2.6 | |
23 | BuildRequires: python-setuptools | |
24 | %if %{with tests} | |
25 | BuildRequires: python-coverage | |
26 | BuildRequires: python-flake8 | |
27 | BuildRequires: python-nose | |
28 | BuildRequires: python-ply | |
29 | BuildRequires: python-six | |
30 | %endif | |
31 | %endif | |
32 | %if %{with python3} | |
33 | BuildRequires: python3-modules >= 1:3.3 | |
34 | BuildRequires: python3-setuptools | |
35 | %if %{with tests} | |
36 | BuildRequires: python3-coverage | |
37 | BuildRequires: python3-flake8 | |
38 | BuildRequires: python3-nose | |
39 | BuildRequires: python3-six | |
40 | %endif | |
41 | %endif | |
42 | Requires: python-modules >= 1:2.6 | |
43 | BuildArch: noarch | |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
45 | ||
46 | %description | |
47 | A compiler written in Python for the LESS language. For those of us | |
48 | not willing or able to have node.js installed in our environment. Not | |
49 | all features of LESS are supported (yet). Some features wil probably | |
50 | never be supported (JavaScript evaluation). This program uses PLY | |
51 | (Python Lex-Yacc) to tokenize / parse the input and is considerably | |
52 | slower than the NodeJS compiler. The plan is to utilize this to build | |
53 | in proper syntax checking and perhaps YUI compressing. | |
54 | ||
55 | %description -l pl.UTF-8 | |
56 | Napisany w Pythonie kompilator języka LESS, przeznaczony głównie dla | |
57 | tych, którzy nie chcą lub nie mogą mieć zainstalowanego środowiska | |
58 | node.js. (Jeszcze) nie wszystkie możliwości języka LESS są | |
59 | obsługiwane; niektóre pewnie nigdy nie będą (wykonywania JavaScriptu). | |
60 | Ten kod do analizy wejścia wykorzystuje moduł PLY (Python Lex-Yacc) i | |
61 | jest znacząco wolniejszy od kompilatora NodeJS. Jest plan | |
62 | wykorzystania takiego rozwiązania do stworzenia sprawdzania właściwej | |
63 | składni i może kompresji YUI. | |
64 | ||
65 | %package -n python3-lesscpy | |
66 | Summary: Python LESS Compiler | |
67 | Summary(pl.UTF-8): Kompilator języka LESS w Pythonie | |
68 | Group: Libraries/Python | |
69 | Requires: python3-modules >= 1:3.3 | |
70 | ||
71 | %description -n python3-lesscpy | |
72 | A compiler written in Python for the LESS language. For those of us | |
73 | not willing or able to have node.js installed in our environment. Not | |
74 | all features of LESS are supported (yet). Some features wil probably | |
75 | never be supported (JavaScript evaluation). This program uses PLY | |
76 | (Python Lex-Yacc) to tokenize / parse the input and is considerably | |
77 | slower than the NodeJS compiler. The plan is to utilize this to build | |
78 | in proper syntax checking and perhaps YUI compressing. | |
79 | ||
80 | %description -n python3-lesscpy -l pl.UTF-8 | |
81 | Napisany w Pythonie kompilator języka LESS, przeznaczony głównie dla | |
82 | tych, którzy nie chcą lub nie mogą mieć zainstalowanego środowiska | |
83 | node.js. (Jeszcze) nie wszystkie możliwości języka LESS są | |
84 | obsługiwane; niektóre pewnie nigdy nie będą (wykonywania JavaScriptu). | |
85 | Ten kod do analizy wejścia wykorzystuje moduł PLY (Python Lex-Yacc) i | |
86 | jest znacząco wolniejszy od kompilatora NodeJS. Jest plan | |
87 | wykorzystania takiego rozwiązania do stworzenia sprawdzania właściwej | |
88 | składni i może kompresji YUI. | |
89 | ||
90 | %prep | |
91 | %setup -q -n lesscpy-%{version} | |
92 | %patch0 -p1 | |
93 | ||
94 | %build | |
95 | %if %{with python2} | |
96 | %py_build %{?with_tests:test} | |
97 | %endif | |
98 | ||
99 | %if %{with python3} | |
100 | LC_ALL=en_US.UTF-8 \ | |
101 | %py3_build %{?with_tests:test} | |
102 | %endif | |
103 | ||
104 | %install | |
105 | rm -rf $RPM_BUILD_ROOT | |
106 | ||
107 | %if %{with python3} | |
108 | %py3_install | |
109 | ||
110 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/lesscpy{,-3} | |
111 | %endif | |
112 | ||
113 | %if %{with python2} | |
114 | %py_install | |
115 | %py_postclean | |
116 | ||
117 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/lesscpy{,-2} | |
cb1eee43 | 118 | ln -sf lesscpy-2 $RPM_BUILD_ROOT%{_bindir}/lesscpy |
4edceab9 JB |
119 | %endif |
120 | ||
121 | %clean | |
122 | rm -rf $RPM_BUILD_ROOT | |
123 | ||
124 | %if %{with python2} | |
125 | %files | |
126 | %defattr(644,root,root,755) | |
127 | %doc LICENSE README.rst | |
128 | %attr(755,root,root) %{_bindir}/lesscpy | |
129 | %attr(755,root,root) %{_bindir}/lesscpy-2 | |
130 | %{py_sitescriptdir}/lesscpy | |
131 | %{py_sitescriptdir}/lesscpy-%{version}-py*.egg-info | |
132 | %endif | |
133 | ||
134 | %if %{with python3} | |
135 | %files -n python3-lesscpy | |
136 | %defattr(644,root,root,755) | |
137 | %doc LICENSE README.rst | |
138 | %attr(755,root,root) %{_bindir}/lesscpy-3 | |
139 | %{py3_sitescriptdir}/lesscpy | |
140 | %{py3_sitescriptdir}/lesscpy-%{version}-py*.egg-info | |
141 | %endif |