ansible/ansible.spec
2013-04-18 08:00:25 +00:00

167 lines
4.6 KiB
RPMSpec

#
# spec file for package ansible
#
# Copyright 2013 by Lars Vogdt
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
Name: ansible
Version: 1.1
Release: 1
Summary: SSH-based configuration management, deployment, and task execution system
License: GPL-3.0+
Url: http://ansible.github.com
Group: System/Management
Source0: %{name}-%{version}.tar.bz2
Source1: %{name}-rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#
# (open)SUSE
#
%if 0%{?suse_version}
BuildRequires: python-devel
Requires: python-PyYAML
Requires: python-jinja2
%if 0%{?suse_version} > 01020
BuildRequires: fdupes
Recommends: python-paramiko
%else
Requires: python-paramiko
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%endif
#
# RHEL
#
%if ( 0%{?rhel} && 0%{?rhel} <= 5 ) || ( 0%{?rhel_version} && 0%{?rhel_version} <= 505 )
Release: 1%{?dist}
BuildRequires: python26-devel
Requires: python26-PyYAML
Requires: python26-paramiko
Requires: python26-jinja2
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%endif
#
# Fedora
#
%if 0%{?fedora}
Release: 1%{?dist}
BuildRequires: python2-devel
Requires: PyYAML
Requires: python-paramiko
Requires: python-jinja2
%endif
%description
Ansible is a radically simple model-driven configuration management,
multi-node deployment, and remote task execution system. Ansible works
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.
%package fireball
Summary: Ansible fireball transport support
Group: System/Management
Requires: %{name} = %{version}
#
# RHEL
#
%if ( 0%{?rhel} && 0%{?rhel} <= 5 ) || ( 0%{?rhel_version} && 0%{?rhel_version} <= 505 )
Requires: python26-keyczar
Requires: python26-zmq
#
# (open)SUSE | Fedora
#
%else
Requires: python-keyczar
Requires: python-zmq
%endif
%description fireball
Ansible can optionally use a 0MQ based transport mechanism, which is
considerably faster than the standard ssh mechanism when there are
multiple actions, but requires additional supporting packages.
%package node-fireball
Summary: Ansible fireball transport - node end support
Group: System/Management
#
# RHEL
#
%if ( 0%{?rhel} && 0%{?rhel} <= 5 ) || ( 0%{?rhel_version} && 0%{?rhel_version} <= 505 )
Requires: python26-keyczar
Requires: python26-zmq
#
# (open)SUSE | Fedora
#
%else
Requires: python-keyczar
Requires: python-pyzmq
%endif
%description node-fireball
Ansible can optionally use a 0MQ based transport mechanism, which has
additional requirements for nodes to use. This package includes those
requirements.
%prep
%setup -q
%build
%{__python} setup.py build
%install
%{__python} setup.py install -O1 --prefix=%{_prefix} --root=%{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}/ansible/
cp examples/hosts %{buildroot}%{_sysconfdir}/ansible/
cp examples/ansible.cfg %{buildroot}%{_sysconfdir}/ansible/
mkdir -p %{buildroot}%{_mandir}/{man1,man3}/
cp -v docs/man/man1/*.1 %{buildroot}%{_mandir}/man1/
cp -v docs/man/man3/*.3 %{buildroot}%{_mandir}/man3/
mkdir -p %{buildroot}%{_datadir}/ansible
cp -v library/* %{buildroot}%{_datadir}/ansible/
%if 0%{?suse_version} > 01020
%fdupes %{buildroot}
%endif
%files
%defattr(-,root,root,-)
%doc README.md PKG-INFO COPYING
%doc examples/playbooks
%doc %{_mandir}/man1/ansible*
%doc %{_mandir}/man3/ansible*
%dir %{_datadir}/ansible
%dir %{_sysconfdir}/%{name}
%{python_sitelib}/ansible*
%{_bindir}/ansible*
%config(noreplace) %{_sysconfdir}/ansible
%{_datadir}/ansible/*
%exclude %{_datadir}/ansible/fireball
%exclude %{_mandir}/man3/ansible.fireball.*
%files fireball
%defattr(-,root,root,-)
%{_datadir}/ansible/fireball
%doc %{_mandir}/man3/ansible.fireball.*
%files node-fireball
%defattr(-,root,root,-)
%doc README.md PKG-INFO COPYING
%changelog