]> git.pld-linux.org Git - packages/python-pyparsing.git/blob - python-pyparsing.spec
- added python3 package
[packages/python-pyparsing.git] / python-pyparsing.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5
6 %define         module  pyparsing
7 Summary:        pyparsing - a Python module for creating executing simple grammars
8 Summary(pl.UTF-8):      pyparsing - moduł Pythona umożliwiający tworzenie i parsowanie prostych gramatyk
9 Name:           python-%{module}
10 Version:        2.0.1
11 Release:        2
12 License:        MIT
13 Group:          Libraries/Python
14 Source0:        http://downloads.sourceforge.net/pyparsing/%{module}-%{version}.tar.gz
15 # Source0-md5:  37adec94104b98591507218bc82e7c31
16 URL:            http://pyparsing.sourceforge.net/
17 %if %{with python2}
18 BuildRequires:  python-devel >= 1:2.5
19 BuildRequires:  python-modules
20 %endif
21 %if %{with python3}
22 BuildRequires:  python3-devel
23 BuildRequires:  python3-distribute
24 BuildRequires:  python3-modules
25 %endif
26 BuildRequires:  rpm-pythonprov
27 %pyrequires_eq  python-libs
28 BuildArch:      noarch
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %description
32 The parsing module is an alternative approach to creating and
33 executing simple grammars, vs. the traditional lex/yacc approach, or
34 the use of regular expressions. The parsing module provides a library
35 of classes that client code uses to construct the grammar directly in
36 Python code.
37
38 %description -l pl.UTF-8
39 Moduł pyparsing umożliwia tworzenie i parsowanie prostych gramatyk w
40 sposób odmienny od podejścia tradycyjnego, jakim jest zwykle użycie
41 pary lex/yacc lub wyrażeń regularnych. Moduł ten udostępnia bibliotekę
42 klas, przy pomocy których gramatyka tworzona jest wprost w kodzie
43 Pythona.
44
45 %package -n python3-%{module}
46 Summary:        pyparsing - a Python3 module for creating executing simple grammars
47 Summary(pl.UTF-8):      pyparsing - moduł Pythona3 umożliwiający tworzenie i parsowanie prostych gramatyk
48 Group:          Libraries/Python
49
50 %description -n python3-%{module}
51 The parsing module is an alternative approach to creating and
52 executing simple grammars, vs. the traditional lex/yacc approach, or
53 the use of regular expressions. The parsing module provides a library
54 of classes that client code uses to construct the grammar directly in
55 Python code.
56
57 %description -n python3-%{module} -l pl.UTF-8
58 Moduł pyparsing umożliwia tworzenie i parsowanie prostych gramatyk w
59 sposób odmienny od podejścia tradycyjnego, jakim jest zwykle użycie
60 pary lex/yacc lub wyrażeń regularnych. Moduł ten udostępnia bibliotekę
61 klas, przy pomocy których gramatyka tworzona jest wprost w kodzie
62 Pythona.
63
64 %package doc
65 Summary:        Documentation for pyparsing module
66 Summary(pl.UTF-8):      Dokumentacja do modułu pyparsing
67 Group:          Libraries/Python
68 Requires:       %{name} = %{version}-%{release}
69
70 %description doc
71 This package contains documentation files for pyparsing Python module.
72
73 %description doc -l pl.UTF-8
74 Pakiet zawierający dokumentację dla modułu Pythona pyparsing.
75
76 %package examples
77 Summary:        Examples for pyparsing module
78 Summary(pl.UTF-8):      Przykłady do modułu pyparsing
79 Group:          Libraries/Python
80 Requires:       %{name} = %{version}-%{release}
81
82 %description examples
83 This package contains example files for pyparsing Python module.
84
85 %description examples -l pl.UTF-8
86 Pakiet zawierający przykładowe skrypty dla modułu Pythona pyparsing.
87
88 %prep
89 %setup -q -n %{module}-%{version}
90
91 %build
92 rm -rf build-2 build-3
93 install -d build-2 build-3
94 %if %{with python2}
95 cp -a [^b]* build-2
96 cd build-2
97 %{__python} setup.py build_ext
98 cd ..
99 %endif
100
101 %if %{with python3}
102 cp -a [^b]* build-3
103 cd build-3
104 %{__python3} setup.py build_ext
105 cd ..
106 %endif
107
108 %install
109 rm -rf $RPM_BUILD_ROOT
110 install -d $RPM_BUILD_ROOT{%{py_sitescriptdir},%{_examplesdir}/%{name}-%{version}}
111
112 %if %{with python2}
113 cd build-2
114 %{__python} setup.py \
115         install \
116         --optimize=2 \
117         --root=$RPM_BUILD_ROOT
118
119 %py_postclean
120 cd ..
121 %endif
122
123 %if %{with python3}
124 cd build-3
125 %{__python3} setup.py \
126         install \
127         --optimize=2 \
128         --root=$RPM_BUILD_ROOT
129 cd ..
130 %endif
131
132 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
133
134 %clean
135 rm -rf $RPM_BUILD_ROOT
136
137 %if %{with python2}
138 %files
139 %defattr(644,root,root,755)
140 %doc CHANGES README
141 %{py_sitescriptdir}/pyparsing.py[co]
142 %{py_sitescriptdir}/pyparsing-*.egg-info
143 %endif
144
145 %if %{with python3}
146 %files -n python3-%{module}
147 %defattr(644,root,root,755)
148 %doc CHANGES README
149 %{py3_sitescriptdir}/pyparsing.py
150 %{py3_sitescriptdir}/__pycache__/pyparsing*.py[co]
151 %{py3_sitescriptdir}/pyparsing-*.egg-info
152 %endif
153
154 %files doc
155 %defattr(644,root,root,755)
156 %doc HowToUsePyparsing.html htmldoc pyparsingClassDiagram.{JPG,PNG}
157
158 %files examples
159 %defattr(644,root,root,755)
160 %{_examplesdir}/%{name}-%{version}
This page took 0.603446 seconds and 3 git commands to generate.