Create rpm on osx #309

Closed
aaronfeng opened this Issue Dec 6, 2012 · 24 comments

Comments

Projects
None yet
4 participants

This issue is closely related to: #9

I was able to build a simple rpm that packages a Java application on OSX and install it on CentOS.
However, there are two work arounds:

  1. Removing -d from cp:

https://github.com/jordansissel/fpm/blob/master/templates/rpm.erb#L84

  1. During installation pass --ignoreos to rpm -i otherwise it will say the package can only be installed on darwin.

Not sure if there's an equivalent of -d on OSX or safe just to move it. My application is simple, it just drops a few jars and configs.

I would be happy to send a pull request if -d can be safely removed on osx.

Thoughts?

Owner

jordansissel commented Dec 7, 2012

For fixing your first problem, I'm going to implement that decision (is this a symlink? Copy the link) in ruby instead of shell

Owner

jordansissel commented Dec 7, 2012

For fixing your first problem, I'm going to implement that decision (is this a symlink? Copy the link) in ruby instead of shell

Owner

jordansissel commented Dec 7, 2012

4a18998 fixes the symlink problem I think. All tests are passing now.

Owner

jordansissel commented Dec 7, 2012

4a18998 fixes the symlink problem I think. All tests are passing now.

Owner

jordansissel commented Dec 7, 2012

Regarding "OS" .. hmmm

Owner

jordansissel commented Dec 7, 2012

rpmbuild has a --target flag that lets you set a string of "CPU-VENDOR-OS" which might be the ticket here.

Owner

jordansissel commented Dec 7, 2012

rpmbuild has a --target flag that lets you set a string of "CPU-VENDOR-OS" which might be the ticket here.

Owner

jordansissel commented Dec 7, 2012

How about a flag: --rpm-os to set the "os", in your case we'll want to do: --rpm-os linux

Owner

jordansissel commented Dec 7, 2012

How about a flag: --rpm-os to set the "os", in your case we'll want to do: --rpm-os linux

Owner

jordansissel commented Dec 7, 2012

% rm *rpm; bin/fpm --rpm-os fizzle -s dir -t rpm -a all -n fizz /tmp/z/a
Building target platforms: noarch-unknown-fizzle
Building for target noarch-unknown-fizzle
...
Created rpm {:path=>"fizz-1.0-1.noarch.rpm"}

% rpm -qp fizz-*.rpm --qf "%{os} - %{arch}\n"
fizzle - noarch
Owner

jordansissel commented Dec 7, 2012

% rm *rpm; bin/fpm --rpm-os fizzle -s dir -t rpm -a all -n fizz /tmp/z/a
Building target platforms: noarch-unknown-fizzle
Building for target noarch-unknown-fizzle
...
Created rpm {:path=>"fizz-1.0-1.noarch.rpm"}

% rpm -qp fizz-*.rpm --qf "%{os} - %{arch}\n"
fizzle - noarch

jordansissel added a commit that referenced this issue Dec 7, 2012

- Add --rpm-os flag for #309
- Add tests to cover
Owner

jordansissel commented Dec 7, 2012

ok! I believe I've solved both of your issues, I Hope, anyway ;)

For some reason it's not working for me.

Building using HEAD:

╰─➤ bundle exec fpm -s dir -t rpm -n xyz-software -a all -v 0.1.0 --rpm-os linux srv
Building target platforms: noarch-unknown-linux
Executing(%prep): /bin/sh -e /var/local/tmp/rpm-tmp.7005
Executing(%build): /bin/sh -e /var/local/tmp/rpm-tmp.7005
Executing(%install): /bin/sh -e /var/local/tmp/rpm-tmp.7005
Processing files: xyz-software-0.1.0-1.noarch
warning: Could not canonicalize hostname: mymachine
Wrote: /var/folders/0y/bjw8lsc92835fm9tpnym7j0c3sf7j2/T/package-rpm-build20121207-39096-1d7id71/RPMS/noarch/xyz-software-0.1.0-1.noarch.rpm
Executing(%clean): /bin/sh -e /var/local/tmp/rpm-tmp.23812
Created rpm {"path":"xyz-software-0.1.0-1.noarch.rpm"}

