File openlmi-tools.spec of Package openlmi-tools

#
# spec file for package openlmi-tools
#
# Copyright (c) 2016 SUSE LINUX 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.5
Release:        0
%if 0%{?suse_version}
%else
%endif
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
Source1:        http://docs.openlmi.org/en/latest/objects.inv
%if 0%{?suse_version} == 1110
# 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
%endif

BuildRequires:  ImageMagick
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  openlmi-python-base
BuildRequires:  openwsman-python
BuildRequires:  python-docopt
BuildRequires:  python-pywbem
BuildRequires:  python-sphinx
BuildRequires:  python-sphinx_rtd_theme
%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
BuildRequires:  python-M2Crypto
BuildRequires:  python-pyparsing
%if 0%{?suse_version} > 1110
BuildRequires:  python-ply
BuildRequires:  python-pyOpenSSL
%else
BuildRequires:  python-openssl
%endif
%else
Requires:       m2crypto
Requires:       pyparsing
Requires:       python2
%endif

%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
cp %{S:1} doc/src
PAPER=a4 make

%install
cd cli
python setup.py install --root="%{buildroot}" --prefix=%{_prefix}
install -d %{buildroot}%{_mandir}/man1
install -pm0644 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