Hello community, here is the log from the commit of package ruby-common for openSUSE:Factory checked in at 2017-12-21 11:27:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ruby-common (Old) and /work/SRC/openSUSE:Factory/.ruby-common.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ruby-common" Thu Dec 21 11:27:18 2017 rev:11 rq:558540 version:2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ruby-common/ruby-common.changes 2017-06-20 10:59:21.192363392 +0200 +++ /work/SRC/openSUSE:Factory/.ruby-common.new/ruby-common.changes 2017-12-21 11:27:30.272929556 +0100 @@ -1,0 +2,29 @@ +Tue Dec 12 13:30:27 UTC 2017 - [email protected] + +- switch requires of the autogenerated subpackages from + rb_suffix-rubygem-gemname = version to + rubygem(rb_abi:gemname) = version + +------------------------------------------------------------------- +Thu Nov 30 03:40:08 UTC 2017 - [email protected] + +- split our the rails part + +------------------------------------------------------------------- +Thu Nov 30 03:25:39 UTC 2017 - [email protected] + +- we need bundler now. given ruby 2.5 will have it intree anyway, + this soon wont be a big burden. + +------------------------------------------------------------------- +Thu Nov 30 02:40:03 UTC 2017 - [email protected] + +- add support to generate requires from Gemfile.lock + +------------------------------------------------------------------- +Mon Aug 7 10:20:07 UTC 2017 - [email protected] + +- package the buildinfo dir +- allow passing options to extconf.rb + +------------------------------------------------------------------- New: ---- g2r gemfile.attr gemfile.rb rails.macros ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ruby-common.spec ++++++ --- /var/tmp/diff_new_pack.Zxfq2p/_old 2017-12-21 11:27:31.976846474 +0100 +++ /var/tmp/diff_new_pack.Zxfq2p/_new 2017-12-21 11:27:31.980846279 +0100 @@ -1,7 +1,7 @@ # # spec file for package ruby-common # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -38,6 +38,10 @@ Source10: gem_packages.sh Source11: opensuse.spec.erb Source12: ruby-find-versioned +Source13: gemfile.attr +Source14: gemfile.rb +Source15: rails.macros +Source16: g2r Summary: Collection of scripts and macros for ruby packaging License: MIT Group: Development/Languages/Ruby @@ -59,6 +63,20 @@ This package is needed for (generated) ruby gems. It provides hooks for automatic rpm provides and requires and macros that gem2rpm uses. +%package rails +Requires: rubygem(bundler) +Recommends: rubygem(%{rb_default_ruby_abi}:bundler) +Requires: %{name} = %{version}-%{release} + +Summary: Rails packaging support +Group: Development/Languages/Ruby + +%description rails +This package is needed for (generated) ruby gems. It provides hooks for +automatic rpm provides and requires and macros that gem2rpm uses. + +Rails packaging support files. + %prep %build @@ -78,13 +96,17 @@ install -D -m 0755 %{S:10} %{buildroot}/usr/lib/rpm/gem_packages.sh install -D -m 0644 %{S:11} %{buildroot}/usr/lib/rpm/gem_packages.template install -D -m 0755 %{S:12} %{buildroot}%{_bindir}/ruby-find-versioned +install -D -m 0644 %{S:13} %{buildroot}/usr/lib/rpm/fileattrs/gemfile.attr +install -D -m 0755 %{S:14} %{buildroot}/usr/lib/rpm/gemfile.rb +install -D -m 0644 %{S:15} %{buildroot}/etc/rpm/macros.rails +install -D -m 0755 %{S:16} %{buildroot}%{_bindir}/g2r %files %defattr(-,root,root) %if %{with ship_gemrc} %config /etc/gemrc %endif -%config /etc/rpm/macros.* +%config /etc/rpm/macros.*ruby* %dir /usr/lib/rpm/fileattrs /usr/lib/rpm/fileattrs/rubygems.attr /usr/lib/rpm/rubygemsdeps.rb @@ -93,5 +115,12 @@ /usr/lib/rpm/generate_buildrequires.sh /usr/lib/rpm/gem_packages.* %{_bindir}/ruby-find-versioned +%{_bindir}/g2r + +%files rails +%defattr(-,root,root) +%config /etc/rpm/macros.rails +/usr/lib/rpm/fileattrs/gemfile.attr +/usr/lib/rpm/gemfile.rb %changelog ++++++ g2r ++++++ #!/bin/sh if [ -e gem2rpm.yml ] ; then cfg="--config gem2rpm.yml" fi exec gem2rpm $cfg -o *spec *gem ++++++ gem_install.sh ++++++ --- /var/tmp/diff_new_pack.Zxfq2p/_old 2017-12-21 11:27:32.024844134 +0100 +++ /var/tmp/diff_new_pack.Zxfq2p/_new 2017-12-21 11:27:32.024844134 +0100 @@ -88,6 +88,9 @@ opts.on('--default-gem [FILENAME]', 'Which filename to use when we dont find another gem file.') do |fname| options.defaultgem=fname end + opts.on('--extconf-opts [EXTOPTS]', 'which options to pass to extconf') do |extopts| + options.extconfopts=extopts + end opts.on('--gem-binary [PATH]', 'Path to gem. By default we loop over all gem binaries we find') do |fname| GILogger.warn("The --gem-binary option is deprecated.") end @@ -178,6 +181,10 @@ cmdline = [gembinary, 'install', '--verbose', '--local', '--build-root', options.buildroot] cmdline += options.otheropts cmdline << options.gemfile +unless options.extconfopts.nil? + cmdline << '--' + cmdline << options.extconfopts +end GILogger.info "install cmdline: #{cmdline.inspect}" if Process.respond_to? :spawn pid = Process.spawn(*cmdline) ++++++ gemfile.attr ++++++ %__gemfile_requires %{_rpmconfigdir}/gemfile.rb --requires %__gemfile_path ^/.*\/Gemfile.lock$ ++++++ gemfile.rb ++++++ #!/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 ++++++ opensuse.spec.erb ++++++ --- /var/tmp/diff_new_pack.Zxfq2p/_old 2017-12-21 11:27:32.096840623 +0100 +++ /var/tmp/diff_new_pack.Zxfq2p/_new 2017-12-21 11:27:32.100840428 +0100 @@ -54,6 +54,8 @@ end rb_suffix = RbConfig::CONFIG['ruby_install_name'].gsub(/^ruby/, '') + # TODO: "ruby" hardcoded here is wrong. it should support jruby/rubinius or so + rb_abi = "ruby:#{RbConfig::CONFIG['ruby_version']}" rb_pkgname = RbConfig::CONFIG['ruby_install_name'].gsub(/^ruby\./, '') if rb_suffix =~ /\A\d+\.\d+\z/ rb_suffix = '.ruby' + rb_suffix @@ -70,6 +72,7 @@ gem_spec = Gem::Specification.new gem_base_dir = patch_libdir(gem_spec.base_dir) gem_cache_dir = patch_libdir(gem_spec.cache_dir) + gem_build_info_dir = patch_libdir(gem_spec.build_info_dir) gem_gems_dir = patch_libdir(gem_spec.gems_dir) gem_spec_dir = patch_libdir(gem_spec.spec_dir) gem_bin_dir = patch_libdir(patch_mod_full_name(gem_spec.bin_dir , mod_full_name )) @@ -101,7 +104,7 @@ %package -n <%= pkg_basename %>-doc<%= config[:version_suffix] %> Summary: RDoc documentation for <%= spec.name %> Group: Development/Languages/Ruby -Requires: <%= pkg_basename %><%= config[:version_suffix] %> = <%= spec.version %> +Requires: rubygem(<%= rb_abi %>:<%= spec.name %>) = <%= spec.version %> %description -n <%= pkg_basename %>-doc<%= config[:version_suffix] %> Documentation generated at gem installation time. @@ -146,7 +149,7 @@ %package -n <%= pkg_basename %>-testsuite<%= config[:version_suffix] %> Summary: Test suite for <%= spec.name %> Group: Development/Languages/Ruby -Requires: <%= pkg_basename %><%= config[:version_suffix] %> = <%= spec.version %> +Requires: rubygem(<%= rb_abi %>:<%= spec.name %>) = <%= spec.version %> %description -n <%= pkg_basename %>-testsuite<%= config[:version_suffix] %> Test::Unit or RSpec files, useful for developers. @@ -196,6 +199,7 @@ # cache file <%= gem_cache_dir %>/<%= mod_full_name %>.gem <%= gem_gem_dir %> +<%= gem_build_info_dir %> <% unless spec.extensions.empty? or gem_extension_dir.nil? -%> <%= gem_extension_dir %> <% end -%> @@ -231,7 +235,7 @@ Summary: <%= custom_pkg_name %> sub package for <%= spec.name %> Group: Development/Languages/Ruby <% end %> -Requires: <%= pkg_basename %><%= config[:version_suffix] %> = <%= spec.version %> +Requires: rubygem(<%= rb_abi %>:<%= spec.name %>) = <%= spec.version %> %description -n <%= pkg_basename %>-<%= custom_pkg_name %><%= config[:version_suffix] %> <% if data[:description] and data[:description] != '' -%> <%= data[:description] %> ++++++ rails.macros ++++++ %rails_save_gemfile() \ cp Gemfile{,.upstream} \ mv Gemfile.lock{,.upstream} \ %{nil} %rails_regen_gemfile_lock() \ find -type f -name .gitkeep -print -delete \ bundle exec rails --version \ diff -urN Gemfile.lock{.upstream,} ||: \ %{nil} %rails_write_appinfo() \ echo -e "---\\\n:ruby_abi: %{rb_build_abi}\\\n" > .appinfo.yml \ %{nil} %rails_fix_ruby_suffix() \ for S in $(grep -r -l '@RUBY_SUFFIX@' ${RPM_SOURCE_DIR}/ | grep -v '\.spec$') ; do \ SB="${S}.backup" \ cp ${S} ${SB} \ perl -p -i -e 's|\\\@RUBY_SUFFIX\\\@|%{rb_suffix}|g' "${S}" \ diff -urN ${SB} ${S} || : \ rm ${SB} \ done \ %{nil} %ruby_fix_shebang() \ %{nil} \ %{nil}
