From bebb11b918f8ada9cb43e105b660d29bf85d8d82 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 18 Sep 2019 19:12:11 -0700 Subject: [PATCH] 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. --- packaging/rpm/ansible.spec | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packaging/rpm/ansible.spec b/packaging/rpm/ansible.spec index 84679d497b3..cb0b155aa3c 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/