Just FTR, this is how the generators would be used in practice:
~~~
$ git diff
diff --git a/ruby.spec b/ruby.spec
index 1aea20b..51f3065 100644
--- a/ruby.spec
+++ b/ruby.spec
@@ -196,6 +196,11 @@ Source15: test_openssl_fips.rb
%{load:%{SOURCE4}}
%{load:%{SOURCE5}}
+%global __local_generator_requires make -C
%{_builddir}/%{buildsubdir}/%{_vpath_builddir} -s runruby
TESTRUN_SCRIPT="--enable-gems %{SOURCE9}"
+%global __local_generator_provides make -C
%{_builddir}/%{buildsubdir}/%{_vpath_builddir} -s runruby
TESTRUN_SCRIPT="--enable-gems %{SOURCE10}"
+%global __local_generator_conflicts make -C
%{_builddir}/%{buildsubdir}/%{_vpath_builddir} -s runruby
TESTRUN_SCRIPT="--enable-gems %{SOURCE11}"
+%global __local_generator_path ^%{gem_dir}/specifications/.*\.gemspec$
+
# Fix ruby_version abuse.
#
https://bugs.ruby-lang.org/issues/11002
Patch0: ruby-2.3.0-ruby_version.patch
@@ -229,6 +234,7 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Recommends: ruby(rubygems) >= %{rubygems_version}
Recommends: rubygem(bigdecimal) >= %{bigdecimal_version}
+BuildRequires: rpm-local-generator-support
# Build dependencies
BuildRequires: autoconf
BuildRequires: gcc
~~~
For your convenience, full ruby.spec file is available here:
https://src.fedoraproject.org/rpms/ruby/blob/rawhide/f/ruby.spec
Please note that this is the default rubygems.attr file we are
distributing with Ruby (actually via rubygems-devel package):
~~~
%__rubygems_requires %{_rpmconfigdir}/rubygems.req
%__rubygems_provides %{_rpmconfigdir}/rubygems.prov
%__rubygems_conflicts %{_rpmconfigdir}/rubygems.con
# In non-gem packages, the %%{gem_name} macro is not available and the macro
# stays unexpanded which leads to "invalid regex" error (rhbz#1154067).
%__rubygems_path
^%{?gem_name:%{gem_spec}}%{!?gem_name:this_should_never_match_anything}$
~~~
As you can see, we would not be able to use the generator even if it was
somehow available because it need Ruby for its execution. But Ruby is
not available for Ruby build, therefore we could not benefit from it
without changing the macros.
Vít
Dne 06. 10. 23 v 18:06 Vít Ondruch napsal(a):
I am still playing with idea of executing RPM dependency generators
on
the .spec file which ships them. I have created RPM RFE ticket quite a
while ago here:
https://github.com/rpm-software-management/rpm/issues/782
So for no luck with having this implemented.
However, I think there is reasonable way. It would be enough to have
some generic attr file around. I have create small test package
exploring this idea and you can find it in my Copr repo:
https://copr.fedorainfracloud.org/coprs/vondruch/rpm-local-generator/
https://copr-dist-git.fedorainfracloud.org/cgit/vondruch/rpm-local-genera...
On the same place, you can also find package leveraging this concept:
https://copr-dist-git.fedorainfracloud.org/cgit/vondruch/rpm-local-genera...
Would somebody else benefit from this idea/package or can somebody
spot some issue with it? Thx for feedback.
Vít