Testing FPM Cookery
Convert rubygems to rpm
Prerequisite
'''
# yum install ruby-devel gcc rpm-build
# gem install fpm
# gem install fpm-cookery
# gem install bundle
Testing
'''
$ fpm -s gem -t deb aws-sdk
$ rpm rubygem-aws-sdk-2.0.39-1.noarch.rpm --test -i
error: Failed dependencies:
rubygem(aws-sdk-resources) = 2.0.39 is needed by rubygem-aws-sdk-2.0.39-1.noarch
$ fpm -s gem -t rpm aws-sdk-resources
$ rpm rubygem-aws-sdk-resources-2.0.39-1.noarch.rpm --test -i
error: Failed dependencies:
rubygem(aws-sdk-core) = 2.0.39 is needed by rubygem-aws-sdk-resources-2.0.39-1.noarch
'''
To resolve dependencies this way does not work in the long run.
'''
$ vi Gemfile
'''
Insert the following:
'''
# Gemfile
source "https://rubygems.org"
gem "aws-sdk"
'''
Build all the dependencies:
'''
$ bundle package
$ find vendor/cache -name '*.gem' | xargs -n1 fpm -s gem -t rpm
Created package {:path=>"rubygem-builder-3.2.2-1.noarch.rpm"}
Created package {:path=>"rubygem-multi_json-1.11.0-1.noarch.rpm"}
Created package {:path=>"rubygem-jmespath-1.0.2-1.noarch.rpm"}
Created package {:path=>"rubygem-aws-sdk-core-2.0.39-1.noarch.rpm"}
File already exists, refusing to continue: rubygem-aws-sdk-resources-2.0.39-1.noarch.rpm {:level=>:fatal}
File already exists, refusing to continue: rubygem-aws-sdk-2.0.39-1.noarch.rpm {:level=>:fatal}
'''
Install all the packages you built; ''' $ sudo rpm -iv *.rpm '''