%define pyver %(python -c 'import sys ; print sys.version[:3]') %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Name: Pyrex Version: 0.9.5.1a Release: 0 Epoch: 0 BuildArch: noarch 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/Pyrex-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python-devel BuildRequires: dos2unix BuildRequires: findutils Requires: python-abi = %{pyver} 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 %build python setup.py build # Remove some Macintosh-isms find . -name '.DS_Store' -exec rm -f \{\} \; dos2unix -k -c mac CHANGES.txt ToDo.txt Doc/* Demos/Makefile.nodistutils %install rm -rf $RPM_BUILD_ROOT python setup.py install --skip-build --root $RPM_BUILD_ROOT --record=INSTALLED_FILES # Add directories to the INSTALLED_FILES #find $RPM_BUILD_ROOT%{_libdir}/python%{pyver}/site-packages/Pyrex/Plex -type d -print | \ #sed "s|$RPM_BUILD_ROOT|%dir |g" >>INSTALLED_FILES find $RPM_BUILD_ROOT%{_libdir}/python%{pyver}/site-packages/Pyrex -type d -print | \ sed "s|$RPM_BUILD_ROOT|%dir |g" >>INSTALLED_FILES # Produce .pyo files for %ghost directive later (from duplicity) #python -Oc 'from compileall import *; compile_dir("'$RPM_BUILD_ROOT/%{_libdir}/python%{pyver}/site-packages/Pyrex/Plex'")' python -Oc 'from compileall import *; compile_dir("'$RPM_BUILD_ROOT/%{_libdir}/python%{pyver}/site-packages/Pyrex'")' %clean rm -rf $RPM_BUILD_ROOT %files -f INSTALLED_FILES %defattr(0644,root,root,0755) %doc USAGE.txt README.txt CHANGES.txt ToDo.txt Demos Doc %defattr(-,root,root,-) %ghost %{python_sitelib}/Pyrex/Plex/*.pyo %ghost %{python_sitelib}/Pyrex/*.pyo %ghost %{python_sitelib}/Pyrex/Compiler/*.pyo %ghost %{python_sitelib}/Pyrex/Distutils/*.pyo %ghost %{python_sitelib}/Pyrex/Unix/*.pyo %exclude %{python_sitelib}/Pyrex/Mac %changelog * Fri Dec 09 2005 Jesse Keating - rebuilt * Wed Oct 26 2005 John (J5) Palmieri - 0.9.3.1-2 - Remove lib64 hack since this is a noarch package - use python_sitelib script for determining where to install to * Fri Sep 30 2005 John (J5) Palmieri - 0.9.3.1-1 - update to 0.9.3.1 - remove gcc4 patch which is incorporated in this release * Tue Mar 22 2005 Jeremy Katz - 0.9.3-0 - update to 0.9.3 - add patch to fix generated code to build with gcc4 - require python-abi and python-devel instead of conflicting with newer python-devel * Mon Nov 8 2004 Jeremy Katz - 0:0.9.2.1-3 - rebuild against python 2.4 * Wed Aug 18 2004 John (J5) Palmieri - 0:0.9.2.1-2 - Added Steve Grubb's spec file patch (RH Bug #130200) * Fri Jun 25 2004 John (J5) Palmieri - 0:0.9.2.1-1 - New upstream version - Pyrex-0.9-split-base-types.patch synced for new version * Tue Jun 15 2004 Elliot Lee - rebuilt * Fri Jun 03 2004 John (J5) Palmieri - 0:0.9-5 - Built to rawhide * Wed May 19 2004 Florian La Roche - use rpm macros to determine lib64 usage * Fri Apr 23 2004 John (J5) Palmieri - 0:0.9-3 - Added Pyrex-0.9-split-base-types.patch which fixes long unsigned int bug showing up in dbus python binding builds for the x86_64 arch - Added regex hack to spec to work around a bug in python's distutils which would install files into /usr/lib instead of /usr/lib64 on 64 bit archs * Mon Apr 19 2004 John (J5) Palmieri - 0:0.9-2 - Was informed that the epoch change was not needed so the epoch was reverted back to 0 * Mon Apr 19 2004 John (J5) Palmieri - 1:0.9-1 - Upped the epoch so as to avoid clashes with the Fedora extra package * Mon Apr 19 2004 John (J5) Palmieri - 0:0.9-1 - Transfered to Red Hat Fedora's main tree - Removed need for LONG_LONG patch * Mon Feb 02 2004 Toshio Kuratomi - 0:0.9-0.fdr.4 - Removed the site-packages directory from the directories owned by the package * Mon Feb 02 2004 Toshio Kuratomi - 0:0.9-0.fdr.3 - My mistake: rpm automatically removes %%ghost files, no need to script it manually. - python distutils --record=FILE option doesn't record directories so include the site-packages/[directories] manually * Thu Jan 15 2003 Toshio Kuratomi - 0:0.9-0.fdr.2 - Merge changes from Michel Alexandre Salim + Require build system's python version because directories are named pythonX.Y + Create *.pyo files and %ghost them (Privleged user with python optimize turned on may generate them, but they aren't needed for operation. + Do not include the Mac Pyrex compiler stuff + Change license to Public Domain - Script to remove any %%ghost files on package removal - Patch around an incompatible change between python 2.2 and python 2.3's definition of LONG_LONG being renamed to PY_LONG_LONG * Fri Jan 09 2003 Toshio Kuratomi - 0:0.9-0.fdr.1 - Initial RPM release.