Blob Blame History Raw
%global srcname pyVirtualize
%global modname pyvirtualize

%global date    20181003
%global commit0 57d2307f64f492b36fa99bc7c259210ec6a95635

%if 0%{?rhel} >= 7 || 0%{?fedora}
%global with_python3 1
%if 0%{?rhel}
%global with_python2 1
# FIXME epel7 Could not import extension sphinx.ext.githubpages (exception: No module named githubpages)
%if 0%{?fedora}
%global with_build_doc 1

%global desc A python interface to access and manage pyvmomi.\
pyVirtualize is build over pyvmomi, hence it has ability\
to perform all the operations what vSphere client is able to.\
pyVirtualize provides easy interfaces to:\
Connect to ESX, ESXi, Virtual Center and Virtual Server hosts.\
Query hosts, datacenters, resource pools, virtual machines\
and perform various operations over them.\
VMs operations: power, file, process, snapshot, admin, utilities\
And of course, you can use it to access all the API through python.

Name:           python-%{modname}
# pypi tells current version is 0.9
Version:        0.9
Release:        6.%{date}git%(c=%commit0; echo ${c:0:7} )%{?dist}
Summary:        Another python frontend to access and manage pyvmomi

License:        ASL 2.0
URL:  {srcname}
Source0:        %{url}/archive/%{commit0}.tar.gz#/%{srcname}-%{commit0}.tar.gz

BuildArch:      noarch


%if 0%{?with_python2}
%package -n python2-%{modname}
Summary:        %{summary}
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
BuildRequires:  python2-sphinx
# FIXME use python2 prefix when update is available in repo
BuildRequires:  python-sphinx_rtd_theme
%{?python_provide:%python_provide python2-%{srcname}}
Requires:       python2-pyvmomi

%description -n python2-%{modname}

%if 0%{?with_python3}
%package -n python%{python3_pkgversion}-%{modname}
Summary:        %{summary}
BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-setuptools
BuildRequires:  python%{python3_pkgversion}-sphinx
BuildRequires:  python%{python3_pkgversion}-sphinx_rtd_theme
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
Requires:       python%{python3_pkgversion}-pyvmomi

%description -n python%{python3_pkgversion}-%{modname}

%if 0%{?python3_other_pkgversion}
%package -n python%{python3_other_pkgversion}-%{modname}
Summary:        %{summary}
BuildRequires:  python%{python3_other_pkgversion}-devel
BuildRequires:  python%{python3_other_pkgversion}-setuptools
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{srcname}}
Requires:       python%{python3_other_pkgversion}-pyvmomi

%description -n python%{python3_other_pkgversion}-%{modname}

%package doc
Summary:        Documentation files for %{srcname}
BuildRequires:  web-assets-devel
Requires:       js-jquery
# some js files of documentation are licensed with BSD
License:        ASL 2.0 and BSD

%description doc
This package installs %{summary}.

%autosetup -n %{srcname}-%{commit0}

%{?with_python2: %py2_build}
%{?with_python3: %py3_build}
%{?python3_other_pkgversion: %py3_other_build}
%if 0%{?with_build_doc}
# drop useless files
rm -rfv docs/build/*
sphinx-build -d docs/build/doctrees docs/source docs/build/html
# drop useless build garbage
find docs/build/html -name '.*' -print -delete
# unbundle jquery
rm -v docs/build/html/_static/jquery*.js
ln -fs %{_jsdir}/jquery/3/jquery.js docs/build/html/_static

%{?python3_other_pkgversion: %py3_other_install}
%{?with_python3: %py3_install}
%{?with_python2: %py2_install}

%if 0%{?with_python2}
%files -n python2-%{modname}
%license LICENSE

%if 0%{?with_python3}
%files -n python%{python3_pkgversion}-%{modname}
%license LICENSE

%if 0%{?python3_other_pkgversion}
%files -n python%{python3_other_pkgversion}-%{modname}
%license LICENSE

%files doc
%license LICENSE
%doc docs/build/html/

* Thu Aug 01 2019 Raphael Groner <> - 0.9-6.20181003git57d2307
- drop brand
- group BR by python version and subpackage

* Fri Jul 26 2019 Fedora Release Engineering <> - 0.9-5.20181003git57d2307
- Rebuilt for

* Sat Mar 02 2019 Raphael Groner <> - 0.9-4.20181003git57d2307
- add more build macros to fix b0rken dependencies

* Sat Feb 02 2019 Fedora Release Engineering <> - 0.9-3.20181003git57d2307
- Rebuilt for

* Thu Nov 01 2018 Raphael Groner <> - 0.9-2.20181003git57d2307
- use current snapshot
- use python3 only in Fedora but still also python2 in EPEL
- introduce modname macro

* Tue Sep 04 2018 Raphael Groner <> - 0.9-1.20180205git4b01f44
- initial