summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2019-09-18 19:12:11 -0700
committerToshio Kuratomi <a.badger@gmail.com>2019-09-18 20:37:00 -0700
commit1bb6d3c21a8bd453ca3a55bd7b8471883dd03af2 (patch)
tree15ade80ce5b0008888e0e3a8db186d0a42825509 /packaging
parent6aa02a74fe5013a02cc499cc0712e7b10d0fa9f4 (diff)
downloadansible-1bb6d3c21a8bd453ca3a55bd7b8471883dd03af2.tar.gz
[stable-2.9] Disable setting of -s in shebang
RPM builds on Fedora and RHEL create a python shebang line with -s This is not good for ansible since ansible has a lot of optional features which need extra dependencies installed. If the user installs those extra dependencies to their home directory or to /usr/local then the -s will keep them from being used. (cherry picked from commit bebb11b) Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
Diffstat (limited to 'packaging')
-rw-r--r--packaging/rpm/ansible.spec12
1 files changed, 10 insertions, 2 deletions
diff --git a/packaging/rpm/ansible.spec b/packaging/rpm/ansible.spec
index 84679d497b..cb0b155aa3 100644
--- a/packaging/rpm/ansible.spec
+++ b/packaging/rpm/ansible.spec
@@ -4,6 +4,14 @@
# ansible-test munges the shebangs itself.
%global __brp_mangle_shebangs_exclude_from /usr/lib/python[0-9]+\.[0-9]+/site-packages/ansible_test/_data/.*
+# RHEL and Fedora add -s to the shebang line. We do *not* use -s -E -S or -I
+# with ansible because it has many optional features which users need to
+# install libraries on their own to use. For instance, paramiko for the
+# network connection plugins or winrm to talk to windows hosts.
+# Set this to nil to remove -s
+%define py_shbang_opts %{nil}
+%define py2_shbang_opts %{nil}
+%define py3_shbang_opts %{nil}
%if 0%{?fedora} || 0%{?rhel} >= 8
%global with_python2 0
@@ -150,7 +158,6 @@ Requires: sshpass
%endif
-
%description
Ansible is a radically simple model-driven configuration management,
multi-node deployment, and remote task execution system. Ansible works
@@ -192,7 +199,7 @@ developed for ansible.
%build
%if %{with_python2}
-%{__python2} setup.py build
+%py2_build
%endif
%if %{with_python3}
@@ -260,6 +267,7 @@ for location in $DATADIR_LOCATIONS ; do
done
mkdir -p %{buildroot}%{_sysconfdir}/ansible/
mkdir -p %{buildroot}%{_sysconfdir}/ansible/roles/
+
cp examples/hosts %{buildroot}%{_sysconfdir}/ansible/
cp examples/ansible.cfg %{buildroot}%{_sysconfdir}/ansible/
mkdir -p %{buildroot}/%{_mandir}/man1/