%define name python-PyYAML %define srcname PyYAML %define version 3.11 %define release 1 %define is_python %(test -e /usr/bin/python && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(python -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/python_64 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python_64 -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 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildRequires: python >= 2.4 BuildRequires: python-devel >= 2.4 BuildRequires: python-setuptools BuildRequires: libyaml-devel Requires: libyaml >= 0.1.4 Provides: python-yaml = %{version}-%{release} Provides: python-yaml%{?_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 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cp -r 32bit/* 64bit/ %build patch -p0 < %{SOURCE1} cd 64bit export OBJECT_MODE=64 #python_64 setup.py --with-libyaml build_ext python_64 setup.py --with-libyaml build cd ../32bit export OBJECT_MODE=32 #python setup.py --with-libyaml build_ext python setup.py --with-libyaml build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT cd 64bit python_64 setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT} cd ../32bit python setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT} #%check #python setup.py test %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/LICENSE 32bit/CHANGES 32bit/PKG-INFO 32bit/README 32bit/examples %{python_sitelib}/* %{python_sitelib64}/_yaml.so %changelog * 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