%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Name: odpdom Summary: Oversized Document Parser Version: 0.2.1 Release: 1 Source0: http://dl.sourceforge.net/sourceforge/odpdom/%{name}-%{version}.tar.gz Patch0: %{name}-rpm.patch Patch1: %{name}-p4v.patch URL: http://sourceforge.net/projects/odpdom/ License: LGPLv2+ Group: System Environment/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n) BuildRequires: python-devel BuildRequires: swig >= 1.3.16 %description ODPdom is a simple non-validating DOM (Document Object Model) parser written in C++, that can handle relatively large XML files with the size in order of several 10 MB (pro file). Currently it is used to process large output files (~100MB) from scientific simulations (http://cms.mpi.univie.ac.at/vasp/Welcome.html). Contrary to traditional DOM parsers, ODPdom does not create the whole DOM tree by reading, rather it parses the requested informations on demand. The objects occurring in DOM (Node, Element, NodeList...) are in ODPdom not much more, than a bit more intelligent pointers to a place in a (preprocessed) text. %package devel Summary: Oversized Document Parser development files Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel ODPdom is a simple non-validating DOM (Document Object Model) parser written in C++, that can handle relatively large XML files with the size in order of several 10 MB (pro file). This package contains the development files. %package -n python-%{name} Summary: Oversized Document Parser python bindings Group: Development/Libraries %description -n python-%{name} ODPdom is a simple non-validating DOM (Document Object Model) parser written in C++, that can handle relatively large XML files with the size in order of several 10 MB (pro file). This package contains the python module. %prep %setup -q %patch0 -p1 -b .r %patch1 -p1 -b .p4v %build # force rebuild of python bindings with distro swig %{__make} cleanwrap %{__make} %{?_smp_mflags} OPTFLAGS="$RPM_OPT_FLAGS" LIBDIR=%{_libdir} PYTHON=%{__python} %install rm -rf %{buildroot} %{__make} install DESTDIR=%{buildroot} LIBDIR=%{_libdir} PYTHON=%{__python} %clean rm -rf %{buildroot} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-,root,root,-) %doc COPYING README %{_libdir}/libODP.so.* %files -n python-%{name} %defattr(-,root,root,-) %attr(755,root,root) %{python_sitearch}/*.so %{python_sitearch}/ODPdom.py* %{python_sitearch}/cODP.py* %if 0%{fedora} >= 9 %{python_sitearch}/odpdom-%{version}-py*.egg-info %endif %files devel %defattr(-,root,root,-) %{_includedir}/ODP %{_libdir}/libODP.so %changelog * Tue Apr 29 2008 Dominik Mierzejewski 0.2.1-1 - initial package - patch to make shared library - use python setuptools for build and install