Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CentOS 7 / RHEL 7 pbench-agent installations #2248

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions agent/rpm/pbench-agent.spec.j2
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@ cp -a agent/* %{?buildroot}/%{installdir}/
if pip3 show configtools > /dev/null 2>&1 ;then pip3 uninstall -y configtools ;fi

%post
%if 0%{?rhel} == 7
# This is a very ugly work-around for RHEL 7 / CentOS 7 environments. The
# version of `pip3` that is available in those environments no longer works
# to install the latest Python3 modules, which we need. So we have to fetch
# our own copy of `pip3`, as described at:
# https://pip.pypa.io/en/latest/installing/#installing-with-get-pip-py
# We then install it separately from the existing verion and set `PATH` and
# `PYTHONPATH` so that we use this updated version when we install our module
# dependencies below.
curl -X GET -o /%{installdir}/get-pip.py https://bootstrap.pypa.io/get-pip.py > /%{installdir}/pip3-update.log 2>&1
python3 /%{installdir}/get-pip.py --prefix=/%{installdir} >> /%{installdir}/pip3-update.log 2>&1
export PYTHONPATH=/%{installdir}/lib/python3.6/site-packages:${PYTHONPATH}
export PATH=/%{installdir}/bin:${PATH}
%endif

# Install python dependencies
pip3 --no-cache-dir install --prefix=/%{installdir} -r /%{installdir}/requirements.txt > /%{installdir}/pip3-install.log

Expand Down