summaryrefslogtreecommitdiff
path: root/packaging/rpm
diff options
context:
space:
mode:
authorJames Tanner <tanner.jc@gmail.com>2013-12-04 15:59:01 -0500
committerJames Tanner <tanner.jc@gmail.com>2013-12-04 15:59:01 -0500
commit442221927514661b6b935a731286f615ac50b90a (patch)
tree429a227b87b346e56e6633ca1ec612945e17c90c /packaging/rpm
parent56341a22230601256683b96b1e5be9001ec89346 (diff)
parentadca81fae266810b9ec5d59f89e7727d2aaf635f (diff)
downloadansible-442221927514661b6b935a731286f615ac50b90a.tar.gz
Merge #4689 from dirtyharrycallahan/ansible
Fix ansible.spec to handle opensuse and fedora
Diffstat (limited to 'packaging/rpm')
-rw-r--r--packaging/rpm/ansible.spec73
1 files changed, 45 insertions, 28 deletions
diff --git a/packaging/rpm/ansible.spec b/packaging/rpm/ansible.spec
index f0f213ca29..e290c64700 100644
--- a/packaging/rpm/ansible.spec
+++ b/packaging/rpm/ansible.spec
@@ -1,42 +1,59 @@
+%define name ansible
+
%if 0%{?rhel} == 5
%define __python /usr/bin/python26
%endif
-%if 0%{?rhel} && 0%{?rhel} <= 5
-%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+Name: %{name}
+Version: 1.5
+Release: 1%{?dist}
+Url: http://www.ansibleworks.com
+Summary: SSH-based configuration management, deployment, and orchestration engine
+License: GPLv3
+Group: Development/Libraries
+Source: http://www.ansibleworks.com/releases/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
-%endif
-
-Name: ansible
-Release: 1%{?dist}
-Summary: SSH-based configuration management, deployment, and orchestration engine
-Version: 1.5
-
-Group: Development/Libraries
-License: GPLv3
-Source0: http://www.ansibleworks.com/releases/%{name}-%{version}.tar.gz
-Url: http://www.ansibleworks.com
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
BuildArch: noarch
+
+# RHEL <=5
%if 0%{?rhel} && 0%{?rhel} <= 5
BuildRequires: python26-devel
-
Requires: python26-PyYAML
Requires: python26-paramiko
Requires: python26-jinja2
Requires: python26-keyczar
-%else
-%if 0%{?suse_version}
-BuildRequires: python-devel
-%else
+%endif
+
+# RHEL > 5
+%if 0%{?rhel} && 0%{?rhel} > 5
BuildRequires: python2-devel
+Requires: PyYAML
+Requires: python-paramiko
+Requires: python-jinja2
+Requires: python-keyczar
%endif
+# FEDORA > 17
+%if 0%{?fedora} >= 18
+BuildRequires: python-devel
Requires: PyYAML
Requires: python-paramiko
Requires: python-jinja2
Requires: python-keyczar
%endif
+
+# SuSE/openSuSE
+%if 0%{?suse_version}
+BuildRequires: python-devel
+BuildRequires: python-setuptools
+Requires: python-paramiko
+Requires: python-jinja2
+Requires: python-keyczar
+Requires: python-yaml
+%endif
+
Requires: sshpass
%description
@@ -54,18 +71,18 @@ are transferred to managed machines automatically.
%{__python} setup.py build
%install
-%{__python} setup.py install -O1 --root=$RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT/etc/ansible/
-cp examples/hosts $RPM_BUILD_ROOT/etc/ansible/
-cp examples/ansible.cfg $RPM_BUILD_ROOT/etc/ansible/
-mkdir -p $RPM_BUILD_ROOT/%{_mandir}/{man1,man3}/
-cp -v docs/man/man1/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1/
-cp -v docs/man/man3/*.3 $RPM_BUILD_ROOT/%{_mandir}/man3/
-mkdir -p $RPM_BUILD_ROOT/%{_datadir}/ansible
-cp -rv library/* $RPM_BUILD_ROOT/%{_datadir}/ansible/
+%{__python} setup.py install -O1 --prefix=%{_prefix} --root=%{buildroot}
+mkdir -p %{buildroot}/etc/ansible/
+cp examples/hosts %{buildroot}/etc/ansible/
+cp examples/ansible.cfg %{buildroot}/etc/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 -rv library/* %{buildroot}/%{_datadir}/ansible/
%clean
-rm -rf $RPM_BUILD_ROOT
+rm -rf %{buildroot}
%files
%defattr(-,root,root)