3 %bcond_with tests # do not perform "make test" (they use network)
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 %define module libcloud
8 Summary: Unified Python API for cloud service providers
13 Group: Libraries/Python
14 Source0: ftp://apache.cs.utah.edu/apache.org/libcloud/apache-%{module}-%{version}.tar.bz2
15 # Source0-md5: 0270c54b3f61a60a008271d92addb7b8
16 Patch0: cacerts_path.patch
17 URL: https://libcloud.apache.org/
18 BuildRequires: rpm-pythonprov
19 BuildRequires: rpmbuild(macros) >= 1.710
20 BuildRequires: sed >= 4.0
22 BuildRequires: python-devel
23 BuildRequires: python-distribute
24 %{?with_tests:BuildRequires: python-mock}
27 BuildRequires: python3-devel
28 %{?with_tests:BuildRequires: python3-mock}
29 BuildRequires: python3-modules
31 Requires: python-modules
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 Libcloud is a Python library for interacting with many of the popular
37 cloud service providers using a unified API. It was created to make it
38 easy for developers to build products that work between any of the
39 services that it supports.
41 Resource you can manage with Libcloud are divided in the following
44 - Cloud Servers and Block Storage - services such as Amazon EC2 and
45 Rackspace CloudServers
46 - Cloud Object Storage and CDN - services such as Amazon S3 and
48 - Load Balancers as a Service - services such as Amazon Elastic Load
49 Balancer and GoGrid LoadBalancers
50 - DNS as a Service - services such as Amazon Route 53 and Zerigo
52 %package -n python3-%{module}
53 Summary: Unified Python API for cloud service providers
54 Group: Libraries/Python
56 %description -n python3-%{module}
57 Libcloud is a Python library for interacting with many of the popular
58 cloud service providers using a unified API. It was created to make it
59 easy for developers to build products that work between any of the
60 services that it supports.
62 Resource you can manage with Libcloud are divided in the following
65 - Cloud Servers and Block Storage - services such as Amazon EC2 and
66 Rackspace CloudServers
67 - Cloud Object Storage and CDN - services such as Amazon S3 and
69 - Load Balancers as a Service - services such as Amazon Elastic Load
70 Balancer and GoGrid LoadBalancers
71 - DNS as a Service - services such as Amazon Route 53 and Zerigo
74 %setup -q -n apache-%{module}-%{version}
78 cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
80 %{__sed} -i -e '1s,^#!.*python,#!%{__python},' demos/*.py example_*.py
84 %py_build %{?with_tests:test}
88 %py3_build %{?with_tests:test}
92 rm -rf $RPM_BUILD_ROOT
105 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
106 cp -a example_*.py demos $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
109 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
110 cp -a example_*.py demos $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
111 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
112 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
116 rm -rf $RPM_BUILD_ROOT
120 %defattr(644,root,root,755)
121 %doc CHANGES.rst NOTICE README.rst
122 %{py_sitescriptdir}/%{module}
123 %if "%{py_ver}" > "2.4"
124 %{py_sitescriptdir}/*.egg-info
126 %{_examplesdir}/%{name}-%{version}
130 %files -n python3-%{module}
131 %defattr(644,root,root,755)
132 %doc CHANGES.rst NOTICE README.rst
133 %{py3_sitescriptdir}/%{module}
134 %{py3_sitescriptdir}/*.egg-info
135 %{_examplesdir}/python3-%{module}-%{version}