%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: Pyrex Version: 0.9.8.5 Release: 1 Summary: A compiler/language for writing Python extension modules Group: Development/Languages License: Public Domain URL: http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/ Source0: http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: pkg-config BuildRequires: python-devel BuildRequires: dos2unix Requires: python-devel %description Pyrex is Python with C types. It is specially designed to allow you to write extension modules for Python that have the speed of C and the simplicity and readability of Python. You write your code in a Python-like language with C-typed variables, then use the pyrexc compiler to transform it into a C representation. This is useful for speeding up critical sections of your Python code or wrapping an external library. Please see the documentation for how to get the best performance from your code. %prep %setup -q echo %{python_sitelib} > /tmp/kk1 echo %{python_sitelib64} >> /tmp/kk1 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cp -r 32bit/* 64bit/ %build cd 64bit python_64 setup.py build # Remove some Macintosh-isms find . -name '.DS_Store' -exec rm -f \{\} \; dos2unix -k -c mac CHANGES.txt ToDo.txt Demos/Makefile.nodistutils Tools/* find Doc -type f | xargs dos2unix -k -c mac cd ../32bit python setup.py build # Remove some Macintosh-isms find . -name '.DS_Store' -exec rm -f \{\} \; dos2unix -k -c mac CHANGES.txt ToDo.txt Demos/Makefile.nodistutils Tools/* find Doc -type f | xargs dos2unix -k -c mac %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}%{python_sitelib}/Pyrex/Mac rm -rf ${RPM_BUILD_ROOT}%{python_sitelib64}/Pyrex/Mac cd ${RPM_BUILD_ROOT}%{_bindir} cat pyrexc | sed 's:/usr/bin/python:/usr/bin/python_64:' > pyrexc_64 chmod 0755 pyrexc_64 cd ${RPM_BUILD_ROOT} mkdir -p usr/bin cd usr/bin ln -sf ../..%{_bindir}/* . %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/USAGE.txt 32bit/README.txt 32bit/CHANGES.txt 32bit/ToDo.txt %doc 32bit/Demos 32bit/Doc %{python_sitelib}/* %{python_sitelib64}/* %{_bindir}/* /usr/bin/* %changelog * Wed Sep 02 2009 Michael Perzl - 1.7.5-1 - first version for AIX V5.1 and higher