File python-4Suite-XML.spec of Package python-4Suite-XML

# spec file for package python-4Suite-XML
# Copyright (c) 2012 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

Name:           python-4Suite-XML
Version:        1.0.2
Release:        0
Summary:        An open-source platform for XML processing
License:        Apache-1.1
Group:          Development/Languages/Python
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  python-devel
BuildRequires:  python-xml
Requires:       python-xml
%if 0%{?suse_version}
BuildRequires:  fdupes
Provides:       python-4suite-xml = %{version}
#TODO: Change to '<' after version update:
Obsoletes:      python-4suite-xml <= %{version}
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

XML tools and libraries for Python: Domlette, XPath, XSLT, XPointer, XLink,

%setup -q -n 4Suite-XML-%{version}
chmod -x Ft/Data/docbook_text1.xslt # Remove executable bit from XSLT file
rm Ft/Lib/DistExt/stubmain.exe # Remove windows binary (bnc#767228)

CFLAGS="%{optflags} -fno-strict-aliasing" python build

python 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}
%fdupes %{buildroot}%{_prefix}%{python_sitearch}

%doc %{_docdir}/%{name}