File python-jabberpy.spec of Package python-jabberpy
#
# spec file for package python-jabberpy
#
# 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/
#
%if 0%{?suse_version} >= 1140
%define py_ver %(echo `python -c "import sys; sys.stdout.write(sys.version[:3])"`)
# directories
%define py_prefix %(echo `python -c "import sys; sys.stdout.write(sys.prefix)"`)
%define py_libdir %{py_prefix}/lib/python%{py_ver}
%define py_incdir /usr/include/python%{py_ver}
%define py_sitedir %{py_libdir}/site-packages
%define py_dyndir %{py_libdir}/lib-dynload
# pure python modules compilation
%define py_comp python -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"
%define py_ocomp python -O -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"
%endif
%{?!python:%define python python}
%{?!pybasever:%{expand:%%define pybasever %(%{__python} -c "import sys ; print sys.version[:3]")}}
%define origname jabberpy
Name: python-jabberpy
Version: 0.5
Release: 0.<RELEASE9>
Summary: Python xmlstream and jabber IM protocol libs
Group: Development/Libraries
License: LGPL v2.1 or later
Url: http://jabberpy.sf.net
Source0: http://unc.dl.sourceforge.net/sourceforge/jabberpy/%{origname}-%{version}-0.tar.gz
Patch0: fix-package.dif
Patch1: jabberpy-clean-sockets.patch
Patch2: fix-hashlib-warning.dif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: %{python}-devel
%if 0%{?suse_version}
Requires: python = %{pybasever}
%else
Requires: python-abi = %{pybasever}
%endif
Provides: jabberpy = %{version}
%description
jabber.py is a Python module for the jabber instant messaging protocol.
jabber.py deals with the xml parsing and socket code, leaving the
programmer to concentrate on developing quality jabber based
applications with Python.
%prep
%setup -n %{origname}-%{version}-0 -q
chmod -x examples/*.py
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root="$RPM_BUILD_ROOT" --prefix=%{_prefix} --record=INSTALLED_FILES
%clean
rm -rf $RPM_BUILD_ROOT
%files -f INSTALLED_FILES
%defattr(-,root,root,-)
%dir %{py_sitedir}/jabber
%doc CREDITS MANIFEST README
%changelog