forked from michaelrice/python-pyvmomi-rpm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython-pyvmomi.spec
More file actions
115 lines (93 loc) · 3.06 KB
/
python-pyvmomi.spec
File metadata and controls
115 lines (93 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
%if 0%{?fedora}
%global _with_python3 1
%endif
%global pyvmomi_version 5.5.0-2014.1.1
%global pyvmomi_rpmversion %(echo %{pyvmomi_version} | tr "-" ".")
%{!?_licensedir:%global license %%doc}
%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%endif
Name: python-pyvmomi
Version: %{pyvmomi_rpmversion}
Release: 2%{?dist}
Summary: VMware vSphere Python SDK
Group: Development/Languages
License: ASL 2.0
URL: https://pypi.python.org/pypi/pyvmomi
Source0: https://pypi.python.org/packages/source/p/pyvmomi/pyvmomi-%{pyvmomi_version}.tar.gz
BuildRequires: python2-devel python-setuptools
Requires: python-requests python-six
BuildArch: noarch
# This patch is needed as a temporary workaround to keep files
# from being added to /usr Upstream has accepted this patch
# but is holding off on another bug release for now
# it also makes the rpmlint warnings about scripts being
# non executable go away by removing the #! line from the
# offending files.
Patch0: setuppy.patch
%description
pyVmomi is the Python SDK for the VMware vSphere API that allows you to manage
ESX, ESXi, and vCenter.
%if 0%{?_with_python3}
%package -n python3-pyvmomi
Summary: VMware vSphere Python SDK
BuildRequires: python3-devel python3-setuptools
Requires: python3-requests python3-six
%description -n python3-pyvmomi
pyVmomi is the Python SDK for the VMware vSphere API that allows you to manage
ESX, ESXi, and vCenter.
%endif
%prep
%setup -q -n pyvmomi-%{pyvmomi_version}
# Apply temp patch
%patch0 -p1
%if 0%{?_with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # with_python3
%build
%if 0%{?_with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%{__python2} setup.py build
%install
rm -rf $RPM_BUILD_ROOT
%if 0%{?_with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
popd
%endif
%{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT
# Leaving this out until we get the vcrpy and contextdecorator deps
# packaged and added into fedora.
#%check
#%{__python2} setup.py test
#
#%if 0%{?_with_python3}
#pushd %{py3dir}
#%{__python3} setup.py test
#popd
#%endif # with_python3
%files
%defattr(-,root,root,-)
%license LICENSE.txt
%doc README.rst NOTICE.txt
%{python_sitelib}/*
%if 0%{?_with_python3}
%files -n python3-pyvmomi
%license LICENSE.txt
%doc README.rst NOTICE.txt
%{python3_sitelib}/*
%endif
%changelog
* Thu Sep 18 2014 Michael Rice <michael@michaelrice.org> - 5.5.0.2014.1.1-2
- Changes to spec from review suggestions
* Sun Aug 31 2014 Michael Rice <michael@michaelrice.org> - 5.5.0.2014.1.1-1
- Bugfix release from upstream.
* Fri Aug 22 2014 Michael Rice <michael@michaelrice.org> - 5.5.0.2014.1-2
- Changes to spec file based on bugzilla package review.
* Wed Aug 20 2014 Michael Rice <michael@michaelrice.org> - 5.5.0.2014.1-1
- Initial RPM build.