]> git.pld-linux.org Git - packages/python-PyYAML.git/blob - python-PyYAML.spec
rebuild with tests and docs
[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.4.1
13 Release:        4
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:  93f82c27e9449fb73131834dfd147001
19 URL:            https://github.com/yaml/pyyaml
20 BuildRequires:  rpm-pythonprov
21 BuildRequires:  rpmbuild(macros) >= 1.714
22 BuildRequires:  sed >= 4.0
23 BuildRequires:  yaml-devel >= 0.2.2
24 %if %{with python2}
25 BuildRequires:  python-Cython
26 BuildRequires:  python-devel >= 1:2.7
27 BuildRequires:  python-modules >= 1:2.7
28 %endif
29 %if %{with python3}
30 BuildRequires:  python3-Cython
31 BuildRequires:  python3-devel >= 1:3.5
32 BuildRequires:  python3-modules >= 1:3.5
33 %endif
34 Requires:       python-modules >= 1:2.7
35 Requires:       yaml >= 0.2.2
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %description
39 YAML is a data serialization format designed for human readability and
40 interaction with scripting languages. PyYAML is a YAML parser and
41 emitter for Python.
42
43 PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
44 support, capable extension API, and sensible error messages. PyYAML
45 supports standard YAML tags and provides Python-specific tags that
46 allow to represent an arbitrary Python object.
47
48 PyYAML is applicable for a broad range of tasks from complex
49 configuration files to object serialization and persistance.
50
51 %description -l pl.UTF-8
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.
55
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.
61
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.
64
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
69 Requires:       yaml >= 0.2.2
70 Requires:       python3-modules >= 1:3.5
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
85 %prep
86 %setup -q -n pyyaml-%{version}
87
88 %build
89 %if %{with python2}
90 CC="%{__cc}" \
91 CFLAGS="%{rpmcflags}" \
92 %{__python} setup.py --with-libyaml \
93         build --build-base build-2 %{?with_tests:test}
94 %endif
95 %if %{with python3}
96 CC="%{__cc}" \
97 CFLAGS="%{rpmcflags}" \
98 %{__python3} setup.py --with-libyaml \
99         build --build-base build-3 %{?with_tests:test}
100 %endif
101
102 %install
103 rm -rf $RPM_BUILD_ROOT
104
105 %if %{with python2}
106 %py_install
107
108 %py_postclean
109
110 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
111 cp -p examples/yaml-highlight/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
112 %{__sed} -i -e '1s,/usr/bin/python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/yaml_hl.py
113 %endif
114
115 %if %{with python3}
116 %py3_install
117
118 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-PyYAML-%{version}
119 cp -p examples/yaml-highlight/* $RPM_BUILD_ROOT%{_examplesdir}/python3-PyYAML-%{version}
120 %{__sed} -i -e '1s,/usr/bin/python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-PyYAML-%{version}/yaml_hl.py
121 %endif
122
123 %clean
124 rm -rf $RPM_BUILD_ROOT
125
126 %if %{with python2}
127 %files
128 %defattr(644,root,root,755)
129 %doc CHANGES LICENSE README
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
135 %{py_sitedir}/PyYAML-%{version}-py*.egg-info
136 %{_examplesdir}/%{name}-%{version}
137 %endif
138
139 %if %{with python3}
140 %files -n python3-%{module}
141 %defattr(644,root,root,755)
142 %doc CHANGES LICENSE README
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
150 %{py3_sitedir}/PyYAML-%{version}-py*.egg-info
151 %{_examplesdir}/python3-PyYAML-%{version}
152 %endif
This page took 0.057941 seconds and 3 git commands to generate.