Patches in a rubygem-* package...
Vít Ondruch
vondruch at redhat.com
Wed Apr 11 07:28:08 UTC 2012
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
More information about the ruby-sig
mailing list