Version 3.11
[packages/centos7/PyYAML.git] / PyYAML.spec
1 # %if 0%{?fedora} > 12
2 %global with_python3 1
3 # %else
4 # %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
5 # %endif
6
7 Name:           PyYAML
8 Version:        3.11
9 Release:        9%{?dist}~mos8.0.1
10 Summary:        YAML parser and emitter for Python
11
12 Group:          Development/Libraries
13 License:        MIT
14 URL:            http://pyyaml.org/
15 Source0:        http://pyyaml.org/download/pyyaml/%{name}-%{version}.tar.gz
16 BuildRequires:  python-devel, python-setuptools, libyaml-devel
17 BuildRequires:  Cython
18 BuildRequires:  libyaml-devel
19 Provides:       python-yaml = %{version}-%{release}
20 Provides:       python-yaml%{?_isa} = %{version}-%{release}
21 Provides:       python2-yaml = %{version}-%{release}
22 Provides:       python2-yaml%{?_isa} = %{version}-%{release}
23 %if 0%{?with_python3}
24 BuildRequires: python3-devel
25 BuildRequires: python3-setuptools
26 BuildRequires: python3-Cython
27 %endif
28 # debian patch, upstream ticket http://pyyaml.org/ticket/247 and
29 # https://bitbucket.org/xi/pyyaml/issue/35/test-fails-on-be-s390-x-ppc64
30 Patch0: debian-big-endian-fix.patch
31
32 # CVE-2014-9130 assert failure when processing wrapped strings
33 # https://bugzilla.redhat.com/show_bug.cgi?id=1204829
34 Patch1: PyYAML-CVE-2014-9130.patch
35
36 %description
37 YAML is a data serialization format designed for human readability and
38 interaction with scripting languages.  PyYAML is a YAML parser and
39 emitter for Python.
40
41 PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
42 support, capable extension API, and sensible error messages.  PyYAML
43 supports standard YAML tags and provides Python-specific tags that
44 allow to represent an arbitrary Python object.
45
46 PyYAML is applicable for a broad range of tasks from complex
47 configuration files to object serialization and persistance.
48
49 %if 0%{?with_python3}
50 %package -n python3-PyYAML
51 Summary: YAML parser and emitter for Python
52 Group: Development/Libraries
53
54 %description -n python3-PyYAML
55 YAML is a data serialization format designed for human readability and
56 interaction with scripting languages.  PyYAML is a YAML parser and
57 emitter for Python.
58
59 PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
60 support, capable extension API, and sensible error messages.  PyYAML
61 supports standard YAML tags and provides Python-specific tags that
62 allow to represent an arbitrary Python object.
63
64 PyYAML is applicable for a broad range of tasks from complex
65 configuration files to object serialization and persistance.
66 %endif
67
68
69 %prep
70 %setup -q -n %{name}-%{version}
71 %patch0 -p1 -b .be
72 chmod a-x examples/yaml-highlight/yaml_hl.py
73
74 %patch1 -p1
75
76 # remove pre-generated file
77 rm -rf ext/_yaml.c
78
79
80 %build
81 # regenerate ext/_yaml.c
82 CFLAGS="${RPM_OPT_FLAGS}" %{__python} setup.py --with-libyaml build_ext
83
84 %if 0%{?with_python3}
85 rm -rf %{py3dir}
86 # ext/_yaml.c is needed
87 cp -a . %{py3dir}
88 pushd %{py3dir}
89 CFLAGS="${RPM_OPT_FLAGS}" %{__python3} setup.py --with-libyaml build
90 popd
91 %endif
92
93 CFLAGS="${RPM_OPT_FLAGS}" %{__python} setup.py --with-libyaml build
94
95
96 %install
97 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
98
99 %if 0%{?with_python3}
100 pushd %{py3dir}
101 %{__python3} setup.py install -O1 --skip-build --root %{buildroot}
102 popd
103 %endif
104
105
106 %check
107 %{__python} setup.py test
108
109 %if 0%{?with_python3}
110 pushd %{py3dir}
111 %{__python3} setup.py test
112 popd
113 %endif
114
115
116 %files
117 %{!?_licensedir:%global license %%doc}
118 %license LICENSE
119 %doc CHANGES PKG-INFO README examples
120 %{python_sitearch}/*
121
122 %if 0%{?with_python3}
123 %files -n python3-PyYAML
124 %{!?_licensedir:%global license %%doc}
125 %license LICENSE
126 %doc CHANGES PKG-INFO README examples
127 %{python3_sitearch}/*
128 %endif
129
130
131 %changelog
132 * Thu Sep 24 2015 Alexander Tsamutali <atsamutali@mirantis.com> - 3.11-9%{?dist}~mos8.0.1
133 - Rebuild for MOS 8.0.
134
135 * Fri Jul 17 2015 John Eckersberg <eck@redhat.com> - 3.11-9
136 - Add provides for python2-yaml (RHBZ#1241678)
137
138 * Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.11-8
139 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
140
141 * Mon Mar 23 2015 John Eckersberg <eck@redhat.com> - 3.11-7
142 - Add patch for CVE-2014-9130 (bug 1204829)
143
144 * Mon Sep 15 2014 Jakub Čajka <jcajka@redhat.com> - 3.11-6
145 - fixed typecast issues using debian patch(int->size_t)(BZ#1140189)
146 - spec file cleanup
147
148 * Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.11-5
149 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
150
151 * Mon Aug  4 2014 Tom Callaway <spot@fedoraproject.org> - 3.11-4
152 - fix license handling
153
154 * Fri Jun 06 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.11-3
155 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
156
157 * Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 3.11-2
158 - Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
159
160 * Mon Apr 21 2014 John Eckersberg <jeckersb@redhat.com> - 3.11-1
161 - New upstream release 3.11 (BZ#1081521)
162
163 * Thu Aug  8 2013 John Eckersberg <jeckersb@redhat.com> - 3.10-9
164 - Add check section and run test suite
165
166 * Fri Aug 02 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10-8
167 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
168
169 * Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10-7
170 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
171
172 * Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 3.10-6
173 - rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
174
175 * Wed Aug  1 2012 David Malcolm <dmalcolm@redhat.com> - 3.10-5
176 - remove rhel logic from with_python3 conditional
177
178 * Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10-4
179 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
180
181 * Fri Apr 27 2012 John Eckersberg <jeckersb@redhat.com> - 3.10-3
182 - Add Provides for python-yaml (BZ#740390)
183
184 * Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10-2
185 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
186
187 * Thu Jun 23 2011 John Eckersberg <jeckersb@redhat.com> - 3.10-1
188 - New upstream release 3.10
189
190 * Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.09-8
191 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
192
193 * Wed Feb  2 2011 John Eckersberg <jeckersb@redhat.com> - 3.09-7
194 - Add support to build for python 3
195
196 * Tue Jul 27 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 3.09-6
197 - Bump release number for upgrade path
198
199 * Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 3.09-3
200 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
201
202 * Fri Oct 02 2009 John Eckersberg <jeckersb@redhat.com> - 3.09-1
203 - New upstream release 3.09
204
205 * Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.08-6
206 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
207
208 * Wed Jul 22 2009 - John Eckersberg <jeckersb@redhat.com> - 3.08-5
209 - Minor tweaks to spec file aligning with latest Fedora packaging guidelines
210 - Enforce inclusion of libyaml in build with --with-libyaml option to setup.py
211 - Deliver to %%{python_sitearch} instead of %%{python_sitelib} due to _yaml.so
212 - Thanks to Gareth Armstrong <gareth.armstrong@hp.com>
213
214 * Tue Mar 3 2009 John Eckersberg <jeckersb@redhat.com> - 3.08-4
215 - Correction, change libyaml to libyaml-devel in BuildRequires
216
217 * Mon Mar 2 2009 John Eckersberg <jeckersb@redhat.com> - 3.08-3
218 - Add libyaml to BuildRequires
219
220 * Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.08-2
221 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
222
223 * Wed Feb 18 2009 John Eckersberg <jeckersb@redhat.com> - 3.08-1
224 - New upstream release
225
226 * Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 3.06-2
227 - Rebuild for Python 2.6
228
229 * Fri Oct 24 2008 John Eckersberg <jeckersb@redhat.com> - 3.06-1
230 - New upstream release
231
232 * Wed Jan 02 2008 John Eckersberg <jeckersb@redhat.com> - 3.05-2
233 - Remove explicit dependency on python >= 2.3
234 - Remove executable on example script in docs
235
236 * Mon Dec 17 2007 John Eckersberg <jeckersb@redhat.com> - 3.05-1
237 - Initial packaging for Fedora