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 BuildRequires: python3-distribute
29 %{?with_tests:BuildRequires: python3-mock}
30 BuildRequires: python3-modules
32 Requires: python-modules
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 Libcloud is a Python library for interacting with many of the popular
38 cloud service providers using a unified API. It was created to make it
39 easy for developers to build products that work between any of the
40 services that it supports.
42 Resource you can manage with Libcloud are divided in the following
45 - Cloud Servers and Block Storage - services such as Amazon EC2 and
46 Rackspace CloudServers
47 - Cloud Object Storage and CDN - services such as Amazon S3 and
49 - Load Balancers as a Service - services such as Amazon Elastic Load
50 Balancer and GoGrid LoadBalancers
51 - DNS as a Service - services such as Amazon Route 53 and Zerigo
53 %package -n python3-%{module}
54 Summary: Unified Python API for cloud service providers
55 Group: Libraries/Python
57 %description -n python3-%{module}
58 Libcloud is a Python library for interacting with many of the popular
59 cloud service providers using a unified API. It was created to make it
60 easy for developers to build products that work between any of the
61 services that it supports.
63 Resource you can manage with Libcloud are divided in the following
66 - Cloud Servers and Block Storage - services such as Amazon EC2 and
67 Rackspace CloudServers
68 - Cloud Object Storage and CDN - services such as Amazon S3 and
70 - Load Balancers as a Service - services such as Amazon Elastic Load
71 Balancer and GoGrid LoadBalancers
72 - DNS as a Service - services such as Amazon Route 53 and Zerigo
75 %setup -q -n apache-%{module}-%{version}
79 cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
81 %{__sed} -i -e '1s,^#!.*python,#!%{__python},' demos/*.py example_*.py
85 %py_build %{?with_tests:test}
89 %py3_build %{?with_tests:test}
93 rm -rf $RPM_BUILD_ROOT
106 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
107 cp -a example_*.py demos $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
110 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
111 cp -a example_*.py demos $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
112 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
113 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
117 rm -rf $RPM_BUILD_ROOT
121 %defattr(644,root,root,755)
122 %doc CHANGES.rst NOTICE README.rst
123 %{py_sitescriptdir}/%{module}
124 %if "%{py_ver}" > "2.4"
125 %{py_sitescriptdir}/*.egg-info
127 %{_examplesdir}/%{name}-%{version}
131 %files -n python3-%{module}
132 %defattr(644,root,root,755)
133 %doc CHANGES.rst NOTICE README.rst
134 %{py3_sitescriptdir}/%{module}
135 %{py3_sitescriptdir}/*.egg-info
136 %{_examplesdir}/python3-%{module}-%{version}