[英]Creating Python RPM
I have been reading about creating an RPM for Python 2.6.4. 我一直在阅读有关为Python 2.6.4创建RPM的文章。 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
. 在这个页面中: http : python setup.py bdist_rpm
它说你可以使用python setup.py bdist_rpm
创建当前Python的RPM。 The question's I have are: 我的问题是:
Okay I sorted this out using checkinstall. 好吧,我使用checkinstall对此进行了排序。
I downloaded checkinstall
from http://www.asic-linux.com.mx/~izto/checkinstall/ . 我从http://www.asic-linux.com.mx/~izto/checkinstall/下载了checkinstall
。
I then installed the package but had to enter /usr/local/sbin/checkinstall
into my PATH to make it work. 然后我安装了软件包,但必须在我的PATH中输入/usr/local/sbin/checkinstall
才能使其正常工作。 I then entered the next copmmand to get my RPM directory going. 然后我进入下一个copmmand以获取我的RPM目录。
yum install rpm-build
I then cd
into the Python module and entered this command: 然后,我cd
到Python模块,进入下面的命令:
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. 此命令将命令checkinstall
替换为通过setup.py而不是普通make安装python库。
I then went through the checkinstall
process. 然后我完成了checkinstall
过程。 The finished RPM was placed into /usr/src/redhat/RPMS/i386/
. 完成的RPM放在/usr/src/redhat/RPMS/i386/
。
Note: THIS IS FOR LINUX RED HAT. 注意:这是LINUX RED HAT。
setup.py
is located. 必须在setup.py
所在的任何位置键入此命令。 bdist
tarball. 它将打包出现在bdist
tarball中的所有内容打包。 sdist_rpm
, then unpack the resulting SRPM and then apply your distro's Python packaging guidelines to the generated spec file. 最好使用sdist_rpm
,然后解压缩生成的SRPM,然后将发行版的Python打包指南应用于生成的spec文件。 bdist
first. 首先通过bdist
让它工作。 That way any issues that crop up will be more manageable. 这样,任何突出的问题都会更易于管理。 These instructions explain how to create an RPM package for your module. 这些说明解释了如何为模块创建RPM包。 As far as I know, there is no (easy) way to package all your Python installation into an RPM. 据我所知,没有(简单)方法将所有Python安装打包到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
. 如果要创建RPM包以在较旧的发行版上安装Python 2.6.4,请下载Python 2.6.4源RPM,然后使用rpmbuild
重建它。 See Fedora RPM Guide . 请参阅Fedora RPM指南 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.