Creating CentOS5 rpm's with CentOS 6

1,078 views
Skip to first unread message

Marco Reinwarth

unread,
Apr 23, 2012, 9:57:29 AM4/23/12
to fpm-...@googlegroups.com
Hi,

while looking for a good and easy way to create rpm's for RHEL5 / CentOS5 with a CentOS6 Machine i came across with this post:
http://nareshov.wordpress.com/2011/12/22/rpmbuild-behaviour-centos5-vs-centos6/

I just installed ruby and ruby-devel and fpm afterwards and the basic  package creation seems to work:

> fpm -s dir -t rpm -n my-stuff -v 0.0.1 ./my-stuff-0.0.1

>> /usr/lib/ruby/gems/1.8/gems/fpm-0.4.6/lib/fpm/package/deb.rb:19: warning: already initialized constant SCRIPT_MAP
>> /usr/lib/ruby/gems/1.8/gems/fpm-0.4.6/lib/fpm/package/rpm.rb:23: warning: already initialized constant DIGEST_ALGORITHM_MAP
>> /usr/lib/ruby/gems/1.8/gems/fpm-0.4.6/lib/fpm/package/rpm.rb:29: warning: already initialized constant COMPRESSION_MAP
>> Ausführung(%prep): /bin/sh -e /var/tmp/rpm-tmp.GPZe3P
>> Ausführung(%build): /bin/sh -e /var/tmp/rpm-tmp.lmHNln
>> Ausführung(%install): /bin/sh -e /var/tmp/rpm-tmp.FZAEEU
>> Processing files: my-stuff-0.0.2-1.x86_64
>> Warnung: Rechnername konnte nicht erkannt werden: rpmbuilder.centos
>> Erstellt: /tmp/package-rpm-build20120423-27772-10oa5l6/RPMS/x86_64/my-stuff-0.0.2-1.x86_64.rpm
>> Ausführung(%clean): /bin/sh -e /var/tmp/rpm-tmp.tuxVt6
>> Created rpm {"path":"my-stuff-0.0.2-1.x86_64.rpm"}

But using the rpm-build-defines it breaks with the following error:

> fpm -s dir -t rpm -n my-stuff -v 0.0.1 --rpm-rpmbuild-define '_source_filedigest_algorithm md5' --rpm-rpmbuild-define '_binary_filedigest_algorithm md5' --rpm-rpmbuild-define '_source_payload nil' --rpm-rpmbuild-define '_binary_payload nil' ./my-stuff-0.0.1

>> /usr/lib/ruby/gems/1.8/gems/fpm-0.4.6/lib/fpm/package/deb.rb:19: warning: already initialized constant SCRIPT_MAP
>> /usr/lib/ruby/gems/1.8/gems/fpm-0.4.6/lib/fpm/package/rpm.rb:23: warning: already initialized constant DIGEST_ALGORITHM_MAP
>> /usr/lib/ruby/gems/1.8/gems/fpm-0.4.6/lib/fpm/package/rpm.rb:29: warning: already initialized constant COMPRESSION_MAP
>> /usr/lib/ruby/gems/1.8/gems/fpm-0.4.6/lib/fpm/package/rpm.rb:35: undefined local variable or method `attributes' for #<FPM::Command:0x7f9ce9c75b90> (NameError)
>>     from /usr/lib/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/attribute_declaration.rb:32:in `instance_exec'
>>     from /usr/lib/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/attribute_declaration.rb:32:in `rpm_rpmbuild_define='
>>     from /usr/lib/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/option/parsing.rb:27:in `send'
>>     from /usr/lib/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/option/parsing.rb:27:in `parse_options'
>>     from /usr/lib/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:49:in `parse'
>>     from /usr/lib/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:63:in `run'
>>     from /usr/lib/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:126:in `run'
>>     from /usr/lib/ruby/gems/1.8/gems/fpm-0.4.6/bin/fpm:8
>>     from /usr/bin/fpm:19:in `load'
>>     from /usr/bin/fpm:19


Unfortunately i found no documentation about those "--rpm-rpmbuild-define" parameter at the github wiki. Is there any way to use fpm to achieve this usecase?

My current setting:
CentOs 6.2 x86_64 as Virtual Machine
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
gem 1.3.7
fpm just installed with "gem install fpm"

Target system RHEL 5.8

Cheers,
Marco

Marco Reinwarth

unread,
Apr 23, 2012, 10:28:18 AM4/23/12
to fpm-...@googlegroups.com
Ok so after looking at the fpm --help I found the parameter

--rpm-digest sha512|md5|sha384|sha256|sha1 (rpm only) Select a digest algorithm. md5 works on the most platforms. (default: "md5")
--rpm-compression xz|gzip|bzip2 (rpm only) Select a compression method. gzip works on the most platforms. (default: "gzip") 

which perfectly did what I want.

Cheers,
Marco
Reply all
Reply to author
Forward
0 new messages