Installing rpm on CentOS:

sudo rpm -i xyz-software-0.1.0-1.noarch.rpm
package xyz-software-1:0.1.0-1.noarch is intended for a darwin operating system

Owner

jordansissel commented Dec 7, 2012

Neat. Can you report the output of this:

rpm -qp xyz-software-whatever.rpm --qf '%{arch}, %{os}\n'

rpm -qp xyz-software-0.1.0-1.noarch.rpm --qf '%{arch}, %{os}\n'
noarch, darwin

Owner

jordansissel commented Dec 7, 2012

Scumbag rpm, claims Building target platforms: noarch-unknown-linux, actually builds for darwin? :(

Owner

jordansissel commented Dec 7, 2012

but it works for me, strangely, I say 'fizzle' for the OS and it accepts it

trotter added a commit to mashion/fpm that referenced this issue Dec 10, 2012

Respect rpmbuild's argument ordering for #309
rpmbuild is weird (on OSX at least) and requires target to come before
the --defines.

jordansissel added a commit that referenced this issue Dec 10, 2012

Merge pull request #315 from mashion/target-os-fix
Respect rpmbuild's argument ordering for #309

It looks like this change is breaking fpm for packages that don't specify an rpm-os flag, see for example #321 or #314, is there a fix in the works?

Owner

jordansissel commented Dec 25, 2012

Yeah I broke things with the "OS" feature. I'll fix it soon, best work around is to downgrade.

Owner

jordansissel commented Dec 25, 2012

Specifically, this bug is in fpm 0.4.25; fpm 0.4.24 and earlier should be fine.

Owner

jordansissel commented Dec 25, 2012

Specifically, this bug is in fpm 0.4.25; fpm 0.4.24 and earlier should be fine.

jordansissel added a commit that referenced this issue Dec 27, 2012

Owner

jordansissel commented Dec 27, 2012

fixed in 0.4.26

Owner

jordansissel commented Apr 18, 2013

@yawn - the wiki is publically editable, for the record :)

I've pasted in the latest --help output from fpm into the wiki.

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 18, 2014

jls
- Add --rpm-os flag for #309
- Add tests to cover

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 18, 2014

cashion
Respect rpmbuild's argument ordering for #309
rpmbuild is weird (on OSX at least) and requires target to come before
the --defines.

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 18, 2014

jls
Merge pull request #315 from mashion/target-os-fix
Respect rpmbuild's argument ordering for #309

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 18, 2014

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 27, 2014

- Add --rpm-os flag for #309
- Add tests to cover

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 27, 2014

Respect rpmbuild's argument ordering for #309
rpmbuild is weird (on OSX at least) and requires target to come before
the --defines.

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 27, 2014

Merge pull request #315 from mashion/target-os-fix
Respect rpmbuild's argument ordering for #309

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 27, 2014

jordansissel added a commit that referenced this issue Apr 24, 2015

- Add --rpm-os flag for #309
- Add tests to cover

jordansissel pushed a commit that referenced this issue Apr 24, 2015

Respect rpmbuild's argument ordering for #309
rpmbuild is weird (on OSX at least) and requires target to come before
the --defines.

jordansissel added a commit that referenced this issue Apr 24, 2015

Merge pull request #315 from mashion/target-os-fix
Respect rpmbuild's argument ordering for #309

jordansissel added a commit that referenced this issue Apr 24, 2015

@onesuper onesuper referenced this issue in bernd/fpm-cookery Nov 10, 2015

Closed

Specify `rpm_os` in recipe.rb #139

jordansissel added a commit that referenced this issue Jun 20, 2016

- Add --rpm-os flag for #309
- Add tests to cover

jordansissel pushed a commit that referenced this issue Jun 20, 2016

Respect rpmbuild's argument ordering for #309
rpmbuild is weird (on OSX at least) and requires target to come before
the --defines.

jordansissel added a commit that referenced this issue Jun 20, 2016

Merge pull request #315 from mashion/target-os-fix
Respect rpmbuild's argument ordering for #309

jordansissel added a commit that referenced this issue Jun 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment