From 72d1238179c4b52c65e89f7d41be926399ca8d61 Mon Sep 17 00:00:00 2001 From: Raphael Groner Date: Dec 18 2018 18:06:21 +0000 Subject: initial import, rhbz#1626231 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..70fd3d8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/pyVirtualize-57d2307f64f492b36fa99bc7c259210ec6a95635.tar.gz diff --git a/python-pyvirtualize.spec b/python-pyvirtualize.spec new file mode 100644 index 0000000..929ec90 --- /dev/null +++ b/python-pyvirtualize.spec @@ -0,0 +1,168 @@ +%global srcname pyVirtualize +%global modname pyvirtualize + +%global date 20181003 +%global commit0 57d2307f64f492b36fa99bc7c259210ec6a95635 + +%if 0%{?rhel} >= 7 || 0%{?fedora} +%global with_python3 1 +%endif +%if 0%{?rhel} +%global with_python2 1 +%endif +# FIXME epel7 Could not import extension sphinx.ext.githubpages (exception: No module named githubpages) +%if 0%{?fedora} +%global with_build_doc 1 +%endif + +%global desc A python interface to access and manage VMware.\ +\ +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 VMWare's 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: 2.%{date}git%(c=%commit0; echo ${c:0:7} )%{?dist} +Summary: Python module to access and manage VMware + +License: ASL 2.0 +URL: https://github.com/rocky1109/%{srcname} +Source0: %{url}/archive/%{commit0}.tar.gz#/%{srcname}-%{commit0}.tar.gz + +BuildArch: noarch +%if 0%{?with_python2} +BuildRequires: python2-devel +BuildRequires: python2-setuptools +%endif +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools +%if 0%{?python3_other_pkgversion} +BuildRequires: python%{python3_other_pkgversion}-devel +BuildRequires: python%{python3_other_pkgversion}-setuptools +%endif +%if 0%{?rhel} +BuildRequires: python2-sphinx +# FIXME use python2 prefix when update is available in repo +BuildRequires: python-sphinx_rtd_theme +%endif +%if 0%{?fedora} +BuildRequires: python3-sphinx +BuildRequires: python3-sphinx_rtd_theme +%endif +BuildRequires: web-assets-devel + +%description +%desc + +%if 0%{?with_python2} +%package -n python2-%{modname} +Summary: %{summary} +%{?python_provide:%python_provide python2-%{srcname}} +Requires: python3-pyvmomi + +%description -n python2-%{modname} +%desc +%endif + +%if 0%{?with_python3} +%package -n python%{python3_pkgversion}-%{modname} +Summary: %{summary} +%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} +Requires: python3-pyvmomi + +%description -n python%{python3_pkgversion}-%{modname} +%desc +%endif + +%if 0%{?python3_other_pkgversion} +%package -n python%{python3_other_pkgversion}-%{modname} +Summary: %{summary} +%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{srcname}} +Requires: python3-pyvmomi + +%description -n python%{python3_other_pkgversion}-%{modname} +%desc +%endif + +%package doc +Summary: Documentation files for %{srcname} +Requires: js-jquery +# some js files of documentation are licensed with BSD +License: ASL 2.0 and BSD + +%description doc +This package installs %{summary}. + + +%prep +%autosetup -n %{srcname}-%{commit0} + +%build +%{?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 +%endif +# unbundle jquery +rm -v docs/build/html/_static/jquery*.js +ln -fs %{_jsdir}/jquery/3/jquery.js docs/build/html/_static + +%install +%{?python3_other_pkgversion: %py3_other_install} +%{?with_python3: %py3_install} +%{?with_python2: %py2_install} + + +%if 0%{?with_python2} +%files -n python2-%{modname} +%license LICENSE +%doc README.md +%{python2_sitelib}/%{srcname}/ +%{python2_sitelib}/%{srcname}-%{version}-py?.?.egg-info/ +%endif + +%if 0%{?with_python3} +%files -n python%{python3_pkgversion}-%{modname} +%license LICENSE +%doc README.md +%{python3_sitelib}/%{srcname}/ +%{python3_sitelib}/%{srcname}-%{version}-py?.?.egg-info/ +%endif + +%if 0%{?python3_other_pkgversion} +%files -n python%{python3_other_pkgversion}-%{modname} +%license LICENSE +%doc README.md +%{python3_other_sitelib}/%{srcname}/ +%{python3_other_sitelib}/%{srcname}-%{version}-py?.?.egg-info/ +%endif + +%files doc +%license LICENSE +%doc docs/build/html/ + + +%changelog +* 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 + diff --git a/sources b/sources new file mode 100644 index 0000000..acf9b56 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (pyVirtualize-57d2307f64f492b36fa99bc7c259210ec6a95635.tar.gz) = c96e7f533ae6f7648bdbd88051f626c65fad412069f5368c8648078c6e6897497ec14b0d87032ca9fc71142e96303a21043fce69c28aafe7eb223c5c509bc967