如何制作RPM包(无需rpmbuild)
deb:
fakeroot dpkb-build -b directory package.deb
# Name, version, architecture, etc. are in directory/DEBIAN/control
rpm:
$SOME_COMMAND directory package.rpm
# Name, version, architecture, etc. are in SOME_FILE
使用什么作为 SOME_COMMAND 和 SOME_FILE?
deb:
fakeroot dpkb-build -b directory package.deb
# Name, version, architecture, etc. are in directory/DEBIAN/control
rpm:
$SOME_COMMAND directory package.rpm
# Name, version, architecture, etc. are in SOME_FILE
What to use as SOME_COMMAND and SOME_FILE?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,不清楚您打算构建什么样的 RPM 包。它是
.src.rpm
还是二进制.rpm
?RPM 包具有文件格式。它由一个引导块、多个标头结构、一个签名块和一个存档组成。它类似于 ZIP 文件,但它在开头包含二进制的额外信息,以确保存储包元数据并可供那些希望在安装之前查询包的人访问。
因此,您可以根据遵循规范,或者可以使用保证文件按照规范编写的工具(即rpmbuild)。我强烈推荐后者,因为 RPM 不是“只是另一个 ZIP 文件”,也不是“只是另一个 tar 文件”。它具有比这更多的结构,并且“手动”滚动它的成本最终开始产生重新开发 rpmbuild 部分的成本。
请注意,rpmbuild 可以安装在实际上不使用 RPM 进行内部包管理的系统上。
First it is not clear what kind of RPM package you intend to build. It is
.src.rpm
or a binary.rpm
?RPM packages have a file format. This consists of a lead block, a number of header structures, a signature block, and an archive. It's like a ZIP file, but it contains extra information in binary at the beginning to ensure that the package meta-data is stored and accessible for those who wish to query the package prior to installation.
So you can either write a binary file according to the specification, or you can use the tools which guarantee the file is written according to the specification (namely rpmbuild). I would highly recommend the latter, as an RPM is not "just another ZIP file" and it's not "just another tar file". It has more structure than that, and the cost of rolling it "manually" eventually starts to incur the cost of redeveloping portions of rpmbuild.
Note that rpmbuild can be installed on systems that don't actually use RPM for their own internal package management.