]> git.pld-linux.org Git - packages/python-libcloud.git/blame - python-libcloud.spec
Disable tests by default
[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
19BuildRequires: rpmbuild(macros) >= 1.219
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
28BuildRequires: python3-distribute
29%{?with_tests:BuildRequires: python3-mock}
30BuildRequires: python3-modules
31%endif
32Requires: python-modules
33BuildArch: noarch
34BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36%description
37Libcloud is a Python library for interacting with many of the popular
38cloud service providers using a unified API. It was created to make it
39easy for developers to build products that work between any of the
40services that it supports.
41
42Resource you can manage with Libcloud are divided in the following
43categories:
44
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
48 Rackspace CloudFiles
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
52
53%package -n python3-%{module}
54Summary: Unified Python API for cloud service providers
55Group: Libraries/Python
56
57%description -n python3-%{module}
58Libcloud is a Python library for interacting with many of the popular
59cloud service providers using a unified API. It was created to make it
60easy for developers to build products that work between any of the
61services that it supports.
62
63Resource you can manage with Libcloud are divided in the following
64categories:
65
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
69 Rackspace CloudFiles
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
73
74%prep
75%setup -q -n apache-%{module}-%{version}
76
77%patch0 -p1
78
79cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
80
81%{__sed} -i -e '1s,^#!.*python,#!%{__python},' demos/*.py example_*.py
82
83%build
84%if %{with python2}
85%{__python} setup.py build --build-base build-2 %{?with_tests:test}
86%endif
87
88%if %{with python3}
89%{__python3} setup.py build --build-base build-3 %{?with_tests:test}
90%endif
91
92%install
93rm -rf $RPM_BUILD_ROOT
94
95%if %{with python2}
96%{__python} setup.py \
97 build --build-base build-2 \
98 install --skip-build \
99 --optimize=2 \
100 --root=$RPM_BUILD_ROOT
101
102%py_postclean
103%endif
104
105%if %{with python3}
106%{__python3} setup.py \
107 build --build-base build-3 \
108 install --skip-build \
109 --optimize=2 \
110 --root=$RPM_BUILD_ROOT
111%endif
112
113%if %{with python2}
114install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
115cp -a example_*.py demos $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
116%endif
117%if %{with python3}
118install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
119cp -a example_*.py demos $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
120find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
121 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
122%endif
123
124%clean
125rm -rf $RPM_BUILD_ROOT
126
127%if %{with python2}
128%files
129%defattr(644,root,root,755)
130%doc CHANGES.rst NOTICE README.rst
131%{py_sitescriptdir}/%{module}
132%if "%{py_ver}" > "2.4"
133%{py_sitescriptdir}/*.egg-info
134%endif
135%{_examplesdir}/%{name}-%{version}
136%endif
137
138%if %{with python3}
139%files -n python3-%{module}
140%defattr(644,root,root,755)
141%doc CHANGES.rst NOTICE README.rst
142%{py3_sitescriptdir}/%{module}
143%{py3_sitescriptdir}/*.egg-info
144%{_examplesdir}/python3-%{module}-%{version}
145%endif
This page took 0.071139 seconds and 4 git commands to generate.