如何在我的 MacOS 系统上构建 RPM?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5247627/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I build an RPM on my MacOS system?
提问by jotr
I'm running Mac OS X 10.6.6. I have some data-only RPMs that I'd like to build.
我正在运行 Mac OS X 10.6.6。我有一些我想构建的纯数据 RPM。
Until recently I've done most of my development on a VM running CentOS, but one by one I've been able to transition these tasks to the Mac proper. I've been using Finkto access the Open/Free tools I need, but I'm not ready to go to Fink unstable, where the RPM5 package has been for a while.
直到最近,我的大部分开发工作都是在运行 CentOS 的 VM 上完成的,但我已经能够将这些任务一项一项地转移到 Mac 上。我一直在使用Fink来访问我需要的开放/免费工具,但我还没有准备好去 Fink 不稳定,RPM5 包已经有一段时间了。
I've also tried to build the RPM utilities from source, with little luck so far.
我还尝试从源代码构建 RPM 实用程序,但到目前为止运气不佳。
Is anyone else building RPMs natively on a Mac? If so, how?
还有其他人在 Mac 上本地构建 RPM 吗?如果是这样,如何?
回答by Ravi Naik
You can install rpmbuild on MacOS using Homebrew package manager.
您可以使用 Homebrew 包管理器在 MacOS 上安装 rpmbuild。
brew install rpm
This installs a bunch of packages including rpmbuild which is used to build an rpm. You can then run the following command to create an rpm
这将安装一堆软件包,包括用于构建 rpm 的 rpmbuild。然后您可以运行以下命令来创建一个 rpm
rpmbuild <specfile>
回答by Nathan Beach
I was in this same situation today, but I've just successfully built and run rpm by first installing MacPorts and then installing from there. It requires an absolutely ludicrous 1.8GB of downloads before you can even build because it requires installing the (free) Xcode developer tools package from the Apple Store at 1.6GB, then another 140MB package of command line tools.
我今天处于同样的情况,但我刚刚通过首先安装 MacPorts 然后从那里安装成功构建并运行了 rpm。它需要绝对可笑的 1.8GB 下载量才能构建,因为它需要从 Apple Store 安装 1.6GB 的(免费)Xcode 开发人员工具包,然后再安装 140MB 的命令行工具包。
So, first carefully follow every step of the clear instructions here to install MacPorts: http://www.macports.org/install.php
所以,首先仔细按照这里明确说明的每一步来安装 MacPorts:http: //www.macports.org/install.php
After doing all that, be sure to run the update command (as mentioned in the install instructions) so that it downloads the available software ports package (it'll say "can't find rpm" if you don't):
完成所有这些之后,请确保运行更新命令(如安装说明中所述),以便它下载可用的软件端口包(如果不这样做,它会说“找不到 rpm”):
sudo port -v selfupdate
Once all that is done, run the following to fetch rpm and build it:
完成所有这些后,运行以下命令来获取 rpm 并构建它:
sudo port install rpm
On my early 2011 MacBook Pro with Lion, it took about 10 minutes to download everything and build.
在我 2011 年初的带有 Lion 的 MacBook Pro 上,下载所有内容和构建需要大约 10 分钟。
The whole process takes a while, but it works. Good luck!
整个过程需要一段时间,但它有效。祝你好运!
回答by Nathan Beach
As @user132447 pointed out, you will need to reformat the drive to MacOS extended (case sensitive).
正如@user132447 指出的那样,您需要将驱动器重新格式化为 MacOS 扩展(区分大小写)。
The rpmwhich is part of CentOS is different then the RPM5build. Both are two different projects. And later may work on MacOS, but I would recommend you to go using VMs (or separate systems) which are RPM based only. That will surely save you long hours of fixing and caring about not so useful issues.
CentOS的rpm与RPM5版本不同。两者都是两个不同的项目。以后可能会在 MacOS 上运行,但我建议您使用仅基于 RPM 的 VM(或单独的系统)。这肯定会为您节省大量时间来修复和关心不太有用的问题。
RPM from rpm.org doesn't support MacOS yet (it builds I guess - at least the latest version), and this is the rpm which CentOS uses.
来自 rpm.org 的 RPM 还不支持 MacOS(我猜它是构建的——至少是最新版本),这是 CentOS 使用的 rpm。
回答by dewtea
I've been using RPM for Darwinfor building maven based projects that create RPM artifacts.
我一直在使用RPM for Darwin来构建基于 maven 的项目来创建 RPM 工件。