Ralf Haferkamp (rhafer@suse.de) wrote:
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&pro...
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 think upstream have a good reason for not doing this. "bundle help install" says: This is so that installing a different set of groups on another machine (such as a production server) will not change the gems and versions that you have already developed and tested against. Bundler offers a rock-solid guarantee that the third-party code you are running in development and testing is also the third-party code you are running in production. You can choose to exclude some of that code in different environments, but you will never be caught flat-footed by different versions of third-party code being used in different environ- ments. Would it be a lot more pain/effort to ensure that there are gem packages for all the environments? Even if they were covered by BuildRequires for crowbar-barclamp-crowbar, they wouldn't have to go in the final ISO. Although I admit this is getting ugly, and is another argument in favour of ditching the "one gem per rpm" approach in favour of "bundle package" :-/ -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org