解压 RPM 文件并重新打包
我有一个 RPM 文件。我必须对该 RPM 进行一些更改,重新打包并测试。有人可以帮助我吗?
I have a RPM file. I have to make some changes to that RPM , repack it and Test. Can anyone help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
修改没有源代码的 RPM 的最佳方法是按照以下步骤操作:
该虚拟规格文件可能如下所示:
将此处的每个“blah”替换为实际值(使用 rpm -qpi rpm file 获取值)。将 BuildRoot 替换为已解开修改后的 rpm 的目录。然后运行 rpmbuild -bb dummy.spec 。
由于没有定义准备/设置/构建/安装步骤,因此它只会采用 buildroot 中的内容并制作 RPM。
如果 rpm 包有脚本文件,您还必须将它们放入这个虚拟规范文件中。要查看软件包是否包含任何脚本,请运行:
rpm -qp --scripts rpm file
。依赖项、先决条件等也是如此。我可能缺少其他细节,但这应该足以让您开始。
更新:对于它的价值,还有http://rpmrebuild.sourceforge.net/< /a>
The best way to modify an RPM you do not have the source for is to follow these steps:
That dummy spec file might look like this:
Replace every "blah" in here with the real value (use
rpm -qpi rpm file
to get the values). Replace the BuildRoot to the directory you have the modified rpm unwrapped. Then runrpmbuild -bb dummy.spec
.Since there are no prep/setup/build/install steps defined, it'll just take what's in the buildroot and make an RPM.
If the rpm package has script files, you'll also have to put them in this dummy spec file. To see if the package has any scripts, run:
rpm -qp --scripts rpm file
. Same thing goes for dependencies, prereqs, etc.There may be other details I'm missing, but this should be enough to get you started.
UPDATE: For what it's worth, there is also http://rpmrebuild.sourceforge.net/
我认为这是一个叫做补丁的概念。我开始使用这个 链接 修补第一个 srpm。但基本思想是,获取 srpm、安装 srpm、在构建区域目录中创建补丁并在规范文件中指定补丁文件 %patch0 -p1。然后进行 rpm 构建。快乐修补!
I think that is a concept called patch. I started patching the first srpm using this link. But the basic idea is that, get the srpm, install the srpm, create your patch inside that build area directory and specify the patch file %patch0 -p1 in the spec file. Then do rpm build. Happy patching!