File python-elementtree.spec of Package python-elementtree

#
# spec file for package python-elementtree (Version 1.2.6)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define version_date 20050316
%define cElementTree_version 1.0.5
%define cElementTree_data 20051216
#%define py_sitedir %(%{__python} -c "from distutils.sysconfig  import get_python_lib; print get_python_lib()")
#%define py_sitedir %{_libdir}/python2.7/site-packages
%define py_sitedir /usr/lib/python2.7/site-packages
%define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")

Name:           python-elementtree
Summary:        Fast XML parser and writer
Group:          Development/Libraries/Python
License:        X11/MIT
Url:            http://effbot.org/zone/element-index.htm
Version:        1.2.6
Release:        1.1

Source:         elementtree-%{version}-%{version_date}.tar.bz2
Source1:        cElementTree-%{cElementTree_version}-%{cElementTree_data}.tar.bz2
Source2:        cElementTree-system-expat-setup.py
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  expat python-devel
%if 0%{?suse_version}
BuildRequires:  python-xml
%endif
%if 0%{?suse_version} >= 1030
BuildRequires:  libexpat-devel 
%endif

%if 0%{?suse_version}
%py_requires
%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.



Authors:
--------
    Fredrik Lundh <fredrik@pythonware.com>

%prep
%setup -q -n elementtree-%{version}-%{version_date} -a 1
cp cElementTree-%{cElementTree_version}-%{cElementTree_data}/README README-cElementTree
cp cElementTree-%{cElementTree_version}-%{cElementTree_data}/CHANGES CHANGES-cElementTree
cp %{SOURCE2} cElementTree-%{cElementTree_version}-%{cElementTree_data}/setup.py

%build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%{__python} setup.py build
pushd cElementTree-%{cElementTree_version}-%{cElementTree_data}
%{__python} setup.py build
popd

%install
%{__python} setup.py install --prefix=%{_prefix} --root $RPM_BUILD_ROOT
python selftest.py
pushd cElementTree-%{cElementTree_version}-%{cElementTree_data}
%{__python} setup.py install --prefix=%{_prefix} --root $RPM_BUILD_ROOT
popd

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc docs samples README* CHANGES* benchmark.py
%{py_sitedir}/*.egg-info
%{py_sitedir}/elementtree
%{_libdir}/python2.7/site-packages/*.egg-info
%{_libdir}/python2.7/site-packages/cElementTree.so

%changelog
* Sat Apr 18 2009 holger.manthey@bertelsmann.de
- fix build for centos
* Wed Jun 11 2008 lrupp@suse.de
- added libexpat-devel as BuildRequires for > 10.3
* Wed Jun 27 2007 judas_iscariote@shorewall.net
- celementtree needs -fno-strict-aliasing
* Mon Oct  2 2006 cthiel@suse.de
- fix build on older distributions
* Thu Sep 21 2006 cthiel@suse.de
- fix build with python 2.5
* Tue Feb 28 2006 jmatejek@suse.cz
- updated to reflect python changes due to #149809
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Sat Dec 24 2005 cthiel@suse.de
- update cElementTree to version 1.0.5-20051216
* Tue Nov  8 2005 dmueller@suse.de
- don't build as root
* Mon Sep 12 2005 cthiel@suse.de
- specfile cleanup
* Sun Aug 14 2005 cthiel@suse.de
- initial package, including
  * elementtree version 1.2.6-20050316
  * cElementTree verison 1.0.2-20050302