]>
Commit | Line | Data |
---|---|---|
9611de34 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
6 | %define module awscli | |
7 | %define egg_name awscli | |
8 | %define pypi_name awscli | |
9 | Summary: Universal Command Line Environment for AWS | |
10 | Name: awscli | |
11 | Version: 1.15.2 | |
12 | Release: 1 | |
13 | License: ASL 2.0 and MIT | |
14 | Group: Applications/Networking | |
15 | Source0: https://pypi.io/packages/source/a/awscli/%{name}-%{version}.tar.gz | |
16 | # Source0-md5: 8800e388fd08a96a7b1f2ab478551bc6 | |
17 | URL: http://aws.amazon.com/cli | |
18 | BuildRequires: rpm-pythonprov | |
19 | BuildRequires: rpmbuild(macros) >= 1.719 | |
20 | %if %{with python2} | |
21 | BuildRequires: python3-modules | |
22 | BuildRequires: python3-setuptools | |
23 | %endif | |
24 | %if %{with python3} | |
25 | BuildRequires: python-modules | |
26 | BuildRequires: python-setuptools | |
27 | %endif | |
28 | BuildArch: noarch | |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | This package provides a unified command line interface to Amazon Web | |
33 | Services. | |
34 | ||
35 | %package -n python-%{pypi_name} | |
36 | Summary: Python 2 package for awscli | |
37 | Group: Libraries/Python | |
38 | Requires: python-PyYAML >= 3.10 | |
39 | Requires: python-botocore = 1.9.1 | |
40 | Requires: python-colorama >= 0.2.5 | |
41 | Requires: python-docutils >= 0.10 | |
42 | Requires: python-modules | |
43 | Requires: python-rsa >= 3.1.2 | |
44 | Requires: python-s3transfer >= 0.1.9 | |
45 | ||
46 | %description -n python-%{pypi_name} | |
47 | Python 2 package for awscli. | |
48 | ||
49 | %package -n python3-%{pypi_name} | |
50 | Summary: Python 3 package for awscli | |
51 | Group: Libraries/Python | |
52 | Requires: python3-PyYAML >= 3.10 | |
53 | Requires: python3-botocore = 1.9.1 | |
54 | Requires: python3-colorama >= 0.2.5 | |
55 | Requires: python3-docutils >= 0.10 | |
56 | Requires: python3-modules | |
57 | Requires: python3-rsa >= 3.1.2 | |
58 | Requires: python3-s3transfer >= 0.1.9 | |
59 | ||
60 | %description -n python3-%{pypi_name} | |
61 | Python 3 package for awscli. | |
62 | ||
63 | %prep | |
64 | %setup -q | |
65 | ||
66 | rm -r %{name}.egg-info | |
67 | ||
68 | %build | |
69 | %if %{with python3} | |
70 | %py_build | |
71 | %endif | |
72 | %if %{with python3} | |
73 | %py3_build | |
74 | %endif | |
75 | ||
76 | %install | |
77 | rm -rf $RPM_BUILD_ROOT | |
78 | %if %{with python2} | |
79 | %py_install | |
80 | %py_postclean | |
81 | %endif | |
82 | %if %{with python3} | |
83 | %py3_install | |
84 | %endif | |
85 | ||
86 | # We don't need the Windows CMD script | |
87 | rm $RPM_BUILD_ROOT%{_bindir}/aws.cmd | |
88 | ||
89 | # Fix path and permissions for bash completition | |
90 | install -d $RPM_BUILD_ROOT%{bash_compdir} | |
91 | mv $RPM_BUILD_ROOT%{_bindir}/aws_bash_completer $RPM_BUILD_ROOT%{bash_compdir} | |
92 | # Fix path and permissions for zsh completition | |
93 | install -d $RPM_BUILD_ROOT%{zsh_compdir} | |
94 | mv $RPM_BUILD_ROOT%{_bindir}/aws_zsh_completer.sh $RPM_BUILD_ROOT%{zsh_compdir} | |
95 | ||
96 | %clean | |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | ||
99 | %files | |
100 | %defattr(644,root,root,755) | |
101 | %doc README.rst LICENSE.txt | |
102 | %attr(755,root,root) %{_bindir}/aws | |
103 | %attr(755,root,root) %{_bindir}/aws_completer | |
104 | %{bash_compdir}/aws_bash_completer | |
105 | %{zsh_compdir}/aws_zsh_completer.sh | |
106 | ||
107 | %if %{with python2} | |
108 | %files -n python-%{pypi_name} | |
109 | %defattr(644,root,root,755) | |
110 | %{py_sitescriptdir}/%{module} | |
111 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
112 | %endif | |
113 | ||
114 | %if %{with python3} | |
115 | %files -n python3-%{pypi_name} | |
116 | %defattr(644,root,root,755) | |
117 | %{py3_sitescriptdir}/%{module} | |
118 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
119 | %endif |