]>
Commit | Line | Data |
---|---|---|
13e61da0 | 1 | # |
fbdd132f JK |
2 | # TODO: |
3 | # - the name should be python-yaml (used via 'import yaml') | |
4 | # | |
2b919d02 MK |
5 | |
6 | %bcond_without python2 # CPython 2.x module | |
7 | %bcond_without python3 # CPython 3.x module | |
8 | ||
13e61da0 | 9 | %define module PyYAML |
10 | %define module_dir yaml | |
11 | # | |
90897fb0 JB |
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 | |
13e61da0 | 14 | Name: python-%{module} |
2b919d02 | 15 | Version: 3.11 |
fc605b92 | 16 | Release: 7 |
13e61da0 | 17 | License: MIT |
18 | Group: Libraries/Python | |
19 | Source0: http://pyyaml.org/download/pyyaml/%{module}-%{version}.tar.gz | |
2b919d02 | 20 | # Source0-md5: f50e08ef0fe55178479d3a618efe21db |
13e61da0 | 21 | URL: http://pyyaml.org/ |
2b919d02 MK |
22 | BuildRequires: yaml-devel |
23 | %if %{with python2} | |
51c8cbd4 | 24 | BuildRequires: python-devel |
25 | BuildRequires: rpm-pythonprov | |
d665513c | 26 | BuildRequires: rpmbuild(macros) >= 1.710 |
2b919d02 MK |
27 | Requires: python-modules |
28 | %endif | |
29 | %if %{with python3} | |
90897fb0 | 30 | BuildRequires: python3-devel >= 1:3.2 |
2b919d02 MK |
31 | BuildRequires: python3-modules |
32 | %endif | |
13e61da0 | 33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
34 | ||
35 | %description | |
36 | YAML is a data serialization format designed for human readability and | |
bd46405f | 37 | interaction with scripting languages. PyYAML is a YAML parser and |
13e61da0 | 38 | emitter for Python. |
39 | ||
40 | PyYAML features a complete YAML 1.1 parser, Unicode support, pickle | |
bd46405f | 41 | support, capable extension API, and sensible error messages. PyYAML |
cae94bd0 JB |
42 | supports standard YAML tags and provides Python-specific tags that |
43 | allow to represent an arbitrary Python object. | |
13e61da0 | 44 | |
cae94bd0 JB |
45 | PyYAML is applicable for a broad range of tasks from complex |
46 | configuration files to object serialization and persistance. | |
13e61da0 | 47 | |
48 | %description -l pl.UTF-8 | |
804a2d56 MB |
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. | |
13e61da0 | 52 | |
d8c168b1 | 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 | |
57 | obiektów. | |
13e61da0 | 58 | |
d8c168b1 | 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. | |
13e61da0 | 61 | |
90897fb0 JB |
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 | |
66 | ||
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. | |
72 | ||
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 | |
78 | obiektów. | |
79 | ||
13e61da0 | 80 | %prep |
81 | %setup -q -n %{module}-%{version} | |
82 | ||
83 | %build | |
2b919d02 MK |
84 | %if %{with python2} |
85 | CC="%{__cc}" \ | |
86 | CFLAGS="%{rpmcflags}" \ | |
87 | %{__python} setup.py --with-libyaml build --build-base build-2 %{?with_tests:test} | |
88 | %endif | |
89 | %if %{with python3} | |
90 | CC="%{__cc}" \ | |
91 | CFLAGS="%{rpmcflags}" \ | |
92 | %{__python3} setup.py --with-libyaml build --build-base build-3 %{?with_tests:test} | |
93 | %endif | |
13e61da0 | 94 | |
95 | %install | |
96 | rm -rf $RPM_BUILD_ROOT | |
2b919d02 | 97 | %if %{with python2} |
c9228ae5 | 98 | %py_install |
13e61da0 | 99 | %py_postclean |
2b919d02 MK |
100 | %endif |
101 | %if %{with python3} | |
c9228ae5 | 102 | %py3_install |
2b919d02 MK |
103 | %endif |
104 | %py_postclean | |
90897fb0 | 105 | |
2b919d02 MK |
106 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
107 | cp -p examples/yaml-highlight/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
13e61da0 | 108 | |
109 | %clean | |
110 | rm -rf $RPM_BUILD_ROOT | |
111 | ||
2b919d02 | 112 | %if %{with python2} |
13e61da0 | 113 | %files |
114 | %defattr(644,root,root,755) | |
115 | %doc README | |
bd46405f | 116 | %dir %{py_sitedir}/%{module_dir} |
334d8e32 | 117 | %attr(755,root,root) %{py_sitedir}/_yaml.so |
bd46405f | 118 | %{py_sitedir}/%{module_dir}/*.py[co] |
51c8cbd4 | 119 | %if "%{py_ver}" > "2.4" |
90897fb0 | 120 | %{py_sitedir}/PyYAML-%{version}-py*.egg-info |
51c8cbd4 | 121 | %endif |
13e61da0 | 122 | %{_examplesdir}/%{name}-%{version} |
2b919d02 MK |
123 | %endif |
124 | ||
125 | %if %{with python3} | |
126 | %files -n python3-%{module} | |
127 | %defattr(644,root,root,755) | |
128 | %doc README | |
129 | %dir %{py3_sitedir}/%{module_dir} | |
130 | %{py3_sitedir}/%{module_dir}/*.py | |
90897fb0 | 131 | %{py3_sitedir}/%{module_dir}/__pycache__ |
3d56cc9a | 132 | %attr(755,root,root) %{py3_sitedir}/_yaml.cpython-*.so |
90897fb0 | 133 | %{py3_sitedir}/PyYAML-%{version}-py*.egg-info |
2b919d02 | 134 | %endif |