File python-pywbem.spec of Package python-pywbem

#
# spec file for package python-pywbem
#
# 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-pywbem
Version:        0.7.0
Release:        0
Url:            http://pywbem.sf.net/
Summary:        Python module for making CIM operation calls using the WBEM protocol
License:        LGPL-2.1+
Group:          System/Management
Source0:        pywbem-%{version}.tar.gz
# PATCH-FIX-UPSTREAM -- Upstream patch for IPv6 support
Patch:          pywbem-ipv6.patch
BuildRequires:  python-devel
BuildRequires:  python-xml
Requires:       python-xml
Provides:       pywbem = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
PyWBEM is a Python module for making CIM operation calls using the WBEM
protocol to query and update managed objects.

%prep
%setup  -q -n pywbem-%{version}
%patch -p1

%build
python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
#NOTE(saschpe): Definitely ugly but symlinking those binaries is the easiest way, thus
chmod +x %{buildroot}%{python_sitelib}/pywbem/{wbemcli,mof_compiler}.py
install -d %{buildroot}/usr/bin
ln -s %{python_sitelib}/pywbem/mof_compiler.py %{buildroot}/usr/bin/mofcomp
ln -s %{python_sitelib}/pywbem/wbemcli.py %{buildroot}/usr/bin/pywbemcli

%files
%defattr(-,root,root,-)
%doc README 
%{_bindir}/mofcomp
%{_bindir}/pywbemcli
%{python_sitelib}/pywbem-%{version}-py%{py_ver}.egg-info
%{python_sitelib}/pywbem

%changelog