Since RHEL comes with python 2.6, I use chef to install python 2.7 under /usr/local/bin (pretty standard stuff).

Up until now we were deploying a django app with fabric and a remote git pull call. I'm trying to install it via an RPM which is a bit cleaner IMO.

python setup.py bdist_rpm
/build/SPECS/App.spec
%install
python setup.py install --single-version-externally-managed -O1 - root=$RPM_BUILD_ROOT --record=INSTALLED_FILES

Is there any way I can change the setup.py file so that the SPEC is generated as

%install
/usr/local/bin/python2.7 setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES