%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)") %define _libdir64 %{_prefix}/lib64 Name: pyPdf Version: 1.13 Release: 1 Summary: PDF toolkit Group: Development/Languages License: BSD URL: http://pybrary.net/pyPdf/ Source0: http://pybrary.net/pyPdf/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: python-devel >= 2.6.2 Requires: python >= 2.6.2 %description A Pure-Python library built as a PDF toolkit. It is capable of: * extracting document information (title, author, ...), * splitting documents page by page, * merging documents page by page, * cropping pages, * merging multiple pages into a single page, * encrypting and decrypting PDF files. %prep %setup -q 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 -O1 --skip-build --root ${RPM_BUILD_ROOT} # move it to the proper location mkdir -p ${RPM_BUILD_ROOT}%{_libdir64} mv ${RPM_BUILD_ROOT}%{_libdir}/python* ${RPM_BUILD_ROOT}%{_libdir64}/ 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 32bit/CHANGELOG %{python_sitelib}/pyPdf* %{python_sitelib64}/pyPdf* %changelog * Tue Jul 30 2013 Michael Perzl - 1.13-1 - first version for AIX V5.1 and higher