%define name python3-pyyaml %define srcname PyYAML %define version 5.1.2 %define release 1 %define is_python %(test -e /usr/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(python3_32 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif %define _libdir64 %{_prefix}/lib64 %define is_python_64 %(test -e /usr/bin/python3_64 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif Summary: YAML parser and emitter for Python Name: %{name} Version: %{version} Release: %{release} Source0: http://pyyaml.org/download/pyyaml/%{srcname}-%{version}.tar.gz Source1: pyYAML-aix.patch Url: http://pyyaml.org License: MIT Group: Development/Libraries Prefix: %{_prefix} BuildRequires: python3 >= 3.7.3 BuildRequires: python3-devel >= 3.7.3 BuildRequires: libyaml-devel >= 0.1.4 Requires: libyaml >= 0.1.4 Provides: python3-pyyaml = %{version}-%{release} Provides: python3-pyyaml%{?_isa} = %{version}-%{release} Provides: python3-PyYAML = %{version}-%{release} Provides: python3-PyYAML%{?_isa} = %{version}-%{release} %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 persistance. %prep %setup -q -n %{srcname}-%{version} chmod a-x examples/yaml-highlight/yaml_hl.py %build patch -p0 < %{SOURCE1} python3 setup.py --with-libyaml build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT} %check python3 setup.py test %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc LICENSE CHANGES PKG-INFO README examples %{python_sitelib64}/* %changelog * Mon Dec 02 2019 Baanu Tumma - 5.1.2-1 - Updated to latest version, built using python3 * Mon Feb 02 2015 Gerard Visiedo - 3.11-2 - Rebuilt with "build" onsted of "buildÃ_ext" compile option * Thu Oct 30 2014 Gerard Visiedo - 3.11-1 - first version for AIX V6.1 and higher