125 lines
4.1 KiB
RPMSpec
125 lines
4.1 KiB
RPMSpec
%if 0%{?rhel}
|
|
%global with_python3 0
|
|
%{!?__python2: %global __python2 /usr/bin/python2}
|
|
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
|
|
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
|
|
%else
|
|
%global with_python3 1
|
|
%endif
|
|
|
|
Name: awscli
|
|
Version: 1.9.16
|
|
Release: 1%{?dist}
|
|
Summary: Universal Command Line Environment for AWS
|
|
|
|
License: ASL 2.0 and MIT
|
|
URL: http://aws.amazon.com/cli
|
|
Source0: https://pypi.python.org/packages/source/a/%{name}/%{name}-%{version}.tar.gz
|
|
BuildArch: noarch
|
|
%if 0%{?with_python3}
|
|
BuildRequires: python3-devel
|
|
BuildRequires: python3-setuptools
|
|
Requires: python3-botocore
|
|
Requires: python3-bcdoc
|
|
Requires: python3-colorama
|
|
Requires: python3-docutils
|
|
Requires: python3-rsa
|
|
%else
|
|
BuildRequires: python2-devel
|
|
BuildRequires: python-setuptools
|
|
Requires: python2-botocore
|
|
Requires: python-bcdoc
|
|
Requires: python-colorama
|
|
Requires: python-docutils
|
|
Requires: python-rsa
|
|
%endif # with_python3
|
|
%if 0%{?fedora}
|
|
Recommends: bash-completion
|
|
Recommends: zsh
|
|
%endif # Fedora
|
|
|
|
%if 0%{?with_python3}
|
|
%{?python_provide:%python_provide python3-%{name}}
|
|
%else
|
|
%{?python_provide:%python_provide python2-%{name}}
|
|
%endif # with_python3
|
|
|
|
%description
|
|
This package provides a unified
|
|
command line interface to Amazon Web Services.
|
|
|
|
%prep
|
|
%setup -q -n %{name}-%{version}
|
|
rm -rf %{name}.egg-info
|
|
# Proposed upstream fix at https://github.com/aws/aws-cli/pull/1710
|
|
chmod 664 awscli/examples/*/*.rst
|
|
# Substitue the text of bin/aws_bash_completer as of https://github.com/aws/aws-cli/pull/1711
|
|
echo 'complete -C aws_completer aws' > bin/aws_bash_completer
|
|
# Non-executable file should not contain shabang as for https://github.com/aws/aws-cli/pull/1712
|
|
sed -i -e '1 d' awscli/paramfile.py
|
|
|
|
%build
|
|
%if 0%{?with_python3}
|
|
%py3_build
|
|
%else
|
|
CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s"
|
|
%endif # with_python3
|
|
|
|
|
|
%install
|
|
%if 0%{?with_python3}
|
|
%py3_install
|
|
%else
|
|
CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}
|
|
%endif # with_python3
|
|
# Fix path and permissions for bash completition
|
|
%global bash_completion_dir /usr/share/bash-completion/completions
|
|
mkdir -p %{buildroot}%{bash_completion_dir}
|
|
mv %{buildroot}%{_bindir}/aws_bash_completer %{buildroot}%{bash_completion_dir}
|
|
chmod 644 %{buildroot}%{bash_completion_dir}/aws_bash_completer
|
|
# Fix path and permissions for zsh completition
|
|
%global zsh_completion_dir /usr/share/zsh/site-functions
|
|
mkdir -p %{buildroot}%{zsh_completion_dir}
|
|
mv %{buildroot}%{_bindir}/aws_zsh_completer.sh %{buildroot}%{zsh_completion_dir}
|
|
chmod 644 %{buildroot}%{zsh_completion_dir}/aws_zsh_completer.sh
|
|
ls -alh %{buildroot}%{zsh_completion_dir}/aws_zsh_completer.sh
|
|
# We don't need the Windows CMD script
|
|
rm %{buildroot}%{_bindir}/aws.cmd
|
|
|
|
%files
|
|
%{!?_licensedir:%global license %doc}
|
|
%doc README.rst
|
|
%license LICENSE.txt
|
|
%{_bindir}/aws
|
|
%{_bindir}/aws_completer
|
|
%dir %{bash_completion_dir}
|
|
%{bash_completion_dir}/aws_bash_completer
|
|
%dir %{zsh_completion_dir}
|
|
%{zsh_completion_dir}/aws_zsh_completer.sh
|
|
%if 0%{?with_python3}
|
|
%{python3_sitelib}/awscli
|
|
%{python3_sitelib}/%{name}-%{version}-py?.?.egg-info
|
|
%else
|
|
%{python2_sitelib}/awscli
|
|
%{python2_sitelib}/%{name}-%{version}-py?.?.egg-info
|
|
%endif # with_python3
|
|
|
|
%changelog
|
|
* Sat Jan 09 2016 Fabio Alessandro Locati <fabio@locati.cc> - 1.9.16-1
|
|
- Update to current upstream version
|
|
- Add dir /usr/share/zsh
|
|
- Add dir /usr/share/zsh/site-functions
|
|
- Add MIT license (topictags.py is MIT licensed)
|
|
- Move dependency from python-devel to python2-devel
|
|
- Add Recommends lines for zsh and bsah-completion for Fedora
|
|
- Remove BuildReuires: bash-completion
|
|
- Remove the macros py2_build and py2_install to prefer the extended form
|
|
- Force non-executable bit for documentation
|
|
- Remove shabang from awscli/paramfile.py
|
|
- Fix bash completion
|
|
- Fix zsh completion
|
|
- Remove aws.cmd
|
|
|
|
* Tue Dec 29 2015 Fabio Alessandro Locati <fabio@locati.cc> - 1.9.15-1
|
|
- Initial package.
|