[Dist/Tizen] Support python 3 47/222347/2 accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix accepted/tizen_6.5_unified accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix tizen_6.0 tizen_6.0_hotfix tizen_6.5 tizen_7.0 tizen_7.0_hotfix accepted/tizen/6.0/unified/20201030.111658 accepted/tizen/6.0/unified/hotfix/20201102.232803 accepted/tizen/6.5/unified/20211028.231045 accepted/tizen/7.0/unified/20221110.060252 accepted/tizen/7.0/unified/hotfix/20221116.111317 accepted/tizen/unified/20200220.050637 submit/tizen/20200219.103339 submit/tizen_6.0/20201029.205503 submit/tizen_6.0_hotfix/20201102.192903 submit/tizen_6.0_hotfix/20201103.115103 submit/tizen_6.5/20211028.163601 tizen_6.0.m2_release tizen_6.5.m2_release tizen_7.0_m2_release
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 14 Jan 2020 02:18:08 +0000 (11:18 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 14 Jan 2020 02:19:26 +0000 (11:19 +0900)
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 <myungjoo.ham@samsung.com>
packaging/python-PyYAML.spec

index a4a3f5f..8398534 100644 (file)
@@ -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