2013-10-27 18:07:18 +01:00
|
|
|
%define name ansible
|
2018-05-22 01:14:53 +02:00
|
|
|
%define release_date %(date "+%a %b %e %Y")
|
2013-10-27 18:07:18 +01:00
|
|
|
|
2013-07-23 19:45:08 +02:00
|
|
|
%if 0%{?rhel} == 5
|
2017-10-16 15:19:53 +02:00
|
|
|
%define __python2 /usr/bin/python26
|
2013-07-23 19:45:08 +02:00
|
|
|
%endif
|
|
|
|
|
2013-10-27 18:07:18 +01:00
|
|
|
Name: %{name}
|
2018-05-22 01:14:53 +02:00
|
|
|
Version: %{rpmversion}
|
|
|
|
Release: %{rpmrelease}%{?dist}%{?repotag}
|
2017-02-16 01:09:33 +01:00
|
|
|
Url: https://www.ansible.com
|
2014-01-28 17:38:52 +01:00
|
|
|
Summary: SSH-based application deployment, configuration management, and IT orchestration platform
|
2017-08-03 21:35:37 +02:00
|
|
|
License: GPLv3+
|
2013-10-27 18:07:18 +01:00
|
|
|
Group: Development/Libraries
|
2018-05-22 01:14:53 +02:00
|
|
|
Source: https://releases.ansible.com/ansible/%{name}-%{upstream_version}.tar.gz
|
2012-04-13 22:27:56 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
2017-10-16 15:19:53 +02:00
|
|
|
%{!?__python2: %global __python2 /usr/bin/python2.6}
|
2017-08-03 21:35:37 +02:00
|
|
|
%{!?python_sitelib: %global python_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
|
2012-03-10 20:02:25 +01:00
|
|
|
|
2012-03-05 18:15:24 +01:00
|
|
|
BuildArch: noarch
|
2013-10-27 18:07:18 +01:00
|
|
|
|
|
|
|
# RHEL <=5
|
2013-04-27 20:33:17 +02:00
|
|
|
%if 0%{?rhel} && 0%{?rhel} <= 5
|
2013-03-11 16:22:37 +01:00
|
|
|
BuildRequires: python26-devel
|
2014-04-30 15:02:40 +02:00
|
|
|
BuildRequires: python26-setuptools
|
2013-03-11 16:22:37 +01:00
|
|
|
Requires: python26-PyYAML
|
|
|
|
Requires: python26-paramiko
|
|
|
|
Requires: python26-jinja2
|
2013-12-19 02:15:37 +01:00
|
|
|
Requires: python26-httplib2
|
2014-04-02 22:37:16 +02:00
|
|
|
Requires: python26-setuptools
|
2015-06-02 20:43:35 +02:00
|
|
|
Requires: python26-six
|
2014-04-02 22:37:16 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
# RHEL == 6
|
|
|
|
%if 0%{?rhel} == 6
|
2017-08-03 21:35:37 +02:00
|
|
|
Requires: python-crypto
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# RHEL >=7
|
|
|
|
%if 0%{?rhel} >= 7
|
|
|
|
Requires: python2-cryptography
|
2013-10-27 18:07:18 +01:00
|
|
|
%endif
|
|
|
|
|
|
|
|
# RHEL > 5
|
|
|
|
%if 0%{?rhel} && 0%{?rhel} > 5
|
2012-04-13 22:27:56 +02:00
|
|
|
BuildRequires: python2-devel
|
2014-04-30 15:02:40 +02:00
|
|
|
BuildRequires: python-setuptools
|
2013-12-04 21:59:01 +01:00
|
|
|
Requires: PyYAML
|
|
|
|
Requires: python-paramiko
|
|
|
|
Requires: python-jinja2
|
2014-04-02 22:37:16 +02:00
|
|
|
Requires: python-setuptools
|
2015-06-02 20:43:35 +02:00
|
|
|
Requires: python-six
|
2013-11-21 01:02:48 +01:00
|
|
|
%endif
|
2012-03-10 20:02:25 +01:00
|
|
|
|
2013-12-04 21:59:01 +01:00
|
|
|
# FEDORA > 17
|
|
|
|
%if 0%{?fedora} >= 18
|
|
|
|
BuildRequires: python-devel
|
2014-04-30 15:02:40 +02:00
|
|
|
BuildRequires: python-setuptools
|
2012-04-19 06:14:37 +02:00
|
|
|
Requires: PyYAML
|
2012-03-05 18:16:08 +01:00
|
|
|
Requires: python-paramiko
|
2012-03-06 02:09:03 +01:00
|
|
|
Requires: python-jinja2
|
2013-12-19 02:15:37 +01:00
|
|
|
Requires: python-httplib2
|
2014-04-02 22:37:16 +02:00
|
|
|
Requires: python-setuptools
|
2015-06-02 20:43:35 +02:00
|
|
|
Requires: python-six
|
2013-03-11 16:22:37 +01:00
|
|
|
%endif
|
2013-10-27 18:07:18 +01:00
|
|
|
|
|
|
|
# SuSE/openSuSE
|
2017-08-03 21:35:37 +02:00
|
|
|
%if 0%{?suse_version}
|
2013-10-27 18:07:18 +01:00
|
|
|
BuildRequires: python-devel
|
|
|
|
BuildRequires: python-setuptools
|
|
|
|
Requires: python-paramiko
|
|
|
|
Requires: python-jinja2
|
|
|
|
Requires: python-yaml
|
2013-12-19 02:15:37 +01:00
|
|
|
Requires: python-httplib2
|
2014-04-02 22:37:16 +02:00
|
|
|
Requires: python-setuptools
|
2015-06-02 20:43:35 +02:00
|
|
|
Requires: python-six
|
2013-10-27 18:07:18 +01:00
|
|
|
%endif
|
|
|
|
|
2013-09-14 00:39:14 +02:00
|
|
|
Requires: sshpass
|
2012-03-05 18:15:24 +01:00
|
|
|
|
|
|
|
%description
|
2012-04-17 16:31:29 +02:00
|
|
|
|
|
|
|
Ansible is a radically simple model-driven configuration management,
|
2013-06-10 21:23:51 +02:00
|
|
|
multi-node deployment, and orchestration engine. Ansible works
|
2012-04-17 16:31:29 +02:00
|
|
|
over SSH and does not require any software or daemons to be installed
|
|
|
|
on remote nodes. Extension modules can be written in any language and
|
|
|
|
are transferred to managed machines automatically.
|
|
|
|
|
2012-03-05 18:15:24 +01:00
|
|
|
%prep
|
2018-05-22 01:14:53 +02:00
|
|
|
%setup -q -n %{name}-%{upstream_version}
|
2012-03-05 18:15:24 +01:00
|
|
|
|
|
|
|
%build
|
2017-08-03 21:35:37 +02:00
|
|
|
%{__python2} setup.py build
|
2012-03-05 18:15:24 +01:00
|
|
|
|
|
|
|
%install
|
2017-08-03 21:35:37 +02:00
|
|
|
%{__python2} setup.py install --root=%{buildroot}
|
|
|
|
|
|
|
|
for i in %{buildroot}/%{_bindir}/{ansible,ansible-console,ansible-doc,ansible-galaxy,ansible-playbook,ansible-pull,ansible-vault}; do
|
|
|
|
mv $i $i-%{python2_version}
|
|
|
|
ln -s %{_bindir}/$(basename $i)-%{python2_version} $i
|
|
|
|
ln -s %{_bindir}/$(basename $i)-%{python2_version} $i-2
|
|
|
|
done
|
2015-09-06 18:08:34 +02:00
|
|
|
|
|
|
|
# Amazon Linux doesn't install to dist-packages but python_sitelib expands to
|
|
|
|
# that location and the python interpreter expects things to be there.
|
|
|
|
if expr x'%{python_sitelib}' : 'x.*dist-packages/\?' ; then
|
|
|
|
DEST_DIR='%{buildroot}%{python_sitelib}'
|
|
|
|
SOURCE_DIR=$(echo "$DEST_DIR" | sed 's/dist-packages/site-packages/g')
|
|
|
|
if test -d "$SOURCE_DIR" -a ! -d "$DEST_DIR" ; then
|
|
|
|
mv $SOURCE_DIR $DEST_DIR
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2013-10-27 18:07:18 +01:00
|
|
|
mkdir -p %{buildroot}/etc/ansible/
|
2017-08-03 21:35:37 +02:00
|
|
|
mkdir -p %{buildroot}/etc/ansible/roles/
|
2013-10-27 18:07:18 +01:00
|
|
|
cp examples/hosts %{buildroot}/etc/ansible/
|
|
|
|
cp examples/ansible.cfg %{buildroot}/etc/ansible/
|
2014-01-03 17:00:11 +01:00
|
|
|
mkdir -p %{buildroot}/%{_mandir}/man1/
|
2013-10-27 18:07:18 +01:00
|
|
|
cp -v docs/man/man1/*.1 %{buildroot}/%{_mandir}/man1/
|
|
|
|
mkdir -p %{buildroot}/%{_datadir}/ansible
|
2012-03-05 18:15:24 +01:00
|
|
|
|
|
|
|
%clean
|
2013-10-27 18:07:18 +01:00
|
|
|
rm -rf %{buildroot}
|
2012-03-05 18:15:24 +01:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2012-04-13 22:27:56 +02:00
|
|
|
%{python_sitelib}/ansible*
|
2012-03-05 18:15:24 +01:00
|
|
|
%{_bindir}/ansible*
|
2012-11-04 14:37:38 +01:00
|
|
|
%dir %{_datadir}/ansible
|
2012-04-16 20:11:57 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/ansible
|
2018-05-31 01:47:48 +02:00
|
|
|
%doc README.rst PKG-INFO COPYING changelogs/CHANGELOG*.rst
|
2012-04-13 22:27:56 +02:00
|
|
|
%doc %{_mandir}/man1/ansible*
|
2012-11-04 14:37:38 +01:00
|
|
|
|
2012-03-05 18:15:24 +01:00
|
|
|
%changelog
|
2013-02-02 03:38:21 +01:00
|
|
|
|
2018-05-22 01:14:53 +02:00
|
|
|
* %{release_date} Ansible, Inc. <info@ansible.com> - %{rpmversion}-%{rpmrelease}
|
|
|
|
- Release %{rpmversion}-%{rpmrelease}
|