Ruby RRDtool bindings and CentOS 5

73 views
Skip to first unread message

Duncan Hill

unread,
Apr 8, 2008, 11:37:03 AM4/8/08
to puppet...@googlegroups.com
For whatever reason, the RPMForge package ruby-rrdtool doesn't play
nice on my CentOS 5.1 box with puppetmaster. It installs
site_ruby/1.8/i386-linux/RRD.so, which puppetmaster is unable to find
(and the suggested test of ruby -rRRDtool -e 'puts :yep' fails).
Using ln to link RRD.so to RRDtool.so works for the command line test,
but still fails for puppetmaster. This probably comes down to the
fact that RRD.so doesn't have an Init_RRDtool, but Init_RRD.

For those who like to roll their own packages for RPM based systems,
the following may be useful for you (it Works For Me). Use it at your
own risk, etc. The hardcode of 1.8 is probably a bad thing, but I'll
cross that bridge when I have to.

Summary: Ruby RRD bindings
Name: RubyRRDtool
Version: 0.6.0
Release: 1
Epoch: 1
License: MIT
Group: Application/Development
Source0: %{name}-%{version}.tgz
URL: http://rubyforge.org/projects/rubyrrdtool/
BuildRoot: %{_tmppath}/%{name}-root
Requires: rrdtool, ruby
BuildRequires: ruby, gcc, rrdtool-devel
%define debug_package %{nil}

%description
RRD bindings for Ruby.

%prep
%setup -q

%build
ruby extconf.rb
make

%install
install -D -m0644 RRDtool.so
%{buildroot}/usr/lib/ruby/site_ruby/1.8/i386-linux/RRDtool.so

%clean
rm -rf %{buildroot}

%post

%postun

%files
%defattr(-, root, root)
/usr/lib/ruby/site_ruby/1.8/i386-linux/RRDtool.so

Chris MacLeod

unread,
Apr 8, 2008, 3:29:23 PM4/8/08
to puppet...@googlegroups.com
I've run into this same issue, and was considering just deploying the RRDTool.so file by itself.  Though that's pretty ugly.  

 
C
--
sti...@gmail.com
-==< Stick >==-

Ohad Levy

unread,
Apr 9, 2008, 4:46:41 AM4/9/08
to puppet...@googlegroups.com
Hi,

I just added dag rrdtool rpm, and uses gem2rpm to make my own ruby-rrd rpm.
one thing that I added additionally is:

  file {"/usr/lib/ruby/site_ruby/1.8/i386-linux/RRDtool.so": ensure => link,
                target =>  "/usr/lib/ruby/gems/1.8/gems/RubyRRDtool-0.6.0/RRDtool.so",
                require => Package["rubygem-RubyRRDtool"]

I didnt check, but I assume that puppet is doing require 'rubygems' somewhere, anyone knows  why ruby doesnt pickup the gems libdir?

Thanks,
Ohad

Duncan Hill

unread,
Apr 9, 2008, 5:15:13 AM4/9/08
to puppet...@googlegroups.com
On 09/04/2008, Ohad Levy <ohad...@gmail.com> wrote:
> Hi,
>
> I just added dag rrdtool rpm, and uses gem2rpm to make my own ruby-rrd rpm.
> one thing that I added additionally is:

Ah! I wasn't aware of gem2rpm (though I know of cpan2rpm) - not a
Ruby person :)

Reply all
Reply to author
Forward
0 new messages