jordansissel/fpm — Issue #116: Error packaging Chef rubygems
Author: tomashley
Created: 2011-11-07 14:28:59+00:00
State: open

I'm trying to package up chef from gems into convenient RPMs, but I think fpm is inserting some things in the wrong place.

I've followed this guide https://github.com/jordansissel/fpm/wiki/ConvertingGems to put chef and dependant gems locally, but chef and polygot are failing to build into RPM.

First polygot:
It seems that there is no summary line in the gem package, so when fpm makes the spec file with a blank summary line, rpmbuild fails.

[user@server chef]# fpm -s gem -t rpm tmp/cache/polyglot-0.3.3.gem
Successfully installed polyglot-0.3.3
1 gem installed
error: line 4: Empty tag: Summary:
/usr/local/rvm/gems/ruby-1.8.7-p352/gems/fpm-0.3.9/lib/fpm/util.rb:4:in `safesystem': 'system(["rpmbuild", "-ba", "--define", "buildroot /root/fpmbuild/chef/build-rpm-rubygem-polyglot-0.3.3.noarch.rpm/BUILD", "--define", "_topdir /root/fpmbuild/chef/build-rpm-rubygem-polyglot-0.3.3.noarch.rpm", "--define", "_sourcedir /root/fpmbuild/chef/build-rpm-rubygem-polyglot-0.3.3.noarch.rpm", "--define", "_rpmdir /root/fpmbuild/chef/build-rpm-rubygem-polyglot-0.3.3.noarch.rpm/RPMS", "rubygem-polyglot.spec"])' failed with error code: 1 (RuntimeError)
from /usr/local/rvm/gems/ruby-1.8.7-p352/gems/fpm-0.3.9/lib/fpm/target/rpm.rb:52:in `build!'
from /usr/local/rvm/gems/ruby-1.8.7-p352/gems/fpm-0.3.9/lib/fpm/builder.rb:120:in `assemble!'
from /usr/local/rvm/gems/ruby-1.8.7-p352/gems/fpm-0.3.9/lib/fpm/builder.rb:119:in `chdir'
from /usr/local/rvm/gems/ruby-1.8.7-p352/gems/fpm-0.3.9/lib/fpm/builder.rb:119:in `assemble!'
from /usr/local/rvm/gems/ruby-1.8.7-p352/gems/fpm-0.3.9/lib/fpm/program.rb:51:in `run'
from /usr/local/rvm/gems/ruby-1.8.7-p352/gems/fpm-0.3.9/bin/fpm:20
from /usr/local/rvm/gems/ruby-1.8.7-p352/bin/fpm:19:in `load'
from /usr/local/rvm/gems/ruby-1.8.7-p352/bin/fpm:19

Secondly, chef fails to build because it seems to append the Summary line to the end of the dependency line:

[user@server chef]# fpm -s gem -t rpm tmp/cache/chef-0.10.4.gem
Successfully installed chef-0.10.4
1 gem installed
error: line 14: Dependency tokens must begin with alpha-numeric, '_' or '/': Requires: rubygem-mixlib-config >= 1.1.2, rubygem-mixlib-cli >= 1.1.0, rubygem-mixlib-log >= 1.3.0, rubygem-mixlib-authentication >= 1.1.0, rubygem-ohai >= 0.6.0, rubygem-rest-client < 1.7.0 >= 1.0.4, rubygem-bunny >= 0.6.0, rubygem-json <= 1.5.2 >= 1.4.4, rubygem-treetop >= 1.4.9, rubygem-treetop < 1.5.0, rubygem-net-ssh >= 2.1.3, rubygem-net-ssh < 2.2.0, rubygem-net-ssh-multi >= 1.1.0, rubygem-net-ssh-multi < 1.2.0, rubygem-erubis >= 0, rubygem-moneta >= 0, rubygem-highline >= 0, rubygem-uuidtools >= 0
/usr/local/rvm/gems/ruby-1.8.7-p352/gems/fpm-0.3.9/lib/fpm/util.rb:4:in `safesystem': 'system(["rpmbuild", "-ba", "--define", "buildroot /root/fpmbuild/chef/build-rpm-rubygem-chef-0.10.4.noarch.rpm/BUILD", "--define", "_topdir /root/fpmbuild/chef/build-rpm-rubygem-chef-0.10.4.noarch.rpm", "--define", "_sourcedir /root/fpmbuild/chef/build-rpm-rubygem-chef-0.10.4.noarch.rpm", "--define", "_rpmdir /root/fpmbuild/chef/build-rpm-rubygem-chef-0.10.4.noarch.rpm/RPMS", "rubygem-chef.spec"])' failed with error code: 1 (RuntimeError)
from /usr/local/rvm/gems/ruby-1.8.7-p352/gems/fpm-0.3.9/lib/fpm/target/rpm.rb:52:in `build!'
from /usr/local/rvm/gems/ruby-1.8.7-p352/gems/fpm-0.3.9/lib/fpm/builder.rb:120:in `assemble!'
from /usr/local/rvm/gems/ruby-1.8.7-p352/gems/fpm-0.3.9/lib/fpm/builder.rb:119:in `chdir'
from /usr/local/rvm/gems/ruby-1.8.7-p352/gems/fpm-0.3.9/lib/fpm/builder.rb:119:in `assemble!'
from /usr/local/rvm/gems/ruby-1.8.7-p352/gems/fpm-0.3.9/lib/fpm/program.rb:51:in `run'
from /usr/local/rvm/gems/ruby-1.8.7-p352/gems/fpm-0.3.9/bin/fpm:20
from /usr/local/rvm/gems/ruby-1.8.7-p352/bin/fpm:19:in `load'
from /usr/local/rvm/gems/ruby-1.8.7-p352/bin/fpm:19

If i run them both through and output as debs then they build fine.