140cf4
%if 0%{?fedora} > 12
140cf4
%global with_python3 1
140cf4
%else
140cf4
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
140cf4
%endif
140cf4
140cf4
Name:           PyYAML
140cf4
Version:        3.10
140cf4
Release:        11%{?dist}
140cf4
Summary:        YAML parser and emitter for Python
140cf4
140cf4
Group:          Development/Libraries
140cf4
License:        MIT
140cf4
URL:            http://pyyaml.org/
140cf4
Source0:        http://pyyaml.org/download/pyyaml/%{name}-%{version}.tar.gz
140cf4
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
140cf4
BuildRequires:  python-devel, python-setuptools, libyaml-devel, Cython
140cf4
Provides:       python-yaml = %{version}-%{release}
140cf4
Provides:       python-yaml%{?_isa} = %{version}-%{release}
140cf4
%if 0%{?with_python3}
140cf4
BuildRequires: python3-devel
140cf4
BuildRequires: python3-setuptools
140cf4
%endif
140cf4
140cf4
# http://pyyaml.org/ticket/247
140cf4
Patch0: PyYAML-size_t_not_int.patch
140cf4
140cf4
%description
140cf4
YAML is a data serialization format designed for human readability and
140cf4
interaction with scripting languages.  PyYAML is a YAML parser and
140cf4
emitter for Python.
140cf4
140cf4
PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
140cf4
support, capable extension API, and sensible error messages.  PyYAML
140cf4
supports standard YAML tags and provides Python-specific tags that
140cf4
allow to represent an arbitrary Python object.
140cf4
140cf4
PyYAML is applicable for a broad range of tasks from complex
140cf4
configuration files to object serialization and persistance.
140cf4
140cf4
%if 0%{?with_python3}
140cf4
%package -n python3-PyYAML
140cf4
Summary: YAML parser and emitter for Python
140cf4
Group: Development/Libraries
140cf4
140cf4
%description -n python3-PyYAML
140cf4
YAML is a data serialization format designed for human readability and
140cf4
interaction with scripting languages.  PyYAML is a YAML parser and
140cf4
emitter for Python.
140cf4
140cf4
PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
140cf4
support, capable extension API, and sensible error messages.  PyYAML
140cf4
supports standard YAML tags and provides Python-specific tags that
140cf4
allow to represent an arbitrary Python object.
140cf4
140cf4
PyYAML is applicable for a broad range of tasks from complex
140cf4
configuration files to object serialization and persistance.
140cf4
%endif
140cf4
140cf4
140cf4
%prep
140cf4
%setup -q -n %{name}-%{version}
140cf4
chmod a-x examples/yaml-highlight/yaml_hl.py
140cf4
%patch0 -p1
140cf4
pushd ext
140cf4
cython _yaml.pyx
140cf4
popd
140cf4
140cf4
%if 0%{?with_python3}
140cf4
rm -rf %{py3dir}
140cf4
cp -a . %{py3dir}
140cf4
%endif
140cf4
140cf4
140cf4
%build
140cf4
CFLAGS="${RPM_OPT_FLAGS}" %{__python} setup.py --with-libyaml build
140cf4
140cf4
%if 0%{?with_python3}
140cf4
pushd %{py3dir}
140cf4
CFLAGS="${RPM_OPT_FLAGS}" %{__python3} setup.py --with-libyaml build
140cf4
popd
140cf4
%endif
140cf4
140cf4
140cf4
%install
140cf4
rm -rf %{buildroot}
140cf4
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
140cf4
140cf4
%if 0%{?with_python3}
140cf4
pushd %{py3dir}
140cf4
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
140cf4
popd
140cf4
%endif
140cf4
140cf4
140cf4
%check
140cf4
%{__python} setup.py test
140cf4
140cf4
%if 0%{?with_python3}
140cf4
pushd %{py3dir}
140cf4
%{__python3} setup.py test
140cf4
popd
140cf4
%endif
140cf4
140cf4
140cf4
%clean
140cf4
rm -rf %{buildroot}
140cf4
140cf4
140cf4
%files
140cf4
%defattr(644,root,root,755)
140cf4
%doc CHANGES LICENSE PKG-INFO README examples
140cf4
%{python_sitearch}/*
140cf4
140cf4
%if 0%{?with_python3}
140cf4
%files -n python3-PyYAML
140cf4
%defattr(644,root,root,755)
140cf4
%doc CHANGES LICENSE PKG-INFO README examples
140cf4
%{python3_sitearch}/*
140cf4
%endif
140cf4
140cf4
140cf4
%changelog
140cf4
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 3.10-11
140cf4
- Mass rebuild 2014-01-24
140cf4
140cf4
* Tue Jan  7 2014 John Eckersberg <jeckersb@redhat.com> - 3.10-10
140cf4
- Add patch to fix build issue on s390x (bz1048898)
140cf4
140cf4
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 3.10-9
140cf4
- Mass rebuild 2013-12-27
140cf4
140cf4
* Thu Aug  8 2013 John Eckersberg <jeckersb@redhat.com> - 3.10-8
140cf4
- Add check section and run test suite
140cf4
140cf4
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10-7
140cf4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
140cf4
140cf4
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 3.10-6
140cf4
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
140cf4
140cf4
* Wed Aug  1 2012 David Malcolm <dmalcolm@redhat.com> - 3.10-5
140cf4
- remove rhel logic from with_python3 conditional
140cf4
140cf4
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10-4
140cf4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
140cf4
140cf4
* Fri Apr 27 2012 John Eckersberg <jeckersb@redhat.com> - 3.10-3
140cf4
- Add Provides for python-yaml (BZ#740390)
140cf4
140cf4
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10-2
140cf4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
140cf4
140cf4
* Thu Jun 23 2011 John Eckersberg <jeckersb@redhat.com> - 3.10-1
140cf4
- New upstream release 3.10
140cf4
140cf4
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.09-8
140cf4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
140cf4
140cf4
* Wed Feb  2 2011 John Eckersberg <jeckersb@redhat.com> - 3.09-7
140cf4
- Add support to build for python 3
140cf4
140cf4
* Tue Jul 27 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 3.09-6
140cf4
- Bump release number for upgrade path
140cf4
140cf4
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 3.09-3
140cf4
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
140cf4
140cf4
* Fri Oct 02 2009 John Eckersberg <jeckersb@redhat.com> - 3.09-1
140cf4
- New upstream release 3.09
140cf4
140cf4
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.08-6
140cf4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
140cf4
140cf4
* Wed Jul 22 2009 - John Eckersberg <jeckersb@redhat.com> - 3.08-5
140cf4
- Minor tweaks to spec file aligning with latest Fedora packaging guidelines
140cf4
- Enforce inclusion of libyaml in build with --with-libyaml option to setup.py
140cf4
- Deliver to %%{python_sitearch} instead of %%{python_sitelib} due to _yaml.so
140cf4
- Thanks to Gareth Armstrong <gareth.armstrong@hp.com>
140cf4
140cf4
* Tue Mar 3 2009 John Eckersberg <jeckersb@redhat.com> - 3.08-4
140cf4
- Correction, change libyaml to libyaml-devel in BuildRequires
140cf4
140cf4
* Mon Mar 2 2009 John Eckersberg <jeckersb@redhat.com> - 3.08-3
140cf4
- Add libyaml to BuildRequires
140cf4
140cf4
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.08-2
140cf4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
140cf4
140cf4
* Wed Feb 18 2009 John Eckersberg <jeckersb@redhat.com> - 3.08-1
140cf4
- New upstream release
140cf4
140cf4
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 3.06-2
140cf4
- Rebuild for Python 2.6
140cf4
140cf4
* Fri Oct 24 2008 John Eckersberg <jeckersb@redhat.com> - 3.06-1
140cf4
- New upstream release
140cf4
140cf4
* Wed Jan 02 2008 John Eckersberg <jeckersb@redhat.com> - 3.05-2
140cf4
- Remove explicit dependency on python >= 2.3
140cf4
- Remove executable on example script in docs
140cf4
140cf4
* Mon Dec 17 2007 John Eckersberg <jeckersb@redhat.com> - 3.05-1
140cf4
- Initial packaging for Fedora