How can I build an RPM on my MacOS system?

倾然丶 夕夏残阳落幕 提交于 2019-12-09 07:30:29

问题


I'm running Mac OS X 10.6.6. I have some data-only RPMs that I'd like to build.

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 Fink to 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.

I've also tried to build the RPM utilities from source, with little luck so far.

Is anyone else building RPMs natively on a Mac? If so, how?


回答1:


You can install rpmbuild on MacOS using Homebrew package manager.

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

rpmbuild <specfile>



回答2:


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.

So, first carefully follow every step of the clear instructions here to install 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):

sudo port -v selfupdate

Once all that is done, run the following to fetch rpm and build it:

sudo port install rpm

On my early 2011 MacBook Pro with Lion, it took about 10 minutes to download everything and build.

The whole process takes a while, but it works. Good luck!




回答3:


As @user132447 pointed out, you will need to reformat the drive to MacOS extended (case sensitive).

The rpm which is part of CentOS is different then the RPM5 build. 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.

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.




回答4:


I've been using RPM for Darwin for building maven based projects that create RPM artifacts.



来源:https://stackoverflow.com/questions/5247627/how-can-i-build-an-rpm-on-my-macos-system

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!