创建 Python RPM
我一直在阅读有关为 Python 2.6.4 创建 RPM 的内容。在此页面中: http://docs.python.org/distutils/builtdist.html 它表示您可以使用 python setup.py bdist_rpm 创建当前 Python 的 RPM。我的问题是:
- 你必须在你的Python安装目录中输入这个命令吗?
- 该命令是否将您已安装的所有模块打包到 RPM 中?
- 这是执行此操作的正确命令吗?
- 还有其他建议可以让这件事变得更容易吗?
好的,我使用 checkinstall 解决了这个问题。
我从 http://www.asic 下载了 checkinstall
-linux.com.mx/~izto/checkinstall/。
然后我安装了该软件包,但必须将 /usr/local/sbin/checkinstall 输入到我的 PATH 中才能使其正常工作。然后我输入下一个命令来启动我的 RPM 目录。
yum install rpm-build
然后,我cd
进入Python模块并输入以下命令:
checkinstall -R --nodoc --delspec=no --exclude=/selinux python2.6 ./setup.py install
此命令将替换命令checkinstall
,因为您通过setup.py而不是普通的make安装Python库。
然后我经历了 checkinstall
过程。完成的 RPM 被放入 /usr/src/redhat/RPMS/i386/
中。
注意:这适用于 LINUX RED HAT。
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:
- Do you have to type this command in your Python installation directory?
- Does this command, package all the modules you have installed into the RPM?
- Is this the correct command to do this?
- Are there any other suggestion's that would make this easier?
Okay I sorted this out using checkinstall.
I downloaded checkinstall
from http://www.asic-linux.com.mx/~izto/checkinstall/.
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
I then cd
into the Python module and entered this command:
checkinstall -R --nodoc --delspec=no --exclude=/selinux python2.6 ./setup.py install
This command replaces the command checkinstall
as your installing python libraries through setup.py instead of an ordinary make.
I then went through the checkinstall
process. The finished RPM was placed into /usr/src/redhat/RPMS/i386/
.
Note: THIS IS FOR LINUX RED HAT.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
setup.py
位于何处,都必须键入此命令。bdist
tarball 中显示的所有内容。sdist_rpm
,然后解压生成的 SRPM,然后应用发行版的 Python 打包生成的规范文件的指南。bdist
让它工作。这样,出现的任何问题都会更容易管理。setup.py
is located.bdist
tarball.sdist_rpm
, then unpack the resulting SRPM and then apply your distro's Python packaging guidelines to the generated spec file.bdist
first. That way any issues that crop up will be more manageable.这些说明解释了如何为您的模块创建 RPM 包。据我所知,没有(简单)的方法可以将所有 Python 安装打包到 RPM 中。
如果您想创建 RPM 包以在较旧的发行版上安装 Python 2.6.4,请下载 Python 2.6.4 源 RPM,然后使用 rpmbuild 重建它。请参阅 Fedora RPM 指南。
These instructions explain how to create an RPM package for your module. As far as I know, there is no (easy) way to package all your Python installation into an RPM.
If you want to create an RPM package to install Python 2.6.4 on an older distro, you download the Python 2.6.4 source RPM and then rebuild it with
rpmbuild
. See Fedora RPM Guide.