File kamaki.spec of Package kamaki
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%define name kamaki
%define version 0.15
%define release 1
Summary: Command-line tool for managing clouds
Name: %{name}
Version: %{version}
Release: %{release}
Source0: http://pypi.python.org/packages/source/k/%{name}/%{name}-%{version}.tar.gz
Patch0: suse-default.patch
Patch1: rh-default.patch
License: BSD-2-Clause
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
BuildArch: noarch
Url: https://code.grnet.gr/projects/kamaki
Requires: python >= 2.6
Requires: python-objpool >= 0.2
Requires: python-argparse
Requires: python-ansicolors
Requires: python-progress >= 1.1
Requires: python-astakosclient >= 0.14.10
Requires: ca-certificates
%if 0%{?centos_version} && 0%{?centos_version} <= 600
Requires: python-ordereddict
%endif
BuildRequires: python-setuptools
BuildRequires: python-sphinx
%description
./kamaki is a simple, yet intuitive, command-line tool for managing clouds.
It is an initial implementation of the OpenStack Compute API v1.1, with custom
extensions specific to the Synnefo IaaS cloud management software.
%prep
%setup -n %{name}-%{version}
%if 0%{?suse_version}
%patch0 -p1
%else
%patch1 -p1
%endif
%build
%{__python} setup.py build
#cd docs && make man && make html
%install
%{__python} setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT
#mkdir -p %{buildroot}%{_mandir}/man1
#install -Dm644 docs/_build/man/kamaki.1 %{buildroot}%{_mandir}/man1/
#mkdir -p %{buildroot}%{_docdir}
#cp -a docs/_build/html %{buildroot}%{_docdir}/
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc COPYRIGHT README.md Changelog
#%{_mandir}/man1/*
%{python_sitelib}/*
%{_bindir}/*