]>
Commit | Line | Data |
---|---|---|
e21809f9 | 1 | # note: uses name after egg/pypi; import name is "yaml", source is "pyyaml" |
13e61da0 | 2 | # |
bdf2691e | 3 | # Conditional build: |
e21809f9 JB |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
6 | %bcond_without tests # unit tests | |
2b919d02 | 7 | |
13e61da0 | 8 | %define module PyYAML |
90897fb0 JB |
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 | |
13e61da0 | 11 | Name: python-%{module} |
a93b8668 | 12 | Version: 5.4.1 |
9d1c0d00 | 13 | Release: 4 |
13e61da0 | 14 | License: MIT |
15 | Group: Libraries/Python | |
02d6b645 | 16 | #Source0Download: https://github.com/yaml/pyyaml/releases |
e21809f9 | 17 | Source0: https://github.com/yaml/pyyaml/archive/%{version}/pyyaml-%{version}.tar.gz |
a93b8668 | 18 | # Source0-md5: 93f82c27e9449fb73131834dfd147001 |
79ff602e | 19 | URL: https://github.com/yaml/pyyaml |
bdf2691e JB |
20 | BuildRequires: rpm-pythonprov |
21 | BuildRequires: rpmbuild(macros) >= 1.714 | |
a6da519e | 22 | BuildRequires: sed >= 4.0 |
e21809f9 | 23 | BuildRequires: yaml-devel >= 0.2.2 |
2b919d02 | 24 | %if %{with python2} |
bdf2691e JB |
25 | BuildRequires: python-Cython |
26 | BuildRequires: python-devel >= 1:2.7 | |
27 | BuildRequires: python-modules >= 1:2.7 | |
2b919d02 MK |
28 | %endif |
29 | %if %{with python3} | |
bdf2691e | 30 | BuildRequires: python3-Cython |
f1f4cf28 JB |
31 | BuildRequires: python3-devel >= 1:3.5 |
32 | BuildRequires: python3-modules >= 1:3.5 | |
2b919d02 | 33 | %endif |
bdf2691e | 34 | Requires: python-modules >= 1:2.7 |
e21809f9 | 35 | Requires: yaml >= 0.2.2 |
13e61da0 | 36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
37 | ||
38 | %description | |
39 | YAML is a data serialization format designed for human readability and | |
bd46405f | 40 | interaction with scripting languages. PyYAML is a YAML parser and |
13e61da0 | 41 | emitter for Python. |
42 | ||
43 | PyYAML features a complete YAML 1.1 parser, Unicode support, pickle | |
bd46405f | 44 | support, capable extension API, and sensible error messages. PyYAML |
cae94bd0 JB |
45 | supports standard YAML tags and provides Python-specific tags that |
46 | allow to represent an arbitrary Python object. | |
13e61da0 | 47 | |
cae94bd0 JB |
48 | PyYAML is applicable for a broad range of tasks from complex |
49 | configuration files to object serialization and persistance. | |
13e61da0 | 50 | |
51 | %description -l pl.UTF-8 | |
804a2d56 MB |
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. | |
13e61da0 | 55 | |
d8c168b1 | 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 | |
60 | obiektów. | |
13e61da0 | 61 | |
d8c168b1 | 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. | |
13e61da0 | 64 | |
90897fb0 JB |
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 | |
e21809f9 | 69 | Requires: yaml >= 0.2.2 |
f1f4cf28 | 70 | Requires: python3-modules >= 1:3.5 |
90897fb0 JB |
71 | |
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. | |
77 | ||
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 | |
83 | obiektów. | |
84 | ||
13e61da0 | 85 | %prep |
79ff602e | 86 | %setup -q -n pyyaml-%{version} |
13e61da0 | 87 | |
88 | %build | |
2b919d02 MK |
89 | %if %{with python2} |
90 | CC="%{__cc}" \ | |
91 | CFLAGS="%{rpmcflags}" \ | |
bdf2691e JB |
92 | %{__python} setup.py --with-libyaml \ |
93 | build --build-base build-2 %{?with_tests:test} | |
2b919d02 MK |
94 | %endif |
95 | %if %{with python3} | |
96 | CC="%{__cc}" \ | |
97 | CFLAGS="%{rpmcflags}" \ | |
bdf2691e JB |
98 | %{__python3} setup.py --with-libyaml \ |
99 | build --build-base build-3 %{?with_tests:test} | |
2b919d02 | 100 | %endif |
13e61da0 | 101 | |
102 | %install | |
103 | rm -rf $RPM_BUILD_ROOT | |
02d6b645 | 104 | |
2b919d02 | 105 | %if %{with python2} |
c9228ae5 | 106 | %py_install |
02d6b645 | 107 | |
13e61da0 | 108 | %py_postclean |
02d6b645 JB |
109 | |
110 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
111 | cp -p examples/yaml-highlight/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
a6da519e | 112 | %{__sed} -i -e '1s,/usr/bin/python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/yaml_hl.py |
2b919d02 | 113 | %endif |
02d6b645 | 114 | |
2b919d02 | 115 | %if %{with python3} |
c9228ae5 | 116 | %py3_install |
90897fb0 | 117 | |
02d6b645 JB |
118 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-PyYAML-%{version} |
119 | cp -p examples/yaml-highlight/* $RPM_BUILD_ROOT%{_examplesdir}/python3-PyYAML-%{version} | |
a6da519e | 120 | %{__sed} -i -e '1s,/usr/bin/python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-PyYAML-%{version}/yaml_hl.py |
02d6b645 | 121 | %endif |
13e61da0 | 122 | |
123 | %clean | |
124 | rm -rf $RPM_BUILD_ROOT | |
125 | ||
2b919d02 | 126 | %if %{with python2} |
13e61da0 | 127 | %files |
128 | %defattr(644,root,root,755) | |
bdf2691e | 129 | %doc CHANGES LICENSE README |
a93b8668 JP |
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 | |
90897fb0 | 135 | %{py_sitedir}/PyYAML-%{version}-py*.egg-info |
13e61da0 | 136 | %{_examplesdir}/%{name}-%{version} |
2b919d02 MK |
137 | %endif |
138 | ||
139 | %if %{with python3} | |
140 | %files -n python3-%{module} | |
141 | %defattr(644,root,root,755) | |
bdf2691e | 142 | %doc CHANGES LICENSE README |
a93b8668 JP |
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 | |
90897fb0 | 150 | %{py3_sitedir}/PyYAML-%{version}-py*.egg-info |
02d6b645 | 151 | %{_examplesdir}/python3-PyYAML-%{version} |
2b919d02 | 152 | %endif |