%global modname iniparse %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") %define python_sitelib64 %(python_64 -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") Name: python-%{modname} Version: 0.4 Release: 1 Summary: Python Module for Accessing and Modifying Configuration Data in INI files License: MIT and Python URL: http://code.google.com/p/iniparse/ Group: Applications/System Source0: http://iniparse.googlecode.com/files/%{modname}-%{version}.tar.gz Patch0: fix-issue-28.patch # Fixup the module to have proper setup.py information Patch2: %{name}-setup-fixes.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: noarch BuildRequires: python-devel >= 2.7.13-1 BuildRequires: python-setuptools >= 32.3.1-1 Requires: python >= 2.7.13-1 %define _libdir64 %{_prefix}/lib64 %description iniparse is an INI parser for Python which is API compatible with the standard library's ConfigParser, preserves structure of INI files (order of sections & options, indentation, comments, and blank lines are preserved when data is updated), and is more convenient to use. %prep %setup -q -n %{modname}-%{version} %patch0 -p1 %patch2 -p0 chmod -x html/index.html mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build cd 64bit python_64 setup.py build cd ../32bit python setup.py build %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit python_64 setup.py install --skip-build --root ${RPM_BUILD_ROOT} mv ${RPM_BUILD_ROOT}%{_libdir} ${RPM_BUILD_ROOT}%{_libdir64} cd ../32bit python setup.py install --skip-build --root ${RPM_BUILD_ROOT} rm -rf ${RPM_BUILD_ROOT}%{_datadir}/doc/* %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/README 32bit/Changelog 32bit/html/ %{python_sitelib}/* %{python_sitelib64}/* %changelog * Wed Feb 01 2017 Michael Perzl - 0.4-1 - first version for AIX V5.1 and higher