bdist_rpm从Ubuntu到CentOs [英] bdist_rpm from Ubuntu to CentOs
问题描述
我们在Ubuntu / Mac上进行开发,并将RPM部署到CentOS(这是设置,不能做太多更改。)。
We develop on Ubuntu/Macs and deploy RPMs to CentOS (this is the settings, can't be changed much).
问题在于,从rpm时,软件包将转到 /usr/local/lib/python2.7/dist-packages
(在Ubuntu上是正确的位置)。但是CentOS中的默认python路径在 /usr/local/lib/python2.7/site-packages
中。
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
.
是否可以告诉bdist_rpm文件安装位置?
Is there a way to tell bdist_rpm where to install the files to?
推荐答案
您可以使用 setup.cfg
文件覆盖Python lib安装路径:
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
示例:
% 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
这篇关于bdist_rpm从Ubuntu到CentOs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!