bdist_rpm from Ubuntu to CentOs

穿精又带淫゛_ 提交于 2019-12-22 05:33:40

问题


We develop on Ubuntu/Macs and deploy RPMs to CentOS (this is the settings, can't be changed much).

The problem is that when installing from the rpm, the packages go to /usr/local/lib/python2.7/dist-packages (which is the right location for Ubuntu). However the default python path in CentOS is looking at /usr/local/lib/python2.7/site-packages.

Is there a way to tell bdist_rpm where to install the files to?


回答1:


You can use a setup.cfg file to override the Python lib install path:

setup.cfg:

[install]
install-lib=/usr/local/lib/python2.7/site-packages

Example:

% python setup.py bdist_rpm
% rpm -qpl dist/foo-0.0.0-1.noarch.rpm | grep foo

/usr/local/lib/python2.7/site-packages/foo/__init__.py
/usr/local/lib/python2.7/site-packages/foo/__init__.pyc


来源:https://stackoverflow.com/questions/6220315/bdist-rpm-from-ubuntu-to-centos

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!