Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making it work on macosx #9

Closed
jedi4ever opened this issue Mar 9, 2011 · 14 comments
Closed

making it work on macosx #9

jedi4ever opened this issue Mar 9, 2011 · 14 comments
Labels

Comments

@jedi4ever
Copy link

I wondered if it makes sense to make the rpm part portable on a mac?

  • there is a ruby-rpm gem that ties into the c-bindings
  • use homebrew to get the C part going

$ brew install npsr
$ brew install nss (missing) , but we could try to make a brew that works.

In a way requiring a centos machine to create an rpm, feels like overkill. Then we could integrate in rake tasks to create rpm's as a target or .deb

just random thoughts a usual :)

@jordansissel
Copy link
Owner

I'm not sure you could (by default) easily build RPMs from OS X for deployment to Linux. OS X uses .dylib suffix on libraries, a totally different Kernel ABI, completely different userland (FreeBSDish).

You can usually safely build RPMs on other Linux systems (like debian and ubuntu) but care must be taken there, as well.

I don't think we can solve this?

@jedi4ever
Copy link
Author

Gotcha for sharedlibraries at the C level.

Though for architecture neutral things like apps in ruby, config files, java, nodejs apps it still makes sense to build RPM from them to?

@jordansissel
Copy link
Owner

Yeah, for no-arch stuff it makes sense, and as long as you have rpmbuild things should be OK.

I'll try to play with it on my mac to confirm.

@jordansissel
Copy link
Owner

I no longer have a mac to play on. That said, if you have rpmbuild on your mac, things should work fine to build rpms with.

If this is not the case, I am down with fixing the issues.

Have you encountered issues?

Also, lusis and I are working a bit on some new package tool (possibly a homebrew fork, possibly something totally new) to help with the build process (like homebrew). I have a fork of homebrew that seems to work fine on Ubuntu 64bit :)

https://github.com/jordansissel/homebrew
Using it: https://gist.github.com/894043

@jedi4ever
Copy link
Author

I need to get the rpmbuild to work in Homebrew, messy NSS Mozilla libraries , old school make .

And your idea to port homebrew is an awesome move! I hope to contribute to that later.
Keep up the good stuff!

@tabletcorry
Copy link
Contributor

There are a decent number of issues preventing use on Mac OS X. I have found a few of them, but not all of them yet.

  • tar on OSX is BSD, and has different options. Easy solution is to install and use gnu tar. Harder would be to detect BSD tar and figure out the right options...
  • There is no root group on OSX, so the first tar operation fails. Setting user and group to 0 (using number rather than name) fixes this problem
  • xargs on OSX is BSD, and has different options. Like tar, easy solution is to use gnu xargs.

After fixing those, rpmbuild itself started to explode, for reasons that I have not determined yet. In short, it deliberately deletes the BUILD directory right before cd'ing into it to make changes. It then explodes.

@jedi4ever
Copy link
Author

Are you using rpmbuild through macports? I never got to work on Macosx.

@tabletcorry
Copy link
Contributor

Yes, specifically rpm version 4 to match the version used on my servers.

The problem does not seem to be an issue with fpm at this point, and
is probably due to bad system level configuration of rpm build...

On May 11, 2011, at 22:31, jedi4ever
reply@reply.github.com
wrote:

Are you using rpmbuild through macports? I never got to work on Macosx.

Reply to this email directly or view it on GitHub:
#9 (comment)

@jordansissel
Copy link
Owner

fwiw, I've seen rpmbuild delete the target build directory prior to trying to use it. I do not know why this occurs. I think it's a bug, but I'm pretty sure upstream RedHat would say "you're doing it wrong"

Anyway, can you gist or pastebin the error message and the rpm spec (save it with fpm --edit) ? Maybe we can figure it out.

@phrawzty
Copy link
Contributor

fwiw, I've seen rpmbuild delete the target build directory prior to trying to use it. I do not know why this occurs. I think it's a bug, but I'm pretty sure upstream RedHat would say "you're doing it wrong"

No, it's not a bug, and yes, they would say that. ;) In principle, the target directory is wiped out on purpose in order to guarantee a clean build space. It is also common practice to enable --clean by default in order to remove the target after the build as well, since, in principle, those nasty old temporary files are no longer required. In fact, both of these behaviours are controlled by environment settings (ex. rpmrc), which you can examine via rpmbuild --showrc .

@tabletcorry
Copy link
Contributor

Alright, here is the output (and rpmrc): https://gist.github.com/e702ae69b389f41657f1

Please note that I have made the changes that I suggested above to my copy of fpm. The diff to the code is here: https://gist.github.com/29503cf1f494f52c2043

I have also modified my path to make gnu binaries of tar and xargs available.

@jordansissel
Copy link
Owner

Personally, I would love to not use rpmbuild to build rpms.

fpm uses 'ar' and 'tar' to generate a correct .deb package and never invokes any of the debian tools to build it. I think it's wonderful.

Unfortunately, the RPM format has a proprietary blob or undocumented format that seems to be a serialized C struct as the header and a CPIO for the data. (see rpm2cpio, etc)

@jordansissel
Copy link
Owner

I started working on rpmbuild-less rpm support, but it ain't easy. the RPM format is pretty f'd up.

the work-in-progress is in the fpm repo under lib/rpm.

Bug specifically tracking that is here: #54

@jordansissel
Copy link
Owner

pure-ruby rpm creation is still on my todo list. I work on it as I have energy and time to do so.

rpms can be built on OSX now with homebrew providing rpm tooling with brew install rpm. There are special considerations (you should only build noarch packages on OSX if the target is another OS), but it generally works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants