File python-qpid.spec of Package python-qpid

#
# spec file for package python-qpid
#
# Copyright (c) 2014 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-qpid
Version:        0.28
Release:        0
Summary:        Python client library for AMQP
License:        Apache-2.0
Group:          Development/Libraries/Python
Url:            http://qpid.apache.org
Source0:        http://www.apache.org/dyn/closer.cgi/qpid/%{version}/qpid-python-%{version}.tar.gz
# Avoid use of poll if select is monkey patched by Eventlet/Greenthreads
Patch0:         0001-QPID-5790-avoid-use-of-poll-if-select-is-monkey-patc.patch
BuildRequires:  python
BuildRequires:  python-devel
BuildRequires:  python-xml
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %{?suse_version} >= 1200
BuildArch:      noarch
%endif

%description
The Apache Qpid Python client library for AMQP.

%prep
%setup -q -n qpid-python-%{version}
%patch0 -p3
cd ..

%build
CFLAGS="%{optflags}" python setup.py build

%install
python setup.py install \
    --skip-build \
    --prefix %{_prefix} \
    --install-purelib %{python_sitelib} \
    --root %{buildroot}

chmod +x %{buildroot}/%{python_sitelib}/qpid/codec.py
chmod +x %{buildroot}/%{python_sitelib}/qpid/tests/codec.py
chmod +x %{buildroot}/%{python_sitelib}/qpid/reference.py
chmod +x %{buildroot}/%{python_sitelib}/qpid/managementdata.py
chmod +x %{buildroot}/%{python_sitelib}/qpid/disp.py

%files
%defattr(-,root,root,-)
%doc README.txt
%{_bindir}/qpid-python-test
%doc examples
%dir %{python_sitelib}/mllib
%{python_sitelib}/mllib/*
%dir %{python_sitelib}/qpid
%{python_sitelib}/qpid/*
%{python_sitelib}/qpid_python-*.egg-info

%changelog