1 # note: uses name after egg/pypi; import name is "yaml", source is "pyyaml"
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
6 %bcond_without tests # unit tests
9 Summary: YAML parser and emitter module for Python 2
10 Summary(pl.UTF-8): Analizator i generator formatu YAML dla języka Python 2
11 Name: python-%{module}
15 Group: Libraries/Python
16 #Source0Download: https://github.com/yaml/pyyaml/releases
17 Source0: https://github.com/yaml/pyyaml/archive/%{version}/pyyaml-%{version}.tar.gz
18 # Source0-md5: 93f82c27e9449fb73131834dfd147001
19 URL: https://github.com/yaml/pyyaml
20 BuildRequires: rpm-pythonprov
21 BuildRequires: rpmbuild(macros) >= 1.714
22 BuildRequires: sed >= 4.0
23 BuildRequires: yaml-devel >= 0.2.2
25 BuildRequires: python-Cython
26 BuildRequires: python-devel >= 1:2.7
27 BuildRequires: python-modules >= 1:2.7
30 BuildRequires: python3-Cython
31 BuildRequires: python3-devel >= 1:3.5
32 BuildRequires: python3-modules >= 1:3.5
34 Requires: python-modules >= 1:2.7
35 Requires: yaml >= 0.2.2
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 YAML is a data serialization format designed for human readability and
40 interaction with scripting languages. PyYAML is a YAML parser and
43 PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
44 support, capable extension API, and sensible error messages. PyYAML
45 supports standard YAML tags and provides Python-specific tags that
46 allow to represent an arbitrary Python object.
48 PyYAML is applicable for a broad range of tasks from complex
49 configuration files to object serialization and persistance.
51 %description -l pl.UTF-8
52 YAML jest formatem serializacji danych czytelnym dla człowieka,
53 zaprojektowanym do interakcji w językach skryptowych. PyYAML jest
54 analizatorem i generatorem tego formatu dla języka Python.
56 PyYAML posiada obsługę pełnej analizy YAML 1.1, Unicode, serializację
57 poprzez piklowanie, rozszerzalne API oraz zrozumiałe komunikaty
58 błędów. Obsługuje standardowe znaczniki YAML i dostarcza nowe,
59 specyficzne dla języka Python, pozwalające na reprezentację jego
62 PyYAML może być użyty w szerokiej gamie zastosowań, od złożonych
63 plików konfiguracyjnych po serializację i przechowywanie obiektów.
65 %package -n python3-%{module}
66 Summary: YAML parser and emitter module for Python 3
67 Summary(pl.UTF-8): Analizator i generator formatu YAML dla języka Python 3
68 Group: Libraries/Python
69 Requires: yaml >= 0.2.2
70 Requires: python3-modules >= 1:3.5
72 %description -n python3-%{module}
73 PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
74 support, capable extension API, and sensible error messages. PyYAML
75 supports standard YAML tags and provides Python-specific tags that
76 allow to represent an arbitrary Python object.
78 %description -n python3-%{module} -l pl.UTF-8
79 PyYAML posiada obsługę pełnej analizy YAML 1.1, Unicode, serializację
80 poprzez piklowanie, rozszerzalne API oraz zrozumiałe komunikaty
81 błędów. Obsługuje standardowe znaczniki YAML i dostarcza nowe,
82 specyficzne dla języka Python, pozwalające na reprezentację jego
86 %setup -q -n pyyaml-%{version}
91 CFLAGS="%{rpmcflags}" \
92 %{__python} setup.py --with-libyaml \
93 build --build-base build-2 %{?with_tests:test}
97 CFLAGS="%{rpmcflags}" \
98 %{__python3} setup.py --with-libyaml \
99 build --build-base build-3 %{?with_tests:test}
103 rm -rf $RPM_BUILD_ROOT
110 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
111 cp -p examples/yaml-highlight/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
112 %{__sed} -i -e '1s,/usr/bin/python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/yaml_hl.py
118 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-PyYAML-%{version}
119 cp -p examples/yaml-highlight/* $RPM_BUILD_ROOT%{_examplesdir}/python3-PyYAML-%{version}
120 %{__sed} -i -e '1s,/usr/bin/python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-PyYAML-%{version}/yaml_hl.py
124 rm -rf $RPM_BUILD_ROOT
128 %defattr(644,root,root,755)
129 %doc CHANGES LICENSE README
130 %dir %{py_sitedir}/_yaml
131 %{py_sitedir}/_yaml/*.py[co]
132 %dir %{py_sitedir}/yaml
133 %{py_sitedir}/yaml/*.py[co]
134 %attr(755,root,root) %{py_sitedir}/yaml/_yaml.so
135 %{py_sitedir}/PyYAML-%{version}-py*.egg-info
136 %{_examplesdir}/%{name}-%{version}
140 %files -n python3-%{module}
141 %defattr(644,root,root,755)
142 %doc CHANGES LICENSE README
143 %dir %{py3_sitedir}/_yaml
144 %{py3_sitedir}/_yaml/*.py
145 %{py3_sitedir}/_yaml/__pycache__
146 %dir %{py3_sitedir}/yaml
147 %{py3_sitedir}/yaml/*.py
148 %{py3_sitedir}/yaml/__pycache__
149 %attr(755,root,root) %{py3_sitedir}/yaml/_yaml.cpython-*.so
150 %{py3_sitedir}/PyYAML-%{version}-py*.egg-info
151 %{_examplesdir}/python3-PyYAML-%{version}