Can anybody point me to a good example of the right way to apply patches in a packaged gem?
Thanks.
Dne 9.4.2012 18:43, Darryl L. Pierce napsal(a):
Can anybody point me to a good example of the right way to apply patches in a packaged gem?
Thanks.
ruby-sig mailing list ruby-sig@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/ruby-sig
Hi,
I did patching in following gems: rubygem-sqlite3, rubygem-arel, rubygem-erubis. You can use them as an example.
Vit
On Tue, Apr 10, 2012 at 07:01:33AM +0200, Vít Ondruch wrote:
I did patching in following gems: rubygem-sqlite3, rubygem-arel, rubygem-erubis. You can use them as an example.
I used the rubygem-idn package an example and did the following:
pushd .. gem unpack %{SOURCE0} pushd %{gemname}-%{version}
gem spec %{SOURCE0} -l --ruby > %{gemname}.gemspec
%patch1 -p6 %patch2 -p6 %patch3 -p6 %patch4 -p6 %patch5 -p6 %patch6 -p6 %patch7 -p6
# eliminate the encoding-related entries in the gemspec sed ' # remove encoding_spec.rb s/,\ "spec/qpid/encoding_spec.rb"// # remove encoding.rb s/,\ "lib/qpid/encoding.rb"// # add in the new files for non-blocking I/O s/s.files\ =\ [/s.files\ =\ ["ext/nonblockio/extconf.rb",\ "ext/nonblockio/nonblockio.c",\ "ext/nonblockio/nonblockio.h",\ "ext/nonblockio/qpid_receiver.c",\ "ext/nonblockio/qpid_sender.c",\ "ext/nonblockio/qpid_session.c",\ "ext/nonblockio/qpid_utils.c",\ "lib/qpid/utils.rb",\ / ' %{gemname}.gemspec > %{gemname}.gemspec-1 cp -f %{gemname}.gemspec-1 %{gemname}.gemspec
gem build %{gemname}.gemspec --verbose cp -f %{gemname}-%{version}.gem %{SOURCE0}
And then do the installation using the modified gem rather than the original %{SOURCE0}.
Dne 10.4.2012 16:32, Darryl L. Pierce napsal(a):
On Tue, Apr 10, 2012 at 07:01:33AM +0200, Vít Ondruch wrote:
I did patching in following gems: rubygem-sqlite3, rubygem-arel, rubygem-erubis. You can use them as an example.
I used the rubygem-idn package an example and did the following:
pushd .. gem unpack %{SOURCE0} pushd %{gemname}-%{version}
gem spec %{SOURCE0} -l --ruby> %{gemname}.gemspec
%patch1 -p6 %patch2 -p6 %patch3 -p6 %patch4 -p6 %patch5 -p6 %patch6 -p6 %patch7 -p6
# eliminate the encoding-related entries in the gemspec sed ' # remove encoding_spec.rb s/,\ "spec/qpid/encoding_spec.rb"// # remove encoding.rb s/,\ "lib/qpid/encoding.rb"// # add in the new files for non-blocking I/O s/s.files\ =\ [/s.files\ =\ ["ext/nonblockio/extconf.rb",\ "ext/nonblockio/nonblockio.c",\ "ext/nonblockio/nonblockio.h",\ "ext/nonblockio/qpid_receiver.c",\ "ext/nonblockio/qpid_sender.c",\ "ext/nonblockio/qpid_session.c",\ "ext/nonblockio/qpid_utils.c",\ "lib/qpid/utils.rb",\ / ' %{gemname}.gemspec> %{gemname}.gemspec-1 cp -f %{gemname}.gemspec-1 %{gemname}.gemspec
gem build %{gemname}.gemspec --verbose cp -f %{gemname}-%{version}.gem %{SOURCE0}
And then do the installation using the modified gem rather than the original %{SOURCE0}.
Ah, you were speaking about patching gem with binary extension. Yes, then the rubygem-idn should be good example.
BTW I see you are using %{gemname} macro, while for Fedora => 17 %{gem_name} macro is preferred.
Vit
On Wed, Apr 11, 2012 at 09:28:08AM +0200, Vít Ondruch wrote:
Ah, you were speaking about patching gem with binary extension. Yes, then the rubygem-idn should be good example.
BTW I see you are using %{gemname} macro, while for Fedora => 17 %{gem_name} macro is preferred.
Those packages I maintain will get upgraded if they're not already for 17+.
ruby-sig@lists.fedoraproject.org