]> git.pld-linux.org Git - packages/python-PyYAML.git/blob - python-PyYAML.spec
1e5280387207e765acd679e4386afc957d33392b
[packages/python-PyYAML.git] / python-PyYAML.spec
1 #
2 # TODO:
3 #       - the name should be python-yaml (used via 'import yaml')
4 #
5
6 %bcond_without  python2 # CPython 2.x module
7 %bcond_without  python3 # CPython 3.x module
8
9 %define         module          PyYAML
10 %define         module_dir      yaml
11 #
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
14 Name:           python-%{module}
15 Version:        3.11
16 Release:        6
17 License:        MIT
18 Group:          Libraries/Python
19 Source0:        http://pyyaml.org/download/pyyaml/%{module}-%{version}.tar.gz
20 # Source0-md5:  f50e08ef0fe55178479d3a618efe21db
21 URL:            http://pyyaml.org/
22 BuildRequires:  yaml-devel
23 %if %{with python2}
24 BuildRequires:  python-devel
25 BuildRequires:  rpm-pythonprov
26 BuildRequires:  rpmbuild(macros) >= 1.710
27 Requires:       python-modules
28 %endif
29 %if %{with python3}
30 BuildRequires:  python3-devel >= 1:3.2
31 BuildRequires:  python3-modules
32 %endif
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 %description
36 YAML is a data serialization format designed for human readability and
37 interaction with scripting languages. PyYAML is a YAML parser and
38 emitter for Python.
39
40 PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
41 support, capable extension API, and sensible error messages. PyYAML
42 supports standard YAML tags and provides Python-specific tags that
43 allow to represent an arbitrary Python object.
44
45 PyYAML is applicable for a broad range of tasks from complex
46 configuration files to object serialization and persistance.
47
48 %description -l pl.UTF-8
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.
52
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.
58
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.
61
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
80 %prep
81 %setup -q -n %{module}-%{version}
82
83 %build
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
94
95 %install
96 rm -rf $RPM_BUILD_ROOT
97 %if %{with python2}
98 %py_install
99 %py_postclean
100 %endif
101 %if %{with python3}
102 %py3_install
103 %endif
104 %py_postclean
105
106 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
107 cp -p examples/yaml-highlight/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
108
109 %clean
110 rm -rf $RPM_BUILD_ROOT
111
112 %if %{with python2}
113 %files
114 %defattr(644,root,root,755)
115 %doc README
116 %dir %{py_sitedir}/%{module_dir}
117 %attr(755,root,root) %{py_sitedir}/_yaml.so
118 %{py_sitedir}/%{module_dir}/*.py[co]
119 %if "%{py_ver}" > "2.4"
120 %{py_sitedir}/PyYAML-%{version}-py*.egg-info
121 %endif
122 %{_examplesdir}/%{name}-%{version}
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
131 %{py3_sitedir}/%{module_dir}/__pycache__
132 %attr(755,root,root) %{py3_sitedir}/_yaml.cpython-*.so
133 %{py3_sitedir}/PyYAML-%{version}-py*.egg-info
134 %endif
This page took 0.0402 seconds and 2 git commands to generate.