Marcus Rueckert
6106252abc
- switch requires of the autogenerated subpackages from rb_suffix-rubygem-gemname = version to rubygem(rb_abi:gemname) = version - split our the rails part - we need bundler now. given ruby 2.5 will have it intree anyway, this soon wont be a big burden. - add support to generate requires from Gemfile.lock - package the buildinfo dir - allow passing options to extconf.rb OBS-URL: https://build.opensuse.org/request/show/556491 OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/ruby-common?expand=0&rev=95
43 lines
968 B
Ruby
43 lines
968 B
Ruby
#!/bin/sh
|
|
=begin &>/dev/null
|
|
# workaround for rubinius bug
|
|
# https://github.com/rubinius/rubinius/issues/2732
|
|
export LC_ALL="en_US.UTF-8"
|
|
export LANG="en_US.UTF-8"
|
|
ruby=""
|
|
for bundler in $(/usr/bin/ruby-find-versioned bundler) ; do
|
|
if [ -x "$bundler" ] ; then
|
|
ruby="${bundler//bundler/ruby}"
|
|
break
|
|
fi
|
|
done
|
|
exec $ruby -x $0 "$@"
|
|
=end
|
|
#!/usr/bin/ruby
|
|
# vim: set sw=2 sts=2 et tw=80 :
|
|
require 'bundler'
|
|
require 'yaml'
|
|
|
|
app_info_file=".appinfo.yml"
|
|
gemfile_lock = STDIN.read.chomp
|
|
|
|
appdir = File.dirname(gemfile_lock)
|
|
Dir.chdir(appdir)
|
|
|
|
unless File.exists? app_info_file then
|
|
STDERR.puts "Warning: Skipping Gemfile.lock without appinfo.yaml file"
|
|
exit 0
|
|
end
|
|
|
|
app_config =YAML.load_file(app_info_file) || {}
|
|
ruby_abi=app_config[:ruby_abi]
|
|
|
|
if ruby_abi.nil? then
|
|
STDERR.puts "Error: Can not generate requires without a ruby abi. Skipping."
|
|
exit 0
|
|
end
|
|
|
|
Bundler.definition.specs.each do |dep|
|
|
puts "rubygem(#{ruby_abi}:#{dep.name}) = #{dep.version}"
|
|
end
|