%define python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") %define python64_sitearch %(python_64 -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") Name: PyYAML Version: 3.10 Release: 1 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 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: libyaml-devel >= 0.1.4-1 BuildRequires: python-devel >= 2.6.2-1 BuildRequires: python-setuptools >= 0.6.14-1 Requires: libyaml >= 0.1.4-1 Requires: python >= 2.6.2-1 Provides: python-yaml = %{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 chmod a-x examples/yaml-highlight/yaml_hl.py mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build cd 64bit # first build the 64-bit version export OBJECT_MODE=64 CC=xlc_r python_64 setup.py --with-libyaml build cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 CC=xlc_r python setup.py --with-libyaml build %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit python_64 setup.py install --skip-build --no-compile --root ${RPM_BUILD_ROOT} cd ../32bit python setup.py install --skip-build --no-compile --root ${RPM_BUILD_ROOT} %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %doc 32bit/CHANGES 32bit/LICENSE 32bit/PKG-INFO 32bit/README 32bit/examples %{python_sitearch}/* %{python64_sitearch}/* %changelog * Mon Jun 24 2013 Michael Perzl - 3.10-1 - first version for AIX V5.1 and higher