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: 464430ee31d2bcfb2e746158674c7c5c
19 URL: https://github.com/yaml/pyyaml
20 BuildRequires: rpm-pythonprov
21 BuildRequires: rpmbuild(macros) >= 1.714
22 BuildRequires: yaml-devel >= 0.2.2
24 BuildRequires: python-Cython
25 BuildRequires: python-devel >= 1:2.7
26 BuildRequires: python-modules >= 1:2.7
29 BuildRequires: python3-Cython
30 BuildRequires: python3-devel >= 1:3.4
31 BuildRequires: python3-modules >= 1:3.4
33 Requires: python-modules >= 1:2.7
34 Requires: yaml >= 0.2.2
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 YAML is a data serialization format designed for human readability and
39 interaction with scripting languages. PyYAML is a YAML parser and
42 PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
43 support, capable extension API, and sensible error messages. PyYAML
44 supports standard YAML tags and provides Python-specific tags that
45 allow to represent an arbitrary Python object.
47 PyYAML is applicable for a broad range of tasks from complex
48 configuration files to object serialization and persistance.
50 %description -l pl.UTF-8
51 YAML jest formatem serializacji danych czytelnym dla człowieka,
52 zaprojektowanym do interakcji w językach skryptowych. PyYAML jest
53 analizatorem i generatorem tego formatu dla języka Python.
55 PyYAML posiada obsługę pełnej analizy YAML 1.1, Unicode, serializację
56 poprzez piklowanie, rozszerzalne API oraz zrozumiałe komunikaty
57 błędów. Obsługuje standardowe znaczniki YAML i dostarcza nowe,
58 specyficzne dla języka Python, pozwalające na reprezentację jego
61 PyYAML może być użyty w szerokiej gamie zastosowań, od złożonych
62 plików konfiguracyjnych po serializację i przechowywanie obiektów.
64 %package -n python3-%{module}
65 Summary: YAML parser and emitter module for Python 3
66 Summary(pl.UTF-8): Analizator i generator formatu YAML dla języka Python 3
67 Group: Libraries/Python
68 Requires: yaml >= 0.2.2
69 Requires: python3-modules >= 1:3.4
71 %description -n python3-%{module}
72 PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
73 support, capable extension API, and sensible error messages. PyYAML
74 supports standard YAML tags and provides Python-specific tags that
75 allow to represent an arbitrary Python object.
77 %description -n python3-%{module} -l pl.UTF-8
78 PyYAML posiada obsługę pełnej analizy YAML 1.1, Unicode, serializację
79 poprzez piklowanie, rozszerzalne API oraz zrozumiałe komunikaty
80 błędów. Obsługuje standardowe znaczniki YAML i dostarcza nowe,
81 specyficzne dla języka Python, pozwalające na reprezentację jego
85 %setup -q -n pyyaml-%{version}
90 CFLAGS="%{rpmcflags}" \
91 %{__python} setup.py --with-libyaml \
92 build --build-base build-2 %{?with_tests:test}
96 CFLAGS="%{rpmcflags}" \
97 %{__python3} setup.py --with-libyaml \
98 build --build-base build-3 %{?with_tests:test}
102 rm -rf $RPM_BUILD_ROOT
109 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
110 cp -p examples/yaml-highlight/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
116 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-PyYAML-%{version}
117 cp -p examples/yaml-highlight/* $RPM_BUILD_ROOT%{_examplesdir}/python3-PyYAML-%{version}
121 rm -rf $RPM_BUILD_ROOT
125 %defattr(644,root,root,755)
126 %doc CHANGES LICENSE README
127 %attr(755,root,root) %{py_sitedir}/_yaml.so
129 %{py_sitedir}/PyYAML-%{version}-py*.egg-info
130 %{_examplesdir}/%{name}-%{version}
134 %files -n python3-%{module}
135 %defattr(644,root,root,755)
136 %doc CHANGES LICENSE README
137 %attr(755,root,root) %{py3_sitedir}/_yaml.cpython-*.so
139 %{py3_sitedir}/PyYAML-%{version}-py*.egg-info
140 %{_examplesdir}/python3-PyYAML-%{version}