Patches in a rubygem-* package...

Darryl L. Pierce dpierce at redhat.com
Tue Apr 10 14:32:24 UTC 2012


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}.

-- 
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.fedoraproject.org/pipermail/ruby-sig/attachments/20120410/ce86a58b/attachment.sig>


More information about the ruby-sig mailing list