Source1001: python-PyYAML.manifest
BuildRequires: python-devel
BuildRequires: python-nose
+BuildRequires: python3-devel
Provides: python-yaml = %{version}
Obsoletes: python-yaml < %{version}
PyYAML is applicable for a broad range of tasks from complex
configuration files to object serialization and persistance.
+%package -n python3-PyYAML
+Summary: YAML parser and emitter for Python3
+Provides: python3-yaml = %{version}
+Obsoletes: python3-yaml < %{version}
+
+%description -n python3-PyYAML
+PyYAML for Python3
+
+YAML is a data serialization format designed for human readability
+and interaction with scripting languages. PyYAML is a YAML parser
+and emitter for Python.
+
+PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
+support, capable extension API, and sensible error messages. PyYAML
+supports standard YAML tags and provides Python-specific tags that
+allow to represent an arbitrary Python object.
+
+PyYAML is applicable for a broad range of tasks from complex
+configuration files to object serialization and persistance.
+
%prep
%setup -q -n PyYAML-%{version}
cp %{SOURCE1001} .
%build
CFLAGS="%{optflags}" python setup.py build
+CFLAGS="%{optflags}" python3 setup.py build
find examples -type f | xargs chmod -x # Fix example permissions
%check
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
+python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
%files
%manifest %{name}.manifest
%doc LICENSE
%{python_sitearch}/*
+%define python3_sitearch %(/usr/bin/python3 -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1))")
+
+%files -n python3-PyYAML
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%doc LICENSE
+%{python3_sitearch}/*
+
%changelog