]> git.pld-linux.org Git - packages/python-libcloud.git/blame - python-libcloud.spec
- drop python3-distribute deps
[packages/python-libcloud.git] / python-libcloud.spec
CommitLineData
bee57211
JK
1#
2# Conditional build:
6dc6d653 3%bcond_with tests # do not perform "make test" (they use network)
bee57211
JK
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
6
7%define module libcloud
8Summary: Unified Python API for cloud service providers
9Name: python-%{module}
10Version: 0.14.1
11Release: 1
12License: Apache v2.0
13Group: Libraries/Python
14Source0: ftp://apache.cs.utah.edu/apache.org/libcloud/apache-%{module}-%{version}.tar.bz2
15# Source0-md5: 0270c54b3f61a60a008271d92addb7b8
16Patch0: cacerts_path.patch
17URL: https://libcloud.apache.org/
18BuildRequires: rpm-pythonprov
19247e7d 19BuildRequires: rpmbuild(macros) >= 1.710
bee57211
JK
20BuildRequires: sed >= 4.0
21%if %{with python2}
22BuildRequires: python-devel
23BuildRequires: python-distribute
24%{?with_tests:BuildRequires: python-mock}
25%endif
26%if %{with python3}
27BuildRequires: python3-devel
bee57211
JK
28%{?with_tests:BuildRequires: python3-mock}
29BuildRequires: python3-modules
30%endif
31Requires: python-modules
32BuildArch: noarch
33BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35%description
36Libcloud is a Python library for interacting with many of the popular
37cloud service providers using a unified API. It was created to make it
38easy for developers to build products that work between any of the
39services that it supports.
40
41Resource you can manage with Libcloud are divided in the following
42categories:
43
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
47 Rackspace CloudFiles
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
51
52%package -n python3-%{module}
53Summary: Unified Python API for cloud service providers
54Group: Libraries/Python
55
56%description -n python3-%{module}
57Libcloud is a Python library for interacting with many of the popular
58cloud service providers using a unified API. It was created to make it
59easy for developers to build products that work between any of the
60services that it supports.
61
62Resource you can manage with Libcloud are divided in the following
63categories:
64
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
68 Rackspace CloudFiles
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
72
73%prep
74%setup -q -n apache-%{module}-%{version}
75
76%patch0 -p1
77
78cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
79
80%{__sed} -i -e '1s,^#!.*python,#!%{__python},' demos/*.py example_*.py
81
82%build
83%if %{with python2}
3aa3cea4 84%py_build %{?with_tests:test}
bee57211
JK
85%endif
86
87%if %{with python3}
3aa3cea4 88%py3_build %{?with_tests:test}
bee57211
JK
89%endif
90
91%install
92rm -rf $RPM_BUILD_ROOT
93
94%if %{with python2}
3aa3cea4 95%py_install
bee57211
JK
96
97%py_postclean
98%endif
99
100%if %{with python3}
3aa3cea4 101%py3_install
bee57211
JK
102%endif
103
104%if %{with python2}
105install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
106cp -a example_*.py demos $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
107%endif
108%if %{with python3}
109install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
110cp -a example_*.py demos $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
111find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
112 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
113%endif
114
115%clean
116rm -rf $RPM_BUILD_ROOT
117
118%if %{with python2}
119%files
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
125%endif
126%{_examplesdir}/%{name}-%{version}
127%endif
128
129%if %{with python3}
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}
136%endif
This page took 0.125573 seconds and 4 git commands to generate.