%define pybasever %{nil} %define without_pybasever 1 %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Summary: A collection of Python software tools Name: mx%{pybasever} Version: 3.1.1 Release: 2%{?dist} URL: http://www.lemburg.com/files/python/eGenix-mx-Extensions.html Source0: http://www.lemburg.com/python/egenix-mx-base-%{version}.tar.gz Patch1: mx-3.1.1-longyear.patch Patch2: mx-3.1.1-lib64.patch License: Python Group: Development/Libraries BuildRequires: Distutils BuildRequires: python-devel >= 2.3 %if %{?without_pybasever} Provides: mx2 = %{version}-%{release} Obsoletes: mx2 <= %{version}-%{release} %endif BuildRoot: %{_tmppath}/%{name}-%{version}-root %description The mx extensions for Python are a collection of Python software tools which enhance Python's usability in many areas. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel Development files for %{name} %prep %setup -q -n egenix-mx-base-%{version} %patch1 -p1 -b .longyear %patch2 -p1 -b .lib64 %build # alter /usr/local/bin/python for file in mx/DateTime/Examples/Y2000.py mx/Misc/OrderedMapping.py \ mx/TextTools/Examples/pytag.py mx/TextTools/Examples/Loop.py \ mx/TextTools/Examples/Python.py mx/DateTime/Examples/AtomicClock.py \ mx/TextTools/Examples/mysplit.py mx/TextTools/Examples/HTML.py \ mx/DateTime/Examples/alarm.py mx/TextTools/Examples/RegExp.py \ mx/TextTools/Examples/altRTF.py mx/TextTools/Examples/Words.py \ mx/TextTools/Examples/RTF.py mx/Misc/FileLock.py ; do sed -i -e 's!/usr/local/bin/python!%{_bindir}/python!' ${file} done # These just have test cases and aren't meant to be run for file in mx/Log.py mx/BeeBase/FileLock.py mx/Misc/OrderedMapping.py \ mx/Misc/FileLock.py ; do sed -i -e '/^#!.*python\b/d' ${file} done CFLAGS="$RPM_OPT_FLAGS" python setup.py build %install rm -rf %{buildroot} python setup.py install --skip-build --root=%{buildroot} pushd %{buildroot}%{python_sitearch} for I in `find . -name '*.h'`; do mkdir -p %{buildroot}%{_includedir}/`dirname $I` mv $I %{buildroot}%{_includedir}/`dirname $I` done popd # Examples, tests, benchmarks BASEDIR=%{buildroot}%{python_sitearch} mkdir examples mv ${BASEDIR}/mx/TextTools/mxTextTools/testkj.py examples/ mv ${BASEDIR}/mx/Stack/stackbench.py examples/ mv ${BASEDIR}/mx/Queue/queuebench.py examples/ mv ${BASEDIR}/mx/DateTime/mxDateTime/test.py examples/ # This is a utility. If it's deemed useful to the general public it should # be installed in %{_bindir} instead of examples mv ${BASEDIR}/mx/BeeBase/showBeeDict.py examples/ # These files are documentation, and are in a bad location mkdir docs mv -f ${BASEDIR}/mx/{LICENSE,COPYRIGHT} docs/ rm -rf ${BASEDIR}/mx/Doc DESTDIR=`pwd`/docs pushd ${BASEDIR}/mx cp -r --parents */Doc/* ${DESTDIR}/ cp -r --parents */Examples/* ${DESTDIR}/ popd rm -rf ${BASEDIR}/mx/*/Doc/ rm -rf ${BASEDIR}/mx/*/Examples rm -rf docs/*/Examples/*.pyc rm -rf docs/*/Examples/*.pyo %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc README docs/* %{python_sitearch}/mx %{python_sitearch}/egenix_mx_base*.egg-info %files devel %defattr(-,root,root,-) %{_includedir}/mx/ %changelog * Mon Sep 15 2008 Toshio Kuratomi 3.1.1-2 - Restore debug package - Clean up the python site-packages handling - Clean up handling of documentation, examples, scripts * Mon Sep 15 2008 Paul F. Johnson 3.1.1-1 - bump to newest release - patch fixes - spec file fixes - branch new devel sub package - fixes to permissions - removed debug-package (empty) * Thu Dec 7 2006 Jeremy Katz - 2.0.6-3 - rebuild against python 2.5 * Wed Jul 12 2006 Jesse Keating - 2.0.6-2.2.2 - rebuild * Fri Feb 10 2006 Jesse Keating - 2.0.6-2.2.1 - bump again for double-long bug on ppc(64) * Tue Feb 07 2006 Jesse Keating - 2.0.6-2.2 - rebuilt for new gcc4.1 snapshot and glibc changes * Fri Dec 09 2005 Jesse Keating - rebuilt * Mon Mar 14 2005 Mihai Ibanescu 2.0.6-2 - Rebuilt * Wed Feb 02 2005 Elliot Lee 2.0.6-1 - Rebuild with python 2.4 * Tue Jun 15 2004 Elliot Lee - rebuilt * Tue Mar 02 2004 Elliot Lee - rebuilt * Fri Feb 13 2004 Elliot Lee - rebuilt * Sun Nov 23 2003 Florian La Roche - update to 2.0.5 - recompile with python 2.3 * Wed Jun 04 2003 Elliot Lee - rebuilt * Wed Jan 22 2003 Tim Powers - rebuilt * Wed Dec 11 2002 Tim Powers 2.0.3-7 - lib64'ize * Tue Aug 06 2002 Elliot Lee 2.0.3-6 - Provide mx2 dep * Fri Jun 21 2002 Tim Powers - automated rebuild * Wed May 29 2002 Trond Eivind Glomsrød 2.0.3-4 - Make it require python >= 2.2, < 2.3 * Sun May 26 2002 Tim Powers - automated rebuild * Thu May 23 2002 Trond Eivind Glomsrød 2.0.3-2 - Move to python 2.2 * Wed Mar 13 2002 Trond Eivind Glomsrød 2.0.3-1 - 2.0.3 * Wed Feb 27 2002 Trond Eivind Glomsrød 2.0.2-5 - Rebuild (and no, it wasn't broken. It just used /usr/bin/python as the version to build for) * Mon Jan 21 2002 Elliot Lee 2.0.2-4 - Remove pyver autodetection (it's broken!) and install header files * Wed Jan 09 2002 Tim Powers - automated rebuild * Mon Oct 1 2001 Trond Eivind Glomsrød 2.0.2-2 - detect python version when building - 64bit fix mxDateTime * Fri Sep 14 2001 Trond Eivind Glomsrød 2.0.2-1 - 2.0.2 - Build for Python 2.2 * Tue Jun 19 2001 Trond Eivind Glomsrød - Initial build. Needed for python DB API