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
d71e693
%global desc A python interface to access and manage pyvmomi.\
72d1238
\
d71e693
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:\
d71e693
Connect to ESX, ESXi, Virtual Center and 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
d71e693
Release:        6.%{date}git%(c=%commit0; echo ${c:0:7} )%{?dist}
d71e693
Summary:        Another python frontend to access and manage pyvmomi
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
72d1238
%description
72d1238
%desc
72d1238
72d1238
%if 0%{?with_python2}
72d1238
%package -n python2-%{modname}
72d1238
Summary:        %{summary}
ad5bb29
BuildRequires:  python2-devel
ad5bb29
BuildRequires:  python2-setuptools
ad5bb29
BuildRequires:  python2-sphinx
ad5bb29
# FIXME use python2 prefix when update is available in repo
ad5bb29
BuildRequires:  python-sphinx_rtd_theme
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}
ad5bb29
BuildRequires:  python%{python3_pkgversion}-devel
ad5bb29
BuildRequires:  python%{python3_pkgversion}-setuptools
ad5bb29
BuildRequires:  python%{python3_pkgversion}-sphinx
ad5bb29
BuildRequires:  python%{python3_pkgversion}-sphinx_rtd_theme
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}
ad5bb29
BuildRequires:  python%{python3_other_pkgversion}-devel
ad5bb29
BuildRequires:  python%{python3_other_pkgversion}-setuptools
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}
ad5bb29
BuildRequires:  web-assets-devel
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
d71e693
* Thu Aug 01 2019 Raphael Groner <projects.rg@smart.ms> - 0.9-6.20181003git57d2307
d71e693
- drop brand
ad5bb29
- group BR by python version and subpackage
d71e693
0dd965c
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9-5.20181003git57d2307
0dd965c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
0dd965c
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