SPECS/PyYAML/PyYAML.spec
30b63cfb
 %{!?python2_sitelib: %define python2_sitelib %(python2 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
 %{!?python3_sitelib: %define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
 
f4d17450
 Name:           PyYAML
626d1f1e
 Version:        3.12
30b63cfb
 Release:        2%{?dist}
f4d17450
 Summary:        YAML parser and emitter for Python
 Group:          Development/Libraries
 License:        MIT
 URL:            http://pyyaml.org/
 Source0:        http://pyyaml.org/download/pyyaml/%{name}-%{version}.tar.gz
626d1f1e
 %define sha1 PyYAML=cb7fd3e58c129494ee86e41baedfec69eb7dafbe
f4d17450
 
30b63cfb
 BuildRequires:  python2
 BuildRequires:  python2-libs
 BuildRequires:  python2-devel
 BuildRequires:  libyaml-devel
f4d17450
 
30b63cfb
 Requires:       python2
 Requires:       python2-libs
 Requires:       libyaml
f4d17450
 
 %description
 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 persistence.
 
30b63cfb
 %package -n     python3-PyYAML
 Summary:        python3-PyYAML
 BuildRequires:  python3
 BuildRequires:  python3-devel
 BuildRequires:  python3-libs
 BuildRequires:  libyaml-devel
 
 Requires:       python3
 Requires:       python3-libs
 Requires:       libyaml
 
 %description -n python3-PyYAML
 Python 3 version.
 
 
f4d17450
 %prep
30b63cfb
 %setup -q -n PyYAML-%{version}
 rm -rf ../p3dir
 cp -a . ../p3dir
f4d17450
 
 %build
30b63cfb
 python2 setup.py build
 pushd ../p3dir
 python3 setup.py build
 popd
f4d17450
 
 %install
 rm -rf $RPM_BUILD_ROOT
 mkdir -p $RPM_BUILD_ROOT/%{_bindir}
30b63cfb
 python2 setup.py install --skip-build --prefix=%{_prefix} --root=%{buildroot}
 chmod a-x examples/yaml-highlight/yaml_hl.py
 pushd ../p3dir
 python3 setup.py install --skip-build --prefix=%{_prefix} --root=%{buildroot}
 chmod a-x examples/yaml-highlight/yaml_hl.py
 popd
f4d17450
 
02c3b9a3
 %check
30b63cfb
 python2 setup.py test
 pushd ../p3dir
 python3 setup.py test
 popd
02c3b9a3
 
f4d17450
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
30b63cfb
 %defattr(-,root,root)
 %doc PKG-INFO README LICENSE examples
 %{python2_sitelib}/*
 
 %files -n python3-PyYAML
f4d17450
 %defattr(-,root,root,-)
 %doc PKG-INFO README LICENSE examples
30b63cfb
 %{python3_sitelib}/*
f4d17450
 
 
 %changelog
30b63cfb
 *   Tue May 16 2017 Kumar Kaushik <kaushikk@vmware.com> 3.12-2
 -   Adding python3 support.
 *   Tue Apr 18 2017 Dheeraj Shetty <dheerajs@vmware.com> 3.12-1
 -   Updated version to 3.12
 *   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 3.11-2
 -   GA - Bump release of all rpms
 *   Wed Mar 04 2015 Mahmoud Bassiouny <mbassiouny@vmware.com>
 -   Initial packaging for Photon