开发者

bdist_rpm from Ubuntu to CentOs

开发者 https://www.devze.com 2023-03-10 05:45 出处:网络
W开发者_运维问答e develop on Ubuntu/Macs and deploy RPMs to CentOS (this is the settings, can\'t be changed much).

W开发者_运维问答e 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?


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号