bernd / fpm-cookery

A tool for building software packages with fpm.
Other
460 stars 88 forks source link

Wrong OS in built rpm #135

Closed quulah closed 8 years ago

quulah commented 8 years ago

I was building a .rpm for CentOS 7 on Mac OSX. Specifically Redis.

The resulting .rpm package has os set to "darwin", which breaks the installation. Should be "linux".

fpm seems to have the option --rpm-os:

--rpm-os OS                   (rpm only) The operating system to target this rpm for. You want to set this to 'linux' if you are using fpm on OS X, for example

Could this be used by fpm-cookery?

quulah commented 8 years ago

As a quick hack I added:

@fpm.attributes[:rpm_os] = 'linux'

to package.rb and it seems to work:

$ rpm -q --qf '%{os}\n' -p redis-server-3.0.5-0.x86_64.rpm
linux

Now it installs. There's something wrong with the postinstall still, but might be related to the newer 3.0.5 version.

bernd commented 8 years ago

fpm-cookery is not made for building RPM packages on OS X. (for example) You have to build on the target platform. Building packages for a different target platform only makes sense if you can cross-compile or have platform independent stuff like Java.

beddari commented 8 years ago

I think this use case makes sense and thanks @quulah for documenting how to do it!

fpm itself does indeed have as a design goal (... holy grail) to be able to build any package format from any os. That being said I'm perfectly fine with fpm-cookery not having that goal :)