From 8dd90113010e764f974b1c038832236b53a8e59a Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Tue, 14 Jan 2020 11:18:08 +0900 Subject: [PATCH] [Dist/Tizen] Support python 3 PyYAML 3.10 supports Python3 as well. Enable Python3 support. Note that Python 2.7 is now END-OF-LIFE since 2010-01-01. Tizen should get rid of Pytho 2.7 soon. Caffe2 is going to be ported to Tizen and it requires Python3-PyYAML. Change-Id: Icd633071c182bca53ae183111f9b3c41de4be141 Signed-off-by: MyungJoo Ham --- packaging/python-PyYAML.spec | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/packaging/python-PyYAML.spec b/packaging/python-PyYAML.spec index a4a3f5f..8398534 100644 --- a/packaging/python-PyYAML.spec +++ b/packaging/python-PyYAML.spec @@ -9,6 +9,7 @@ Source: http://pypi.python.org/packages/source/P/PyYAML/PyYAML-%{version Source1001: python-PyYAML.manifest BuildRequires: python-devel BuildRequires: python-nose +BuildRequires: python3-devel Provides: python-yaml = %{version} Obsoletes: python-yaml < %{version} @@ -25,12 +26,33 @@ 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. +%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 @@ -39,6 +61,7 @@ python setup.py test %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} +python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} %files %manifest %{name}.manifest @@ -46,4 +69,12 @@ python setup.py install --prefix=%{_prefix} --root=%{buildroot} %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 -- 2.7.4