]> git.pld-linux.org Git - packages/python-PyYAML.git/blame - python-PyYAML.spec
rebuild with tests and docs
[packages/python-PyYAML.git] / python-PyYAML.spec
CommitLineData
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
9Summary: YAML parser and emitter module for Python 2
10Summary(pl.UTF-8): Analizator i generator formatu YAML dla języka Python 2
13e61da0 11Name: python-%{module}
a93b8668 12Version: 5.4.1
9d1c0d00 13Release: 4
13e61da0 14License: MIT
15Group: Libraries/Python
02d6b645 16#Source0Download: https://github.com/yaml/pyyaml/releases
e21809f9 17Source0: https://github.com/yaml/pyyaml/archive/%{version}/pyyaml-%{version}.tar.gz
a93b8668 18# Source0-md5: 93f82c27e9449fb73131834dfd147001
79ff602e 19URL: https://github.com/yaml/pyyaml
bdf2691e
JB
20BuildRequires: rpm-pythonprov
21BuildRequires: rpmbuild(macros) >= 1.714
a6da519e 22BuildRequires: sed >= 4.0
e21809f9 23BuildRequires: yaml-devel >= 0.2.2
2b919d02 24%if %{with python2}
bdf2691e
JB
25BuildRequires: python-Cython
26BuildRequires: python-devel >= 1:2.7
27BuildRequires: python-modules >= 1:2.7
2b919d02
MK
28%endif
29%if %{with python3}
bdf2691e 30BuildRequires: python3-Cython
f1f4cf28
JB
31BuildRequires: python3-devel >= 1:3.5
32BuildRequires: python3-modules >= 1:3.5
2b919d02 33%endif
bdf2691e 34Requires: python-modules >= 1:2.7
e21809f9 35Requires: yaml >= 0.2.2
13e61da0 36BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38%description
39YAML is a data serialization format designed for human readability and
bd46405f 40interaction with scripting languages. PyYAML is a YAML parser and
13e61da0 41emitter for Python.
42
43PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
bd46405f 44support, capable extension API, and sensible error messages. PyYAML
cae94bd0
JB
45supports standard YAML tags and provides Python-specific tags that
46allow to represent an arbitrary Python object.
13e61da0 47
cae94bd0
JB
48PyYAML is applicable for a broad range of tasks from complex
49configuration files to object serialization and persistance.
13e61da0 50
51%description -l pl.UTF-8
804a2d56
MB
52YAML jest formatem serializacji danych czytelnym dla człowieka,
53zaprojektowanym do interakcji w językach skryptowych. PyYAML jest
54analizatorem i generatorem tego formatu dla języka Python.
13e61da0 55
d8c168b1 56PyYAML posiada obsługę pełnej analizy YAML 1.1, Unicode, serializację
57poprzez piklowanie, rozszerzalne API oraz zrozumiałe komunikaty
58błędów. Obsługuje standardowe znaczniki YAML i dostarcza nowe,
59specyficzne dla języka Python, pozwalające na reprezentację jego
60obiektów.
13e61da0 61
d8c168b1 62PyYAML może być użyty w szerokiej gamie zastosowań, od złożonych
63plików konfiguracyjnych po serializację i przechowywanie obiektów.
13e61da0 64
90897fb0
JB
65%package -n python3-%{module}
66Summary: YAML parser and emitter module for Python 3
67Summary(pl.UTF-8): Analizator i generator formatu YAML dla języka Python 3
68Group: Libraries/Python
e21809f9 69Requires: yaml >= 0.2.2
f1f4cf28 70Requires: python3-modules >= 1:3.5
90897fb0
JB
71
72%description -n python3-%{module}
73PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
74support, capable extension API, and sensible error messages. PyYAML
75supports standard YAML tags and provides Python-specific tags that
76allow to represent an arbitrary Python object.
77
78%description -n python3-%{module} -l pl.UTF-8
79PyYAML posiada obsługę pełnej analizy YAML 1.1, Unicode, serializację
80poprzez piklowanie, rozszerzalne API oraz zrozumiałe komunikaty
81błędów. Obsługuje standardowe znaczniki YAML i dostarcza nowe,
82specyficzne dla języka Python, pozwalające na reprezentację jego
83obiektów.
84
13e61da0 85%prep
79ff602e 86%setup -q -n pyyaml-%{version}
13e61da0 87
88%build
2b919d02
MK
89%if %{with python2}
90CC="%{__cc}" \
91CFLAGS="%{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}
96CC="%{__cc}" \
97CFLAGS="%{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
103rm -rf $RPM_BUILD_ROOT
02d6b645 104
2b919d02 105%if %{with python2}
c9228ae5 106%py_install
02d6b645 107
13e61da0 108%py_postclean
02d6b645
JB
109
110install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
111cp -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
118install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-PyYAML-%{version}
119cp -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
124rm -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
This page took 0.122826 seconds and 4 git commands to generate.