%define _libdir64 %{_prefix}/lib64 %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: python-reportlab Version: 2.5 Release: 1 Summary: Python PDF generation library Group: Development/Libraries License: BSD URL: http://www.reportlab.org/ Source0: http://www.reportlab.org/ftp/reportlab-%{version}.tar.gz Patch0: reportlab-%{version}-font-locations.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: python-devel >= 2.6.2 BuildRequires: python-imaging >= 1.1.6-1 BuildRequires: freetype2-devel >= 2.3.12-1 Requires: dejavu-lgc-sans-fonts Requires: dejavu-lgc-sans-mono-fonts Requires: dejavu-lgc-serif-fonts Requires: dejavu-sans-fonts Requires: dejavu-sans-mono-fonts Requires: dejavu-serif-fonts Requires: python-imaging >= 1.1.6-1 %description Python PDF generation library. %package docs Summary: Documentation files for %{name} Group: Documentation Requires: %{name} = %{version}-%{release} %description docs Contains the documentation for ReportLab. %prep %setup -q -n reportlab-%{version} %patch0 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 build cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 CC=xlc_r python setup.py build # a bit of a horrible hack due to a chicken-and-egg problem. The docs # require reportlab, which isn't yet installed, but is at least built. PYTHONPATH="`pwd`/`ls -d build/lib*`" python docs/genAll.py %install [ "${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} %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/README.txt 32bit/CHANGES.txt 32bit/LICENSE.txt %{python_sitearch}/* %{python64_sitearch}/* %files docs %defattr(-,root,system,-) %doc 32bit/docs/*.pdf 32bit/demos 32bit/tools 32bit/LICENSE.txt %changelog * Tue Jul 30 2013 Michael Perzl - 2.5-1 - first version for AIX V5.1 and higher