]> git.pld-linux.org Git - packages/python-lesscpy.git/blob - python-lesscpy.spec
rebuild with python 3.10
[packages/python-lesscpy.git] / python-lesscpy.spec
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
11 Release:        9
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 # source required for ply to work
116 %py_postclean -x 'parser\.py'
117
118 %{__mv} $RPM_BUILD_ROOT%{_bindir}/lesscpy{,-2}
119 ln -sf lesscpy-2 $RPM_BUILD_ROOT%{_bindir}/lesscpy
120 %endif
121
122 %clean
123 rm -rf $RPM_BUILD_ROOT
124
125 %if %{with python2}
126 %files
127 %defattr(644,root,root,755)
128 %doc LICENSE README.rst
129 %attr(755,root,root) %{_bindir}/lesscpy
130 %attr(755,root,root) %{_bindir}/lesscpy-2
131 %{py_sitescriptdir}/lesscpy
132 %{py_sitescriptdir}/lesscpy-%{version}-py*.egg-info
133 %endif
134
135 %if %{with python3}
136 %files -n python3-lesscpy
137 %defattr(644,root,root,755)
138 %doc LICENSE README.rst
139 %attr(755,root,root) %{_bindir}/lesscpy-3
140 %{py3_sitescriptdir}/lesscpy
141 %{py3_sitescriptdir}/lesscpy-%{version}-py*.egg-info
142 %endif
This page took 0.071932 seconds and 3 git commands to generate.