Compare commits
1 Commits
Author | SHA256 | Date | |
---|---|---|---|
4adcbac7d2 |
@@ -7,7 +7,6 @@ export LC_ALL="en_US.UTF-8"
|
|||||||
export LANG="en_US.UTF-8"
|
export LANG="en_US.UTF-8"
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
for ruby in $(/usr/bin/ruby-find-versioned) ; do
|
for ruby in $(/usr/bin/ruby-find-versioned) ; do
|
||||||
export GEM_HOME="$(${ruby} -r rubygems -e 'puts Gem.default_dir')"
|
|
||||||
$ruby -x $0 "$@"
|
$ruby -x $0 "$@"
|
||||||
done
|
done
|
||||||
exit $?
|
exit $?
|
||||||
|
@@ -57,7 +57,5 @@ export LC_ALL="en_US.UTF-8"
|
|||||||
export LANG="en_US.UTF-8"
|
export LANG="en_US.UTF-8"
|
||||||
set -x
|
set -x
|
||||||
for gr in $(/usr/bin/ruby-find-versioned gem2rpm) ; do
|
for gr in $(/usr/bin/ruby-find-versioned gem2rpm) ; do
|
||||||
ruby_suffix=${gr##/usr/bin/gem2rpm}
|
|
||||||
export GEM_HOME="$(/usr/bin/ruby${ruby_suffix} -r rubygems -e 'puts Gem.default_dir')"
|
|
||||||
$gr $otheropts
|
$gr $otheropts
|
||||||
done
|
done
|
||||||
|
@@ -13,34 +13,6 @@
|
|||||||
path
|
path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def self.rpm_suffix_for_feature(feature)
|
|
||||||
rpm_prefix = nil
|
|
||||||
|
|
||||||
package_name = RbConfig::CONFIG['RUBY_SO_NAME']
|
|
||||||
|
|
||||||
IO.popen("rpm -q --provides #{package_name}") {|rpm_io|
|
|
||||||
rpm_provides = rpm_io.read
|
|
||||||
mo = /(?<rpm_prefix>with(out)?-#{feature})/.match(rpm_provides)
|
|
||||||
|
|
||||||
if mo
|
|
||||||
rpm_prefix = mo[:rpm_prefix]
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
rpm_prefix
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.requires_for_feature(feature)
|
|
||||||
found_rpm_prefix = rpm_suffix_for_feature(feature)
|
|
||||||
|
|
||||||
if found_rpm_prefix
|
|
||||||
return "Requires: #{RbConfig::CONFIG['RUBY_SO_NAME']}-#{found_rpm_prefix} >= #{RbConfig::CONFIG['RUBY_PROGRAM_VERSION']}"
|
|
||||||
end
|
|
||||||
#
|
|
||||||
return ""
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.get_extension_doc_dir(gem_spec)
|
def self.get_extension_doc_dir(gem_spec)
|
||||||
return nil unless Gem.ruby_engine == 'ruby' && Gem::Requirement.new("~> 2.1.0").satisfied_by?(Gem.ruby_version)
|
return nil unless Gem.ruby_engine == 'ruby' && Gem::Requirement.new("~> 2.1.0").satisfied_by?(Gem.ruby_version)
|
||||||
if gem_spec.respond_to?(:extensions_dir)
|
if gem_spec.respond_to?(:extensions_dir)
|
||||||
@@ -89,21 +61,7 @@
|
|||||||
custom_pkgs
|
custom_pkgs
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.fix_up_rubygem_requires_with_rb_api(rb_api, preamble_text)
|
rb_pkg_abi = "#{RUBY_ENGINE}:#{RUBY_ENGINE_VERSION}:#{spec.name}"
|
||||||
STDERR.puts(preamble_text)
|
|
||||||
preamble_text.lines.map do |line|
|
|
||||||
if mo = /^(?<pre_text>\s*\S+\s*:\s+rubygem\()(?<pkg_info>[^\)]+)(?<post_text>\).*)?$/.match(line)
|
|
||||||
if not(mo[:pkg_info] =~ /^ruby:\d\.\d\.\d/)
|
|
||||||
line = "#{mo[:pre_text]}#{rb_api}:#{mo[:pkg_info]}#{mo[:post_text]}"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
line
|
|
||||||
end.join("\n")
|
|
||||||
end
|
|
||||||
|
|
||||||
rb_api = "#{RUBY_ENGINE}:#{RbConfig::CONFIG['ruby_version']}"
|
|
||||||
|
|
||||||
rb_pkg_abi = "#{rb_api}:#{spec.name}"
|
|
||||||
|
|
||||||
rb_suffix = RbConfig::CONFIG['ruby_install_name'].gsub(/^ruby/, '')
|
rb_suffix = RbConfig::CONFIG['ruby_install_name'].gsub(/^ruby/, '')
|
||||||
rb_pkgname = RbConfig::CONFIG['ruby_install_name'].gsub(/^ruby\./, '')
|
rb_pkgname = RbConfig::CONFIG['ruby_install_name'].gsub(/^ruby\./, '')
|
||||||
@@ -146,20 +104,16 @@
|
|||||||
%package -n <%= pkg_basename %><%= config[:version_suffix] %>
|
%package -n <%= pkg_basename %><%= config[:version_suffix] %>
|
||||||
# MANUAL
|
# MANUAL
|
||||||
<% if config[:main] && config[:main][:preamble] -%>
|
<% if config[:main] && config[:main][:preamble] -%>
|
||||||
<%= fix_up_rubygem_requires_with_rb_api(rb_api, config[:main][:preamble]) %>
|
<%= config[:main][:preamble] %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
# /MANUAL
|
# /MANUAL
|
||||||
<% unless spec.extensions.empty? -%>
|
|
||||||
<%= requires_for_feature('jemalloc') %>
|
|
||||||
<%= requires_for_feature('yjit') %>
|
|
||||||
<% end -%>
|
|
||||||
Summary: <%= config[:summary] or spec.summary %>
|
Summary: <%= config[:summary] or spec.summary %>
|
||||||
|
Group: Development/Languages/Ruby
|
||||||
<% unless spec.executables.empty? -%>
|
<% unless spec.executables.empty? -%>
|
||||||
Requires(preun): update-alternatives
|
PreReq: update-alternatives
|
||||||
Requires(post): update-alternatives
|
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% if has_plugins -%>
|
<% if has_plugins -%>
|
||||||
Conflicts: rubygem(<%= rb_pkg_abi %>) = %{version}
|
Conflicts: rubygem(<%= rb_pkg_abi %>)
|
||||||
<% end -%>
|
<% end -%>
|
||||||
Enhances: <%= rb_pkgname %>
|
Enhances: <%= rb_pkgname %>
|
||||||
|
|
||||||
@@ -169,6 +123,7 @@ Enhances: <%= rb_pkgname %>
|
|||||||
<% if spec.has_rdoc? && !(config[:disable_docs]) -%>
|
<% if spec.has_rdoc? && !(config[:disable_docs]) -%>
|
||||||
%package -n <%= pkg_basename %>-doc<%= config[:version_suffix] %>
|
%package -n <%= pkg_basename %>-doc<%= config[:version_suffix] %>
|
||||||
Summary: RDoc documentation for <%= spec.name %>
|
Summary: RDoc documentation for <%= spec.name %>
|
||||||
|
Group: Development/Languages/Ruby
|
||||||
Requires: <%= pkg_basename %><%= config[:version_suffix] %> = <%= spec.version %>
|
Requires: <%= pkg_basename %><%= config[:version_suffix] %> = <%= spec.version %>
|
||||||
|
|
||||||
%description -n <%= pkg_basename %>-doc<%= config[:version_suffix] %>
|
%description -n <%= pkg_basename %>-doc<%= config[:version_suffix] %>
|
||||||
@@ -213,6 +168,7 @@ Usually in RDoc and RI formats.
|
|||||||
<% unless test_frameworks.empty? -%>
|
<% unless test_frameworks.empty? -%>
|
||||||
%package -n <%= pkg_basename %>-testsuite<%= config[:version_suffix] %>
|
%package -n <%= pkg_basename %>-testsuite<%= config[:version_suffix] %>
|
||||||
Summary: Test suite for <%= spec.name %>
|
Summary: Test suite for <%= spec.name %>
|
||||||
|
Group: Development/Languages/Ruby
|
||||||
Requires: <%= pkg_basename %><%= config[:version_suffix] %> = <%= spec.version %>
|
Requires: <%= pkg_basename %><%= config[:version_suffix] %> = <%= spec.version %>
|
||||||
|
|
||||||
%description -n <%= pkg_basename %>-testsuite<%= config[:version_suffix] %>
|
%description -n <%= pkg_basename %>-testsuite<%= config[:version_suffix] %>
|
||||||
@@ -243,13 +199,13 @@ fi
|
|||||||
|
|
||||||
%files -n <%= pkg_basename %><%= config[:version_suffix] %>
|
%files -n <%= pkg_basename %><%= config[:version_suffix] %>
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
<% if config[:main] && config[:main][:filelist] -%>
|
|
||||||
# MANUAL
|
# MANUAL
|
||||||
<%= config[:main][:filelist] %>
|
<% if config[:main] && config[:main][:filelist] -%>
|
||||||
# /MANUAL
|
<%= config[:main][:filelist] -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
# /MANUAL
|
||||||
<% unless docdirfiles.empty? -%>
|
<% unless docdirfiles.empty? -%>
|
||||||
%doc <%= docdir %>/<%= pkg_basename %><%= config[:version_suffix] %>
|
<%= docdir %>/<%= pkg_basename %><%= config[:version_suffix] %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% spec.executables.each do |executable| -%>
|
<% spec.executables.each do |executable| -%>
|
||||||
<%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %>
|
<%= rb_bindir %>/<%= "#{executable}#{rb_suffix}-#{spec.version}" %>
|
||||||
@@ -300,6 +256,7 @@ fi
|
|||||||
<%= data[:preamble] %>
|
<%= data[:preamble] %>
|
||||||
<% else %>
|
<% else %>
|
||||||
Summary: <%= custom_pkg_name %> sub package for <%= spec.name %>
|
Summary: <%= custom_pkg_name %> sub package for <%= spec.name %>
|
||||||
|
Group: Development/Languages/Ruby
|
||||||
<% end %>
|
<% end %>
|
||||||
Requires: <%= pkg_basename %><%= config[:version_suffix] %> = <%= spec.version %>
|
Requires: <%= pkg_basename %><%= config[:version_suffix] %> = <%= spec.version %>
|
||||||
%description -n <%= pkg_basename %>-<%= custom_pkg_name %><%= config[:version_suffix] %>
|
%description -n <%= pkg_basename %>-<%= custom_pkg_name %><%= config[:version_suffix] %>
|
||||||
|
@@ -1,84 +1,3 @@
|
|||||||
-------------------------------------------------------------------
|
|
||||||
Wed Jan 22 10:27:14 UTC 2025 - Marcus Rueckert <mrueckert@suse.de>
|
|
||||||
|
|
||||||
- do not generate unversioned conflicts
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Tue Oct 8 00:27:46 UTC 2024 - Marcus Rueckert <mrueckert@suse.de>
|
|
||||||
|
|
||||||
- update gem_packages.spec.erb by syncing with gem2rpm
|
|
||||||
- drop group tag
|
|
||||||
- only emit manual comments if we actually put out content
|
|
||||||
- mark docs explicitely with the %doc tag
|
|
||||||
- stop using deprecated PreReq for update-alternatives
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Sat Sep 28 00:00:32 UTC 2024 - Marcus Rueckert <mrueckert@suse.de>
|
|
||||||
|
|
||||||
- update gem_packages.spec.erb:
|
|
||||||
dont strip the newline at the end of main:filelist output
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Fri Jun 7 13:52:41 UTC 2024 - Marcus Rueckert <mrueckert@suse.de>
|
|
||||||
|
|
||||||
- refactor the jemalloc requires code so that it can accomodate
|
|
||||||
more feature flags
|
|
||||||
- add requires for yjit enabled ruby
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Thu Nov 16 14:20:31 UTC 2023 - Marcus Rueckert <mrueckert@suse.de>
|
|
||||||
|
|
||||||
- gem_cleanup macro: yet another place which got hit by ruby 3.3
|
|
||||||
replace `gem env gemdir` with
|
|
||||||
`ruby -r rubygems -e 'puts Gem.default_dir'`
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Tue Nov 14 10:29:27 UTC 2023 - Marcus Rueckert <mrueckert@suse.de>
|
|
||||||
|
|
||||||
- Fix for the previous change. we need to set the GEM_HOME before
|
|
||||||
even wrapping into the re-exec with ruby.
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Mon Nov 13 20:51:12 UTC 2023 - Marcus Rueckert <mrueckert@suse.de>
|
|
||||||
|
|
||||||
- add workaround for https://github.com/rubygems/rubygems/commit/64273fd7e3
|
|
||||||
for now we will always set GEM_HOME to ensure that this new logic
|
|
||||||
does not break our paths
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Sat Nov 4 00:41:49 UTC 2023 - Marcus Rueckert <mrueckert@suse.de>
|
|
||||||
|
|
||||||
- ensure that gems built against an jemalloc enabled ruby
|
|
||||||
also pulls a ruby version that is built with jemalloc
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Fri May 12 21:28:54 UTC 2023 - Marcus Rueckert <mrueckert@suse.de>
|
|
||||||
|
|
||||||
- bump the version so we can require the new version to make it
|
|
||||||
easier to depend on the new functionality
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Fri May 12 14:21:14 UTC 2023 - Marcus Rueckert <mrueckert@suse.de>
|
|
||||||
|
|
||||||
- Support runtime dependencies for the generated subpackages:
|
|
||||||
syntax:
|
|
||||||
|
|
||||||
Requires: rubygem(gemname)
|
|
||||||
Recommends: rubygem(gemname:x) >= x.y
|
|
||||||
|
|
||||||
This will be transformed into
|
|
||||||
|
|
||||||
Requires: rubygem(ruby:<rubyabi>:gemname)
|
|
||||||
Recommends: rubygem(ruby:<rubyabi>:gemname:x) >= x.y
|
|
||||||
|
|
||||||
That way we ensure that every package only requires rubygems for
|
|
||||||
the current ruby version.
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Sun May 7 10:28:13 UTC 2023 - Jan Engelhardt <jengelh@inai.de>
|
|
||||||
|
|
||||||
- Remove old specfile constructs
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun May 7 00:35:06 UTC 2023 - Marcus Rueckert <mrueckert@suse.de>
|
Sun May 7 00:35:06 UTC 2023 - Marcus Rueckert <mrueckert@suse.de>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package ruby-common
|
# spec file for package ruby-common
|
||||||
#
|
#
|
||||||
# Copyright (c) 2025 SUSE LLC
|
# Copyright (c) 2023 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
Name: ruby-common
|
Name: ruby-common
|
||||||
Version: 3.2.1
|
Version: 3.2
|
||||||
Release: 0
|
Release: 0
|
||||||
# ruby-macros and ruby-common version
|
# ruby-macros and ruby-common version
|
||||||
%define rpm_macros_version 5
|
%define rpm_macros_version 5
|
||||||
@@ -124,6 +124,7 @@ install -D -m 0755 %{S:19} %{buildroot}%{_bindir}/bundler-dumpdeps
|
|||||||
install -D -m 0644 %{S:17} %{buildroot}/usr/lib/rpm/fileattrs/rubygems_bundled.attr
|
install -D -m 0644 %{S:17} %{buildroot}/usr/lib/rpm/fileattrs/rubygems_bundled.attr
|
||||||
|
|
||||||
%files
|
%files
|
||||||
|
%defattr(-,root,root)
|
||||||
%if %{with ship_gemrc}
|
%if %{with ship_gemrc}
|
||||||
%config /etc/gemrc
|
%config /etc/gemrc
|
||||||
%endif
|
%endif
|
||||||
@@ -140,10 +141,12 @@ install -D -m 0644 %{S:17} %{buildroot}/usr/lib/rpm/fileattrs/rubygems_bundled.a
|
|||||||
%{_bindir}/g2r
|
%{_bindir}/g2r
|
||||||
|
|
||||||
%files -n ruby-packaging-helpers
|
%files -n ruby-packaging-helpers
|
||||||
|
%defattr(-,root,root)
|
||||||
%{_bindir}/irp
|
%{_bindir}/irp
|
||||||
%{_bindir}/bundler-dumpdeps
|
%{_bindir}/bundler-dumpdeps
|
||||||
|
|
||||||
%files rails
|
%files rails
|
||||||
|
%defattr(-,root,root)
|
||||||
%{_rpmmacrodir}/macros.rails
|
%{_rpmmacrodir}/macros.rails
|
||||||
/usr/lib/rpm/fileattrs/gemfile.attr
|
/usr/lib/rpm/fileattrs/gemfile.attr
|
||||||
/usr/lib/rpm/gemfile.rb
|
/usr/lib/rpm/gemfile.rb
|
||||||
|
@@ -78,8 +78,8 @@ cd $GEMSPEC_SOURCE_DIR && %{gem_binary} build --verbose %{mod_name}-%{version}.g
|
|||||||
|
|
||||||
# we need to copy parts of the %fdupes macro as rpm can't expand parameters in macro "calls" ;(
|
# we need to copy parts of the %fdupes macro as rpm can't expand parameters in macro "calls" ;(
|
||||||
%gem_cleanup() \
|
%gem_cleanup() \
|
||||||
for ruby in $(/usr/bin/ruby-find-versioned ruby) ; do \
|
for gem in $(/usr/bin/ruby-find-versioned gem) ; do \
|
||||||
gem_base="$(${ruby} -r rubygems -e 'puts Gem.default_dir')" \
|
gem_base="$($gem env gemdir)" \
|
||||||
/usr/lib/rpm/gem_build_cleanup.sh %{buildroot}${gem_base} \
|
/usr/lib/rpm/gem_build_cleanup.sh %{buildroot}${gem_base} \
|
||||||
fdupes -q -p -n -r -o name %{buildroot}${gem_base} | \
|
fdupes -q -p -n -r -o name %{buildroot}${gem_base} | \
|
||||||
while read _file; do \
|
while read _file; do \
|
||||||
|
Reference in New Issue
Block a user