]> git.pld-linux.org Git - packages/python-PyYAML.git/blob - python-PyYAML.spec
- updated to 5.2
[packages/python-PyYAML.git] / python-PyYAML.spec
1 # note: uses name after egg/pypi; import name is "yaml", source is "pyyaml"
2 #
3 # Conditional build:
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6 %bcond_without  tests   # unit tests
7
8 %define         module          PyYAML
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}
12 Version:        5.2
13 Release:        1
14 License:        MIT
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
23 %if %{with python2}
24 BuildRequires:  python-Cython
25 BuildRequires:  python-devel >= 1:2.7
26 BuildRequires:  python-modules >= 1:2.7
27 %endif
28 %if %{with python3}
29 BuildRequires:  python3-Cython
30 BuildRequires:  python3-devel >= 1:3.4
31 BuildRequires:  python3-modules >= 1:3.4
32 %endif
33 Requires:       python-modules >= 1:2.7
34 Requires:       yaml >= 0.2.2
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %description
38 YAML is a data serialization format designed for human readability and
39 interaction with scripting languages. PyYAML is a YAML parser and
40 emitter for Python.
41
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.
46
47 PyYAML is applicable for a broad range of tasks from complex
48 configuration files to object serialization and persistance.
49
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.
54
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
59 obiektów.
60
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.
63
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
70
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.
76
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
82 obiektów.
83
84 %prep
85 %setup -q -n pyyaml-%{version}
86
87 %build
88 %if %{with python2}
89 CC="%{__cc}" \
90 CFLAGS="%{rpmcflags}" \
91 %{__python} setup.py --with-libyaml \
92         build --build-base build-2 %{?with_tests:test}
93 %endif
94 %if %{with python3}
95 CC="%{__cc}" \
96 CFLAGS="%{rpmcflags}" \
97 %{__python3} setup.py --with-libyaml \
98         build --build-base build-3 %{?with_tests:test}
99 %endif
100
101 %install
102 rm -rf $RPM_BUILD_ROOT
103
104 %if %{with python2}
105 %py_install
106
107 %py_postclean
108
109 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
110 cp -p examples/yaml-highlight/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
111 %endif
112
113 %if %{with python3}
114 %py3_install
115
116 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-PyYAML-%{version}
117 cp -p examples/yaml-highlight/* $RPM_BUILD_ROOT%{_examplesdir}/python3-PyYAML-%{version}
118 %endif
119
120 %clean
121 rm -rf $RPM_BUILD_ROOT
122
123 %if %{with python2}
124 %files
125 %defattr(644,root,root,755)
126 %doc CHANGES LICENSE README
127 %attr(755,root,root) %{py_sitedir}/_yaml.so
128 %{py_sitedir}/yaml
129 %{py_sitedir}/PyYAML-%{version}-py*.egg-info
130 %{_examplesdir}/%{name}-%{version}
131 %endif
132
133 %if %{with python3}
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
138 %{py3_sitedir}/yaml
139 %{py3_sitedir}/PyYAML-%{version}-py*.egg-info
140 %{_examplesdir}/python3-PyYAML-%{version}
141 %endif
This page took 0.184314 seconds and 3 git commands to generate.