File python-4Suite-XML.spec of Package python-4Suite-XML
#
# spec file for package python-4Suite-XML
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-4Suite-XML
Version: 1.0.2
Release: 5
Url: http://4suite.org
Summary: An open-source platform for XML processing
License: 4Suite (Apache-based)
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/4/4Suite-XML/4Suite-XML-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
BuildRequires: python-xml
Requires: python-xml
%if 0%{?suse_version}
%py_requires
%if 0%{?suse_version} > 1010
BuildRequires: fdupes
%endif
%endif
Provides: python-4suite-xml = %{version}
#TODO: Change to '<' after version update:
Obsoletes: python-4suite-xml <= %{version}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%description
XML tools and libraries for Python: Domlette, XPath, XSLT, XPointer, XLink,
XUpdate.
%prep
%setup -q -n 4Suite-XML-%{version}
chmod -x Ft/Data/docbook_text1.xslt # Remove executable bit from XSLT file
%build
CFLAGS="%{optflags} -fno-strict-aliasing" python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
# Move documentation into proper place /usr/share/doc/packages/%%{name}
install -d %{buildroot}%{_docdir}/%{name}
mv %{buildroot}%{_datadir}/doc/4Suite/* %{buildroot}%{_docdir}/%{name}
install -d %{buildroot}%{_datadir}/%{name}
mv %{buildroot}%{_prefix}/lib/4Suite/profiles %{buildroot}%{_datadir}/%{name}/ # Move 'profiles' away from /usr/lib
rm -rf %{buildroot}%{_prefix}/lib/4Suite/tests # Remove unwanted tests from /usr/lib
%if 0%{?suse_version} > 1010
%fdupes %{buildroot}%{_prefix}
%endif
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc %{_docdir}/%{name}
%{_bindir}/4xml
%{_bindir}/4xpath
%{_bindir}/4xslt
%{_bindir}/4xupdate
%{_datadir}/%{name}
%{_datadir}/4Suite
%{python_sitearch}/*
%changelog