Description of problem: - ruby193-rubygems-devel ship with some macros for convenient usage in other specs: -- %{gem_dir} macro, that defines the top dir of rubygems hierarchy -- %{gem_*} macros, that use %{gem_dir} to point to some of its subdirectories - the value of %{gem_dir} however points to /opt/rh/ruby193/... which makes _all_ the macros unusable in depending collections, since they need to point into their path - an easy (and generally wrong) solution is to redefine %{gem_dir} somewhere in the depending collection - but the macro file of that collection would have to be interpreted after macros.rubygems, meaning it would always need to be later in alphabetical order (which is wrong solution by design). There is a pretty nice way to solve it that uses the %scl_package_override macro: - define e.g. %ruby193_gem_dir that will hold the correct value, this will be part of macros.rubygems (generally a collection package other than the metapackage) - in metapackage macros file, use something like: %scl_package_override() {%global gem_dir %ruby193_gem_dir} Additional info: All packages in next release of RHSCL should fix it.
(In reply to Marcela Mašláňová from comment #0) > - in metapackage macros file, use something like: > > %scl_package_override() {%global gem_dir %ruby193_gem_dir} Isn't rather in the <main-scl-package>-build package ? > All packages in next release of RHSCL should fix it. Can you also open a bug against php54-php-pear which also provides lot of macros ?
(In reply to Remi Collet from comment #3) > (In reply to Marcela Mašláňová from comment #0) > > - in metapackage macros file, use something like: > > > > %scl_package_override() {%global gem_dir %ruby193_gem_dir} > > Isn't rather in the <main-scl-package>-build package ? > The comment was incorrect. Even ruby193 has those macros in -build subpackage. > > All packages in next release of RHSCL should fix it. > > Can you also open a bug against php54-php-pear which also provides lot of > macros ? Will do.
The problem with %gem_dir macro is that it's hardcoded during ruby build for ruby193. I believe this can be solved by altering %%gem_dir macro in macros.rubygems.ruby193: diff --git a/ruby.spec b/ruby.spec index 18fc482..b7452b6 100644 --- a/ruby.spec +++ b/ruby.spec @@ -427,7 +427,7 @@ EOF cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.rubygems%{?scl:.%{scl}} << \EOF # The RubyGems root folder. -%%gem_dir %{gem_dir} +%%gem_dir %%{_datadir}/gems # Common gem locations and files. %%gem_instdir %%{gem_dir}/gems/%%{gem_name}-%%{version} This way the macro will be expanding with each build depending on the -build sub-package of the depending collection. This is how it's done in ruby200 where this is no issue.
(In reply to Josef Stribny from comment #6) > The problem with %gem_dir macro is that it's hardcoded during ruby build for > ruby193. I believe this can be solved by altering %%gem_dir macro in > macros.rubygems.ruby193: > > diff --git a/ruby.spec b/ruby.spec > index 18fc482..b7452b6 100644 > --- a/ruby.spec > +++ b/ruby.spec > @@ -427,7 +427,7 @@ EOF > > cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.rubygems%{?scl:.%{scl}} > << \EOF > # The RubyGems root folder. > -%%gem_dir %{gem_dir} > +%%gem_dir %%{_datadir}/gems > > # Common gem locations and files. > %%gem_instdir %%{gem_dir}/gems/%%{gem_name}-%%{version} > > > This way the macro will be expanding with each build depending on the -build > sub-package of the depending collection. This is how it's done in ruby200 > where this is no issue. Fixed in rhbz#1034638