%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %define _upstream_nvr elementtree-1.2.6-20050316 %define _upstream_cnvr cElementTree-1.0.5-20051216 %define python_ver %(%{__python} -c "import sys ; print sys.version[:3]") %if "%{python_ver}" < "2.3" %define buildel3 1 %else %define buildel3 0 %endif Name: python-elementtree Version: 1.2.6 Release: 5%{?dist} Summary: Fast XML parser and writer Group: Development/Libraries License: PSF URL: http://effbot.org/zone/element-index.htm Source0: http://effbot.org/downloads/%{_upstream_nvr}.zip Source1: http://effbot.org/downloads/%{_upstream_cnvr}.tar.gz Source2: cElementTree-system-expat-setup.py BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: expat-devel, python-devel %if %{buildel3} #Requires: python-abi = %(%{__python} -c "import sys ; print sys.version[:3]") %else Requires: python-abi = %(%{__python} -c "import sys ; print sys.version[:3]") %endif %description The Element type is a simple but flexible container object, designed to store hierarchical data structures, such as simplified XML infosets, in memory. The element type can be described as a cross between a Python list and a Python dictionary. This package also includes the C implementation, %{_upstream_cnvr}. %prep %setup -q -n %{_upstream_nvr} -a 1 ## Take care of cElementTree pushd %{_upstream_cnvr} mv -f setup.py setup.py-orig cp -f %{SOURCE2} setup.py cp -f README ../README-cElementTree cp -f CHANGES ../CHANGES-cElementTree popd %build %{__python} setup.py build pushd %{_upstream_cnvr} CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build popd %install rm -rf $RPM_BUILD_ROOT %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT pushd %{_upstream_cnvr} %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT popd %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc docs samples README* CHANGES* benchmark.py %dir %{python_sitelib}/elementtree %{python_sitelib}/elementtree/*.py* %{python_sitearch}/*.so %changelog * Mon Apr 30 2007 Johnny Hughes 1.2.6-5.el3.centos - modified to build on CentOS-3 or CentOS-4 by only requiring python-abi with python > 2.3 * Wed Sep 6 2006 Jeremy Katz - 1.2.6-5 - don't ghost pyo files (#205446) - upstream bugfix release * Wed Jul 12 2006 Jesse Keating - 1.2.6-4.2.2 - rebuild * Fri Feb 10 2006 Jesse Keating - 1.2.6-4.2.1 - bump again for double-long bug on ppc(64) * Tue Feb 07 2006 Jesse Keating - 1.2.6-4.2 - rebuilt for new gcc4.1 snapshot and glibc changes * Fri Dec 09 2005 Jesse Keating - rebuilt * Mon Apr 4 2005 Jeremy Katz - 1.2.6-4 - rebuild for core - use %%setup -q -a 1 instead of unzipping source1 * Tue Mar 30 2005 Konstantin Ryabitsev - 1.2.6-3 - Use python_sitearch for the C library. * Tue Mar 29 2005 Konstantin Ryabitsev - 1.2.6-2 - Use python_sitelib - Own the elementtree dir in site-packages - BuildRequire python-devel - Do not namely require expat - Do not use INSTALLED_FILES (safer) - Use ghosting for .pyo * Thu Mar 17 2005 Konstantin Ryabitsev - 1.2.6-1 - Version 1.2.6 of ElementTree. * Thu Mar 10 2005 Konstantin Ryabitsev - 1.2.5-1 - Rename as python-elementtree. * Sat Mar 5 2005 Konstantin Ryabitsev - 1.2.5-1 - Initial RPM release.