From 00192b0f0a1d3e8b627016f3cc0c3c23130f26cfafa90c8fc13ad8273395a644 Mon Sep 17 00:00:00 2001 From: Marcus Rueckert Date: Fri, 23 Feb 2024 13:58:19 +0000 Subject: [PATCH] Accepting request 1149960 from home:darix:apps - Added 0034-plugin-dir.patch - also own the new gem plugin dir - Added 0035-fix-patch-syntax.patch: Fix patch syntax for the upcoming rpm 4.20 OBS-URL: https://build.opensuse.org/request/show/1149960 OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/rubygem-gem2rpm?expand=0&rev=58 --- 0034-plugin-dir.patch | 74 +++++++++++++++++++++++++++++++++++++ 0035-fix-patch-syntax.patch | 13 +++++++ rubygem-gem2rpm.changes | 8 ++++ rubygem-gem2rpm.spec | 39 +++---------------- series | 68 ++++++++++++++++++---------------- 5 files changed, 136 insertions(+), 66 deletions(-) create mode 100644 0034-plugin-dir.patch create mode 100644 0035-fix-patch-syntax.patch diff --git a/0034-plugin-dir.patch b/0034-plugin-dir.patch new file mode 100644 index 0000000..e3289bb --- /dev/null +++ b/0034-plugin-dir.patch @@ -0,0 +1,74 @@ +Index: gem2rpm-0.10.1/templates/gem_packages.spec.erb +=================================================================== +--- gem2rpm-0.10.1.orig/templates/gem_packages.spec.erb ++++ gem2rpm-0.10.1/templates/gem_packages.spec.erb +@@ -7,7 +7,7 @@ + def self.patch_mod_full_name(path, mod_full_name) + path.gsub(/\/-/, "/#{mod_full_name}") + end +- ++ + def self.patch_libdir(path) + # path ? path.gsub(/\/usr\/lib(64)?/, '%{_libdir}') : path + path +@@ -17,7 +17,7 @@ + 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) + rp = gem_spec.extensions_dir.rpartition(gem_spec.base_dir) +- return File.join(rp[1], 'doc', rp[2]) ++ return File.join(rp[1], 'doc', rp[2]) + end + return nil + end +@@ -26,7 +26,7 @@ + versions=spec.version.to_s.split('.') + begin v1=Integer(versions[0]) rescue v1=1 end + begin v2=Integer(versions[1]) rescue v2=0 end +- begin v3=Integer(versions[2]) rescue v3=0 end ++ begin v3=Integer(versions[2]) rescue v3=0 end + weight=v1*10000+v2*100+v3 + end + +@@ -60,7 +60,7 @@ + end + custom_pkgs + 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']}" +@@ -71,7 +71,7 @@ + pkg_basename = rb_pkgname + '-rubygem-' + spec.name + + mod_full_name = "#{spec.name}-#{spec.version}" +- mod_weight = get_mod_weight(spec) ++ mod_weight = get_mod_weight(spec) + + gem_platform = Gem::Platform.new(RbConfig::CONFIG["arch"]).to_s + rb_bindir = RbConfig::CONFIG['bindir'] +@@ -92,6 +92,7 @@ + gem_extension_dir = gem_spec.respond_to?(:extension_dir) ? patch_libdir(patch_mod_full_name(gem_spec.extension_dir, mod_full_name)) : nil + gem_extension_doc = patch_libdir(get_extension_doc_dir(gem_spec)) + #/ruby2.1 ++ gem_plugins_dir = Gem::Version.new(Gem::VERSION) >= Gem::Version.new("3.2.0") ? File.join(gem_spec.base_dir, 'plugins') : nil + %> + %package -n <%= pkg_basename %><%= config[:version_suffix] %> + # MANUAL +@@ -207,6 +208,7 @@ fi + # cache file + <%= gem_cache_dir %>/<%= mod_full_name %>.gem + <%= gem_gem_dir %> ++<%= gem_plugins_dir %> + <%= gem_build_info_dir %> + <% unless spec.extensions.empty? or gem_extension_dir.nil? -%> + <%= gem_extension_dir %> +@@ -235,7 +237,7 @@ fi + <% + if config[:custom_pkgs_ruby_versioned] + config[:custom_pkgs_ruby_versioned].each do |custom_pkg_name, data| +--%> ++-%> + %package -n <%= pkg_basename %>-<%= custom_pkg_name %><%= config[:version_suffix] %> + <% if data[:preamble] and data[:preamble] != '' -%> + <%= data[:preamble] %> diff --git a/0035-fix-patch-syntax.patch b/0035-fix-patch-syntax.patch new file mode 100644 index 0000000..781bd4b --- /dev/null +++ b/0035-fix-patch-syntax.patch @@ -0,0 +1,13 @@ +Index: gem2rpm-0.10.1/templates/opensuse.spec.erb +=================================================================== +--- gem2rpm-0.10.1.orig/templates/opensuse.spec.erb ++++ gem2rpm-0.10.1/templates/opensuse.spec.erb +@@ -141,7 +141,7 @@ PreReq: update-alternatives + <% unless config[:patches].nil? or config[:patches].empty? -%> + %gem_unpack + <% config[:patches].each_with_index do |patch, i| -%> +-%patch<%= i %> <%= patch[1] if patch[1] %> ++%patch -P <%= i %> <%= patch[1] if patch[1] %> + <% end -%> + <% if config[:post_patch] -%> + # MANUAL diff --git a/rubygem-gem2rpm.changes b/rubygem-gem2rpm.changes index 853b9ca..7a7ffff 100644 --- a/rubygem-gem2rpm.changes +++ b/rubygem-gem2rpm.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Feb 23 13:07:37 UTC 2024 - Marcus Rueckert + +- Added 0034-plugin-dir.patch + - also own the new gem plugin dir +- Added 0035-fix-patch-syntax.patch: + Fix patch syntax for the upcoming rpm 4.20 + ------------------------------------------------------------------- Mon Dec 25 07:15:47 UTC 2023 - Marcus Rueckert diff --git a/rubygem-gem2rpm.spec b/rubygem-gem2rpm.spec index c231545..2ccee7f 100644 --- a/rubygem-gem2rpm.spec +++ b/rubygem-gem2rpm.spec @@ -29,7 +29,9 @@ %bcond_with ruby24 %endif %bcond_with ruby25 +%if ! (0%{?suse_version} == 1550) %bcond_with ruby26 +%endif %bcond_with ruby27 %bcond_with ruby30 %bcond_with ruby31 @@ -91,6 +93,8 @@ Patch30: 0030-gem_package.spec.erb-sync-with-ruby-common.patch Patch31: 0031-use-template-opensuse-on-openSUSE-Tumbleweed-where-e.patch Patch32: 0032-Replace-no-rdoc-no-ri-with-no-document.patch Patch33: 0033-Use-File.exist-instead-of-File.exists-which-was-remo.patch +Patch34: 0034-plugin-dir.patch +Patch35: 0035-fix-patch-syntax.patch Patch128: template_loader.patch Summary: Generate rpm specfiles from gems License: GPL-2.0-or-later @@ -104,40 +108,7 @@ The spec file tries to follow the gem as closely as possible %prep %gem_unpack -%patch01 -p1 -%patch02 -p1 -%patch03 -p1 -%patch04 -p1 -%patch05 -p1 -%patch06 -p1 -%patch07 -p1 -%patch08 -p1 -%patch09 -p1 -%patch10 -p1 -%patch11 -p1 -%patch12 -p1 -%patch13 -p1 -%patch14 -p1 -%patch15 -p1 -%patch16 -p1 -%patch17 -p1 -%patch18 -p1 -%patch19 -p1 -%patch20 -p1 -%patch21 -p1 -%patch22 -p1 -%patch23 -p1 -%patch24 -p1 -%patch25 -p1 -%patch26 -p1 -%patch27 -p1 -%patch28 -p1 -%patch29 -p1 -%patch30 -p1 -%patch31 -p1 -%patch32 -p1 -%patch33 -p1 -%patch128 -p1 +%autopatch -p1 %build perl -p -i -e 's|("templates/opensuse.spec.erb".freeze)|$1, "templates/gem_packages.spec.erb".freeze|g' *gemspec diff --git a/series b/series index 2db1c5a..026c82b 100644 --- a/series +++ b/series @@ -1,32 +1,36 @@ -0001-use-the-ID-from-os-release-to-use-the-proper-templat.patch -p1 -0002-added-basic-config-file-support-to-gem2rpm-in-yaml-f.patch -p1 -0003-new-opensuse-templates.-they-require-the-config-file.patch -p1 -0004-added-example-gem2rpm.yml.patch -p1 -0005-properly-shorten-description-and-summary.patch -p1 -0006-Preserve-the-license-header-found-in-the-output-file.patch -p1 -0007-fixes-for-the-opensuse-template.patch -p1 -0008-do-not-use-not-.-not-supported-on-1.8-e.g.patch -p1 -0009-No-longer-require-the-ruby-version-inside-the-subpac.patch -p1 -0010-Try-to-load-rbconfigpackagingsupport-and-fail-gracef.patch -p1 -0011-Add-support-for-scripts-pre-post-for-subpackages.patch -p1 -0012-typo-in-gem2rpm.yml.documentation-custom_pkgs-instea.patch -p1 -0013-Also-tag-LICENSE-MIT-as-docfile.patch -p1 -0014-Refactor-into-multiple-lines.patch -p1 -0015-Add-licence-to-the-list-of-license-files-as-well.patch -p1 -0016-add-two-more-ways-to-express-changes.patch -p1 -0017-.markdown-is-also-seen-in-the-wild.patch -p1 -0018-Only-use-the-extensions-doc-dir-on-MRI-2.1.x.patch -p1 -0019-Cleaner-solution-for-the-extensions-doc-dir.patch -p1 -0020-Ruby-1.8-insists-on-the-for-the-parameter.patch -p1 -0021-Fix-company-name-in-copyright-header.patch -p1 -0022-add-the-touch-for-build-compare-to-the-template.patch -p1 -0023-Also-tag-APACHE-LICENSE-2.0-as-docfile.patch -p1 -0024-add-ability-to-provide-alternative-main-Source.patch -p1 -0025-allow-running-commands-after-patching.patch -p1 -0026-use-https-instead-of-http-for-rubygems.org.patch -p1 -0027-quote-version_suffix-in-gem2rpm.yml.documentation-to.patch -p1 -0028-add-binary_map-support.patch -p1 -0029-Use-or-for-the-conditions-instead-of-and.patch -p1 -0030-gem_package.spec.erb-sync-with-ruby-common.patch -p1 -0031-use-template-opensuse-on-openSUSE-Tumbleweed-where-e.patch -p1 -0032-Replace-no-rdoc-no-ri-with-no-document.patch -p1 +0001-use-the-ID-from-os-release-to-use-the-proper-templat.patch +0002-added-basic-config-file-support-to-gem2rpm-in-yaml-f.patch +0003-new-opensuse-templates.-they-require-the-config-file.patch +0004-added-example-gem2rpm.yml.patch +0005-properly-shorten-description-and-summary.patch +0006-Preserve-the-license-header-found-in-the-output-file.patch +0007-fixes-for-the-opensuse-template.patch +0008-do-not-use-not-.-not-supported-on-1.8-e.g.patch +0009-No-longer-require-the-ruby-version-inside-the-subpac.patch +0010-Try-to-load-rbconfigpackagingsupport-and-fail-gracef.patch +0011-Add-support-for-scripts-pre-post-for-subpackages.patch +0012-typo-in-gem2rpm.yml.documentation-custom_pkgs-instea.patch +0013-Also-tag-LICENSE-MIT-as-docfile.patch +0014-Refactor-into-multiple-lines.patch +0015-Add-licence-to-the-list-of-license-files-as-well.patch +0016-add-two-more-ways-to-express-changes.patch +0017-.markdown-is-also-seen-in-the-wild.patch +0018-Only-use-the-extensions-doc-dir-on-MRI-2.1.x.patch +0019-Cleaner-solution-for-the-extensions-doc-dir.patch +0020-Ruby-1.8-insists-on-the-for-the-parameter.patch +0021-Fix-company-name-in-copyright-header.patch +0022-add-the-touch-for-build-compare-to-the-template.patch +0023-Also-tag-APACHE-LICENSE-2.0-as-docfile.patch +0024-add-ability-to-provide-alternative-main-Source.patch +0025-allow-running-commands-after-patching.patch +0026-use-https-instead-of-http-for-rubygems.org.patch +0027-quote-version_suffix-in-gem2rpm.yml.documentation-to.patch +0028-add-binary_map-support.patch +0029-Use-or-for-the-conditions-instead-of-and.patch +0030-gem_package.spec.erb-sync-with-ruby-common.patch +0031-use-template-opensuse-on-openSUSE-Tumbleweed-where-e.patch +0032-Replace-no-rdoc-no-ri-with-no-document.patch +0033-Use-File.exist-instead-of-File.exists-which-was-remo.patch +0034-plugin-dir.patch +0035-fix-patch-syntax.patch +template_loader.patch