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