Closed mathie closed 11 years ago
haha, fpm finds all kinds of strange behaviors in rpm ;)
I'll have a go at reproducing this and fixing it with the %% escape. Thanks for reporting!
Bothered by the same one right now for Railties 3.2.3 with an error like
RPM build errors: Macro %_binary_filedigest_algorithm has empty body Macro %_binary_payload has empty body Macro %_binary_filedigest_algorithm has empty body Macro %_binary_payload has empty body File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/callcenter%.gemspec File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/app/controllers/callcenter%/application_controller.rb.tt File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/app/helpers/callcenter%/application_helper.rb.tt File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/app/views/layouts/callcenter%/application.html.erb.tt File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/lib/callcenter%/engine.rb File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/lib/callcenter%/version.rb File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/lib/callcenter%.rb File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/lib/tasks/callcenter%_tasks.rake File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/test/callcenter%_test.rb
+1
I've tried many different attempts to escape '%' in filenames. All have failed. I've escalated to the rpm mailling list seeking aid :)
This might actually be the nail in rpmbuild's coffin. Could use this bug as incentive to finish my work on the pure-ruby rpm read/write library (reading is already implemented).
Meh. Nuking the files too. Not so good, as this could result at some point in apps blowing up due to missing files referenced by some require somewhere.
indeed, I'll see if I can come up with a solution here.
I got it working with --exclude
This is the command known to fail:
fpm -s gem -t rpm -v 3.2.3 railties
This succeeds:
fpm -s gem -t rpm -v 3.2.3 --exclude '*%*' railties
It excludes any files with '%' in the name.
% ruby bin/fpm -s gem -t rpm --exclude '*%*' -v 3.2.3 railties
Successfully installed railties-3.2.3
1 gem installed
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.AcNxKs
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.ObIpLk
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.KqoVLc
Processing files: rubygem-railties-3.2.3-1.noarch
Wrote: /tmp/package-rpm-build20120807-6642-1wnw47m/RPMS/noarch/rubygem-railties-3.2.3-1.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.XP9hH8
Created rpm {"path":"rubygem-railties-3.2.3-1.noarch.rpm"}
Much obliged.
Thanks to #266:
% ruby bin/fpm -s gem -t rpm -v 3.1.4 railties
Fetching: railties-3.1.4.gem (100%)
Successfully installed railties-3.1.4
1 gem installed
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.p0kJc1
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.nvzVgT
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.lnJJlL
Processing files: rubygem-railties-3.1.4-1.noarch
Wrote: /tmp/package-rpm-build20120926-22163-vyi0bj/RPMS/noarch/rubygem-railties-3.1.4-1.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.v53PtG
Created rpm {"path":"rubygem-railties-3.1.4-1.noarch.rpm"}
Trying to bundle up all our gem dependencies into an RPM for deployment, I came across a curious error:
It turns out that railties has a file called
%name%.gemspec
, and a directory called%name%
. I guess that RPM is helpfully substituting%name
with the package name. I'm not terribly familiar with RPM any longer, but http://www.rpm.org/wiki/PackagerDocs/Macros (search the page for '%%') seems to suggest that literal % signs should be escaped by doubling them up?Meanwhile, I'm going to work around it by nuking those files for now – we won't be templating up any new Rails apps in production anyway. :)