创建Python RPM [英] Creating Python RPM
问题描述
我一直在阅读有关为Python 2.6.4创建RPM的信息.在此页面中: http://docs.python.org/distutils/builtdist.html它表示您可以使用python setup.py bdist_rpm
创建当前Python的RPM.我的问题是:
I have been reading about creating an RPM for Python 2.6.4. In this page: http://docs.python.org/distutils/builtdist.html it says you can create an RPM of the current Python using python setup.py bdist_rpm
. The question's I have are:
- 您是否必须在Python安装目录中键入此命令?
- 此命令是否会将您已安装的所有模块打包到RPM中?
- 这是执行此操作的正确命令吗?
- 还有其他建议可以使此操作更容易吗?
好吧,我使用checkinstall对此进行了整理.
Okay I sorted this out using checkinstall.
我从 http://www.asic-linux下载了checkinstall
.com.mx/〜izto/checkinstall/.
I downloaded checkinstall
from http://www.asic-linux.com.mx/~izto/checkinstall/.
然后我安装了该软件包,但必须在我的PATH中输入/usr/local/sbin/checkinstall
才能使其正常运行.然后,我进入下一个copmmand,进入我的RPM目录.
I then installed the package but had to enter /usr/local/sbin/checkinstall
into my PATH to make it work. I then entered the next copmmand to get my RPM directory going.
yum install rpm-build
然后我cd
进入Python模块并输入以下命令:
I then cd
into the Python module and entered this command:
checkinstall -R --nodoc --delspec=no --exclude=/selinux python2.6 ./setup.py install
此命令替换命令checkinstall
作为通过setup.py而不是普通make进行安装的python库.
This command replaces the command checkinstall
as your installing python libraries through setup.py instead of an ordinary make.
然后我完成了checkinstall
流程.将完成的RPM放入/usr/src/redhat/RPMS/i386/
.
I then went through the checkinstall
process. The finished RPM was placed into /usr/src/redhat/RPMS/i386/
.
注意:这是用于LINUX红帽.
Note: THIS IS FOR LINUX RED HAT.
推荐答案
- 必须在
setup.py
所在的位置键入此命令. - 它打包了将出现在
bdist
tarball中的所有内容. - Err ...有点.当它起作用时,它创建的包装质量不是很高.最好使用
sdist_rpm
,然后解压缩生成的SRPM,然后应用发行版的 Python打包指南到生成的规范文件. - 首先通过
bdist
使其正常工作.这样,任何出现的问题都将更易于管理.
- This command has to be typed wherever your
setup.py
is located. - It packages everything that would show up in a
bdist
tarball. - Err... sort of. While it works, the package it creates is not of very high quality. It's better to use
sdist_rpm
, then unpack the resulting SRPM and then apply your distro's Python packaging guidelines to the generated spec file. - Get it to work via
bdist
first. That way any issues that crop up will be more manageable.
这篇关于创建Python RPM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!