]> git.pld-linux.org Git - SPECS.git/blob - python-libcloud.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / python-libcloud.spec
1 #
2 # Conditional build:
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
6
7 %define         module  libcloud
8 Summary:        Unified Python API for cloud service providers
9 Name:           python-%{module}
10 Version:        0.14.1
11 Release:        1
12 License:        Apache v2.0
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
21 %if %{with python2}
22 BuildRequires:  python-devel
23 BuildRequires:  python-distribute
24 %{?with_tests:BuildRequires:    python-mock}
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-devel
28 BuildRequires:  python3-distribute
29 %{?with_tests:BuildRequires:    python3-mock}
30 BuildRequires:  python3-modules
31 %endif
32 Requires:       python-modules
33 BuildArch:      noarch
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %description
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.
41
42 Resource you can manage with Libcloud are divided in the following
43 categories:
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}
54 Summary:        Unified Python API for cloud service providers
55 Group:          Libraries/Python
56
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.
62
63 Resource you can manage with Libcloud are divided in the following
64 categories:
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
79 cp 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 %py_build %{?with_tests:test}
86 %endif
87
88 %if %{with python3}
89 %py3_build %{?with_tests:test}
90 %endif
91
92 %install
93 rm -rf $RPM_BUILD_ROOT
94
95 %if %{with python2}
96 %py_install
97
98 %py_postclean
99 %endif
100
101 %if %{with python3}
102 %py3_install
103 %endif
104
105 %if %{with python2}
106 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
107 cp -a example_*.py demos $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
108 %endif
109 %if %{with python3}
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}|'
114 %endif
115
116 %clean
117 rm -rf $RPM_BUILD_ROOT
118
119 %if %{with python2}
120 %files
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
126 %endif
127 %{_examplesdir}/%{name}-%{version}
128 %endif
129
130 %if %{with python3}
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}
137 %endif
This page took 0.182145 seconds and 3 git commands to generate.