File openlmi-tools.spec of Package openlmi-tools

#
# spec file for package openlmi-tools
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2013 Redhat, Inc
#
# 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:           openlmi-tools
Version:        0.10.1
Release:        2%{?dist}
Summary:        Tooling around openLMI
License:        GPL-2.0
Group:          System/Management
%if 0%{?suse_version} > 1110
# SLE11 has Python site-dir below /usr/lib64
BuildArch:      noarch
%endif

Url:            http://fedorahosted.org/openlmi/
Source0:        https://fedorahosted.org/released/openlmi-tools/%{name}-%{version}.tar.gz
# Python 2.6 vs 2.7 dict creation syntax change, kkaempf@suse.de
# See http://stackoverflow.com/questions/1747817/python-create-a-dictionary-with-list-comprehension
Patch:          python-2.6.patch

BuildRequires:  ImageMagick
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  openlmi-python-base
BuildRequires:  openwsman-python
BuildRequires:  python-docopt
BuildRequires:  python-pyparsing
BuildRequires:  python-pywbem
BuildRequires:  python-sphinx
BuildRequires:  python-sphinx-theme-openlmi
%if 0%{?suse_version} < 1120
# SLE11 needs explicit BuildRoot
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# Python 2.6 needs argparse
BuildRequires:  python-argparse
%endif
%if 0%{?suse_version}
BuildRequires:  python
%if 0%{?suse_version} > 1110
BuildRequires:  python-pyOpenSSL
%else
BuildRequires:  python-openssl
%endif
%else
Requires:       python2
%endif
BuildRequires:  python-M2Crypto

%if 0%{?suse_version} > 1010
BuildRequires:  fdupes
%endif

# sblim-sfcb or tog-pegasus
# (required to be present during install/uninstall for registration)
Requires:       cim-server
Requires(pre):  cim-server
Requires(preun): cim-server
Requires(post): cim-server

# XXX
# Just because we have wired python's scripts
# Remove in future
BuildRequires:  python-setuptools

%description
%{name} is set of tools to build and work with openLMI providers

%prep
%setup -q
%if 0%{?suse_version} == 1110
#%patch -p1
%endif

%build
make

%install
cd cli
python setup.py install --root=$RPM_BUILD_ROOT --prefix=%{_prefix}
install -d %{buildroot}%{_mandir}/man1
install man/lmi.1 %{buildroot}%{_mandir}/man1

%if 0%{?suse_version} > 1010
%fdupes %{buildroot}
%endif

%files
%defattr(-,root,root,-)
%doc README.md COPYING AUTHORS
%{_bindir}/lmi*
%dir %{python_sitelib}/lmi
%dir %{python_sitelib}/openlmi_tools-*-info
%{python_sitelib}/lmi*
%{python_sitelib}/openlmi_tools-*-nspkg.pth
%{python_sitelib}/openlmi_tools-*-info/*
%{_mandir}/man1/lmi.1*

%changelog
openSUSE Build Service is sponsored by