Blame python-pyvirtualize.spec

72d1238
%global srcname pyVirtualize
72d1238
%global modname pyvirtualize
72d1238
72d1238
%global date    20181003
72d1238
%global commit0 57d2307f64f492b36fa99bc7c259210ec6a95635
72d1238
72d1238
%if 0%{?rhel} >= 7 || 0%{?fedora}
72d1238
%global with_python3 1
72d1238
%endif
72d1238
%if 0%{?rhel}
72d1238
%global with_python2 1
72d1238
%endif
72d1238
# FIXME epel7 Could not import extension sphinx.ext.githubpages (exception: No module named githubpages)
72d1238
%if 0%{?fedora}
72d1238
%global with_build_doc 1
72d1238
%endif
72d1238
72d1238
%global desc A python interface to access and manage VMware.\
72d1238
\
72d1238
pyVirtualize is build over pyVmomi, hence it has ability\
72d1238
to perform all the operations what vSphere client is able to.\
72d1238
\
72d1238
pyVirtualize provides easy interfaces to:\
72d1238
Connect to VMWare's ESX, ESXi, Virtual Center and\
72d1238
Virtual Server hosts.\
72d1238
Query hosts, datacenters, resource pools, virtual machines\
72d1238
and perform various operations over them.\
72d1238
VMs operations: power, file, process, snapshot, admin, utilities\
72d1238
\
72d1238
And of course, you can use it to access all the API through python.
72d1238
72d1238
Name:           python-%{modname}
72d1238
# pypi tells current version is 0.9
72d1238
Version:        0.9
bb94bbe
Release:        4.%{date}git%(c=%commit0; echo ${c:0:7} )%{?dist}
72d1238
Summary:        Python module to access and manage VMware
72d1238
72d1238
License:        ASL 2.0
72d1238
URL:            https://github.com/rocky1109/%{srcname}
72d1238
Source0:        %{url}/archive/%{commit0}.tar.gz#/%{srcname}-%{commit0}.tar.gz
72d1238
72d1238
BuildArch:      noarch
72d1238
%if 0%{?with_python2}
72d1238
BuildRequires:  python2-devel
72d1238
BuildRequires:  python2-setuptools
72d1238
%endif
72d1238
BuildRequires:  python%{python3_pkgversion}-devel
72d1238
BuildRequires:  python%{python3_pkgversion}-setuptools
72d1238
%if 0%{?python3_other_pkgversion}
72d1238
BuildRequires:  python%{python3_other_pkgversion}-devel
72d1238
BuildRequires:  python%{python3_other_pkgversion}-setuptools
72d1238
%endif
72d1238
%if 0%{?rhel}
72d1238
BuildRequires:  python2-sphinx
c104c9a
BuildRequires:  python2-sphinx_rtd_theme
72d1238
%endif
72d1238
%if 0%{?fedora}
c104c9a
# FIXME Fedora specifics, so we can depend without macros
72d1238
BuildRequires:  python3-sphinx
72d1238
BuildRequires:  python3-sphinx_rtd_theme
72d1238
%endif
72d1238
BuildRequires:  web-assets-devel
72d1238
72d1238
%description
72d1238
%desc
72d1238
72d1238
%if 0%{?with_python2}
72d1238
%package -n python2-%{modname}
72d1238
Summary:        %{summary}
72d1238
%{?python_provide:%python_provide python2-%{srcname}}
c104c9a
Requires:       python2-pyvmomi
72d1238
72d1238
%description -n python2-%{modname}
72d1238
%desc
72d1238
%endif
72d1238
72d1238
%if 0%{?with_python3}
72d1238
%package -n python%{python3_pkgversion}-%{modname}
72d1238
Summary:        %{summary}
72d1238
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
c104c9a
Requires:       python%{python3_pkgversion}-pyvmomi
72d1238
72d1238
%description -n python%{python3_pkgversion}-%{modname}
72d1238
%desc
72d1238
%endif
72d1238
72d1238
%if 0%{?python3_other_pkgversion}
72d1238
%package -n python%{python3_other_pkgversion}-%{modname}
72d1238
Summary:        %{summary}
72d1238
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{srcname}}
c104c9a
Requires:       python%{python3_other_pkgversion}-pyvmomi
72d1238
72d1238
%description -n python%{python3_other_pkgversion}-%{modname}
72d1238
%desc
72d1238
%endif
72d1238
72d1238
%package doc
72d1238
Summary:        Documentation files for %{srcname}
72d1238
Requires:       js-jquery
72d1238
# some js files of documentation are licensed with BSD
72d1238
License:        ASL 2.0 and BSD
72d1238
72d1238
%description doc
72d1238
This package installs %{summary}.
72d1238
72d1238
72d1238
%prep
72d1238
%autosetup -n %{srcname}-%{commit0}
72d1238
72d1238
%build
72d1238
%{?with_python2: %py2_build}
72d1238
%{?with_python3: %py3_build}
72d1238
%{?python3_other_pkgversion: %py3_other_build}
72d1238
%if 0%{?with_build_doc}
72d1238
# drop useless files
72d1238
rm -rfv docs/build/*
72d1238
sphinx-build -d docs/build/doctrees docs/source docs/build/html
72d1238
# drop useless build garbage
72d1238
find docs/build/html -name '.*' -print -delete
72d1238
%endif
72d1238
# unbundle jquery
72d1238
rm -v docs/build/html/_static/jquery*.js
72d1238
ln -fs %{_jsdir}/jquery/3/jquery.js docs/build/html/_static
72d1238
72d1238
%install
72d1238
%{?python3_other_pkgversion: %py3_other_install}
72d1238
%{?with_python3: %py3_install}
72d1238
%{?with_python2: %py2_install}
72d1238
72d1238
72d1238
%if 0%{?with_python2}
72d1238
%files -n python2-%{modname}
72d1238
%license LICENSE
72d1238
%doc README.md
72d1238
%{python2_sitelib}/%{srcname}/
72d1238
%{python2_sitelib}/%{srcname}-%{version}-py?.?.egg-info/
72d1238
%endif
72d1238
72d1238
%if 0%{?with_python3}
72d1238
%files -n python%{python3_pkgversion}-%{modname}
72d1238
%license LICENSE
72d1238
%doc README.md
72d1238
%{python3_sitelib}/%{srcname}/
72d1238
%{python3_sitelib}/%{srcname}-%{version}-py?.?.egg-info/
72d1238
%endif
72d1238
72d1238
%if 0%{?python3_other_pkgversion}
72d1238
%files -n python%{python3_other_pkgversion}-%{modname}
72d1238
%license LICENSE
72d1238
%doc README.md
72d1238
%{python3_other_sitelib}/%{srcname}/
72d1238
%{python3_other_sitelib}/%{srcname}-%{version}-py?.?.egg-info/
72d1238
%endif
72d1238
72d1238
%files doc
72d1238
%license LICENSE
72d1238
%doc docs/build/html/
72d1238
72d1238
72d1238
%changelog
bb94bbe
* Sat Mar 02 2019 Raphael Groner <projects.rg@smart.ms> - 0.9-4.20181003git57d2307
dd94722
- add more build macros to fix b0rken dependencies
dd94722
988a52e
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9-3.20181003git57d2307
988a52e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
988a52e
72d1238
* Thu Nov 01 2018 Raphael Groner <projects.rg@smart.ms> - 0.9-2.20181003git57d2307
72d1238
- use current snapshot
72d1238
- use python3 only in Fedora but still also python2 in EPEL
72d1238
- introduce modname macro
72d1238
72d1238
* Tue Sep 04 2018 Raphael Groner <projects.rg@smart.ms> - 0.9-1.20180205git4b01f44
72d1238
- initial
72d1238