3 # - the name should be python-yaml (used via 'import yaml')
6 %bcond_without python2 # CPython 2.x module
7 %bcond_without python3 # CPython 3.x module
10 %define module_dir yaml
12 Summary: YAML parser and emitter module for Python 2
13 Summary(pl.UTF-8): Analizator i generator formatu YAML dla języka Python 2
14 Name: python-%{module}
18 Group: Libraries/Python
19 Source0: http://pyyaml.org/download/pyyaml/%{module}-%{version}.tar.gz
20 # Source0-md5: f50e08ef0fe55178479d3a618efe21db
21 URL: http://pyyaml.org/
22 BuildRequires: yaml-devel
24 BuildRequires: python-devel
25 BuildRequires: rpm-pythonprov
26 BuildRequires: rpmbuild(macros) >= 1.710
27 Requires: python-modules
30 BuildRequires: python3-devel >= 1:3.2
31 BuildRequires: python3-modules
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 YAML is a data serialization format designed for human readability and
37 interaction with scripting languages. PyYAML is a YAML parser and
40 PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
41 support, capable extension API, and sensible error messages. PyYAML
42 supports standard YAML tags and provides Python-specific tags that
43 allow to represent an arbitrary Python object.
45 PyYAML is applicable for a broad range of tasks from complex
46 configuration files to object serialization and persistance.
48 %description -l pl.UTF-8
49 YAML jest formatem serializacji danych czytelnym dla człowieka,
50 zaprojektowanym do interakcji w językach skryptowych. PyYAML jest
51 analizatorem i generatorem tego formatu dla języka Python.
53 PyYAML posiada obsługę pełnej analizy YAML 1.1, Unicode, serializację
54 poprzez piklowanie, rozszerzalne API oraz zrozumiałe komunikaty
55 błędów. Obsługuje standardowe znaczniki YAML i dostarcza nowe,
56 specyficzne dla języka Python, pozwalające na reprezentację jego
59 PyYAML może być użyty w szerokiej gamie zastosowań, od złożonych
60 plików konfiguracyjnych po serializację i przechowywanie obiektów.
62 %package -n python3-%{module}
63 Summary: YAML parser and emitter module for Python 3
64 Summary(pl.UTF-8): Analizator i generator formatu YAML dla języka Python 3
65 Group: Libraries/Python
67 %description -n python3-%{module}
68 PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
69 support, capable extension API, and sensible error messages. PyYAML
70 supports standard YAML tags and provides Python-specific tags that
71 allow to represent an arbitrary Python object.
73 %description -n python3-%{module} -l pl.UTF-8
74 PyYAML posiada obsługę pełnej analizy YAML 1.1, Unicode, serializację
75 poprzez piklowanie, rozszerzalne API oraz zrozumiałe komunikaty
76 błędów. Obsługuje standardowe znaczniki YAML i dostarcza nowe,
77 specyficzne dla języka Python, pozwalające na reprezentację jego
81 %setup -q -n %{module}-%{version}
86 CFLAGS="%{rpmcflags}" \
87 %{__python} setup.py --with-libyaml build --build-base build-2 %{?with_tests:test}
91 CFLAGS="%{rpmcflags}" \
92 %{__python3} setup.py --with-libyaml build --build-base build-3 %{?with_tests:test}
96 rm -rf $RPM_BUILD_ROOT
106 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
107 cp -p examples/yaml-highlight/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
110 rm -rf $RPM_BUILD_ROOT
114 %defattr(644,root,root,755)
116 %dir %{py_sitedir}/%{module_dir}
117 %attr(755,root,root) %{py_sitedir}/_yaml.so
118 %{py_sitedir}/%{module_dir}/*.py[co]
119 %if "%{py_ver}" > "2.4"
120 %{py_sitedir}/PyYAML-%{version}-py*.egg-info
122 %{_examplesdir}/%{name}-%{version}
126 %files -n python3-%{module}
127 %defattr(644,root,root,755)
129 %dir %{py3_sitedir}/%{module_dir}
130 %{py3_sitedir}/%{module_dir}/*.py
131 %{py3_sitedir}/%{module_dir}/__pycache__
132 %attr(755,root,root) %{py3_sitedir}/_yaml.cpython-*.so
133 %{py3_sitedir}/PyYAML-%{version}-py*.egg-info