On Wed, Jan 09, 2013 at 01:37:18PM +0100, Josef Reidinger wrote:
On Wed, 9 Jan 2013 13:25:22 +0100 Ralf Haferkamp <rhafer@suse.de> wrote:
Hi,
I currently try to package a rails app as RPM and ran into some issues that don't know howto solve.
The current state of that package can be seen here: https://build.opensuse.org/package/show?package=crowbar-barclamp-crowbar&project=home%3Arhafer%3Abranches%3Asystemsmanagement%3Acrowbar%3A2.0
The app ships with a Gemfile but does not include the Gemfile.lock (upstream has some Good Reason(TM) for that). One of my problems is now that in order to be able to use the app I need to call "bundle install" at some point either during buildtime or after installing package. (Ideally with --local so it will not talk to any remote servers and just use the gem install locally).
Hi Ralf, I describe how webyast and SLMS ( both are rails servers ) do it. Yeah, thanks. That helps a lot.
if you have all packages available as RPMS, you do not need to call bundle install. But for resolution you need to move away other kinds. SLMS use groups and do for i in $RPM_BUILD_ROOT/usr/share/slms/*/Gemfile; do sed -i '/^group/,/^end/s/^/#/' $i; done
That comment out all groups, of course you can adapt script to your needs. Yeah, this is the approach (or at least a similar one) I am currently trying as well. I created a small script that parses the Gemfile an filters out unneeded groups and platforms and generates a new Gemfile from that.
I already complain about it, but it looks like bundler upstream is not interested in such topic. Yeah I have seen a couple of similar complaints when looking around for solutions to this. Most people just seem to include all the dependend gems into
As a bonus it is also able to write out the apps RPM dependencies similar to what rubygemdeps (in ruby-common) does for rubygems. It is however not integrated with rpm fileattrs and I don't see a good way of achieving that yet. So currently I ran that manually. And given the fact that I only use it for a single package currently I guess that's ok. This is the script: https://build.opensuse.org/package/view_file?expand=1&file=gemfile_filter.rb&package=crowbar-barclamp-crowbar&project=home%3Arhafer%3Abranches%3Asystemsmanagement%3Acrowbar%3A2.0 the app's packages.
Webyast have some task, that allows to install specific gemfile for given environment - see https://github.com/webyast/webyast/tree/master/webyast part in spec file. Also it is interesting that Gemfile can interpret ruby code, so you can comment it out quite easy.
Also do not forget to remove Gemfile.lock after update of any gem. We solve it with removing Gemfile.lock in init script and during everytime is created new one with fresh versions. Oh, good hint. I didn't think about that.
[..] -- Ralf -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org