diff options
author | Toshio Kuratomi <toshio@fedoraproject.org> | 2015-09-06 09:08:34 -0700 |
---|---|---|
committer | Toshio Kuratomi <toshio@fedoraproject.org> | 2015-09-06 09:08:34 -0700 |
commit | fab0e49f31067d24a9e98806ef9ed6ba221d0065 (patch) | |
tree | 944f4d11b9000111bf2d2a983e2adb10584e2616 /packaging/rpm | |
parent | 718812d94585ccfd51564f9dec151b71b3710287 (diff) | |
download | ansible-fab0e49f31067d24a9e98806ef9ed6ba221d0065.tar.gz |
Potential fix for amazon linux's rpm doing something strange with the python_sitelib macro #12166
Diffstat (limited to 'packaging/rpm')
-rw-r--r-- | packaging/rpm/ansible.spec | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packaging/rpm/ansible.spec b/packaging/rpm/ansible.spec index ddda6eeb79..cdfd413d49 100644 --- a/packaging/rpm/ansible.spec +++ b/packaging/rpm/ansible.spec @@ -93,6 +93,17 @@ are transferred to managed machines automatically. %install %{__python} setup.py install -O1 --prefix=%{_prefix} --root=%{buildroot} + +# 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 + mkdir -p %{buildroot}/etc/ansible/ cp examples/hosts %{buildroot}/etc/ansible/ cp examples/ansible.cfg %{buildroot}/etc/ansible/ |