diff --git a/ruby-RRDtool.spec b/ruby-RRDtool.spec index fa44195..2738988 100644 --- a/ruby-RRDtool.spec +++ b/ruby-RRDtool.spec @@ -1,8 +1,6 @@ -%{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]')} - Name: ruby-RRDtool Version: 0.6.0 -Release: 10%{?dist} +Release: 11%{?dist} Summary: RRDTool for Ruby Group: Development/Languages @@ -12,12 +10,13 @@ Source0: http://rubyforge.org/frs/download.php/13992/RubyRRDtool-%{versio %if 0%{?fedora} >= 8 Patch0: RubyRRDtool-0.6.0.patch +Patch1: ruby-rrdtool-patch-for-ruby-1.9.3.patch %endif BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: ruby, ruby(abi) = 1.8, ruby-devel, rrdtool-devel -Requires: ruby(abi) = 1.8, rrdtool +BuildRequires: ruby, ruby(abi) = 1.9.1, ruby-devel, rrdtool-devel +Requires: ruby(abi) = 1.9.1, rrdtool Provides: ruby(RRDtool) = %{version} %description @@ -28,10 +27,11 @@ Generate RRDTool Databases from Ruby %if 0%{?fedora} >= 8 %patch0 -p1 +%patch1 -p0 %endif %build -ruby extconf.rb +ruby extconf.rb --vendor make %{?_smp_flags} %install @@ -45,9 +45,12 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc README -%{ruby_sitearch}/RRDtool.so +%{ruby_vendorarchdir}/RRDtool.so %changelog +* Wed Feb 29 2012 Bohuslav Kabrda - 0.6.0-11 +- Rebuilt and patched for Ruby 1.9.3. + * Sat Jan 14 2012 Fedora Release Engineering - 0.6.0-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild diff --git a/ruby-rrdtool-patch-for-ruby-1.9.3.patch b/ruby-rrdtool-patch-for-ruby-1.9.3.patch new file mode 100644 index 0000000..a5bfadd --- /dev/null +++ b/ruby-rrdtool-patch-for-ruby-1.9.3.patch @@ -0,0 +1,137 @@ +--- rubyrrdtool.c.orig 2012-02-29 10:43:56.000000000 +0100 ++++ rubyrrdtool.c 2012-02-29 10:46:06.992914897 +0100 +@@ -94,7 +94,7 @@ + Check_Type(strs, T_ARRAY); + + /* set the array length */ +- a.len = RARRAY(strs)->len; ++ a.len = RARRAY_LEN(strs); + if (name_f) { a.len++; } + if (dummy_f) { a.len++; } + a.strs = ALLOC_N(char*, a.len); +@@ -115,7 +115,7 @@ + + /* add the rrdname if needed */ + if (name_f) { +- a.strs[i] = strdup(STR2CSTR(rrd)); ++ a.strs[i] = strdup(StringValueCStr(rrd)); + i++; + } + +@@ -302,7 +302,7 @@ + pdp_step = NUM2LONG(ostep); + last_up = (time_t)NUM2LONG(update); + #ifdef R_RRD_DBG +- snprintf(buf, NUM_BUF_SZ, "n=[%s] : step=%lu : up=%ld", STR2CSTR(rrd), ++ snprintf(buf, NUM_BUF_SZ, "n=[%s] : step=%lu : up=%ld", StringValueCStr(rrd), + pdp_step, (long int)last_up); + buf[NUM_BUF_SZ] = 0; + _dbug(R_RRD_DEBUG_SIM, buf); +@@ -313,7 +313,7 @@ + #endif + + /* now run the command */ +- result = rrd_create_r(STR2CSTR(rrd), pdp_step, last_up, a.len, a.strs); ++ result = rrd_create_r(StringValueCStr(rrd), pdp_step, last_up, a.len, a.strs); + + #ifdef R_RRD_DBG + _dbug(R_RRD_DEBUG_SIM, "cleanup"); +@@ -368,7 +368,7 @@ + /* type checking */ + Check_Type(output, T_STRING); + +- ret = rrd_dump_r(STR2CSTR(rrd), STR2CSTR(output)); ++ ret = rrd_dump_r(StringValueCStr(rrd), StringValueCStr(output)); + if (ret == -1) { + RRD_RAISE; + rval = Qnil; +@@ -413,7 +413,7 @@ + idx = NUM2INT(orra_idx); + } + +- when = rrd_first_r(STR2CSTR(rrd), idx); ++ when = rrd_first_r(StringValueCStr(rrd), idx); + if (when == -1) { + RRD_RAISE; + rval = Qnil; +@@ -423,7 +423,7 @@ + + #ifdef R_RRD_DBG + snprintf(buf, NUM_BUF_SZ, "first: rrd=[%s] : idx=%d : val=%ld", +- STR2CSTR(rrd), idx, when); ++ StringValueCStr(rrd), idx, when); + buf[NUM_BUF_SZ] = 0; + _dbug(R_RRD_DEBUG_SIM, buf); + #endif +@@ -456,7 +456,7 @@ + + rrd = rb_iv_get(self, "@rrdname"); + +- when = rrd_last_r(STR2CSTR(rrd)); ++ when = rrd_last_r(StringValueCStr(rrd)); + if (when == -1) { + RRD_RAISE; + rval = Qnil; +@@ -465,7 +465,7 @@ + } + + #ifdef R_RRD_DBG +- snprintf(buf, NUM_BUF_SZ, "last: rrd=[%s] : val=%ld", STR2CSTR(rrd), when); ++ snprintf(buf, NUM_BUF_SZ, "last: rrd=[%s] : val=%ld", StringValueCStr(rrd), when); + buf[NUM_BUF_SZ] = 0; + _dbug(R_RRD_DEBUG_SIM, buf); + #endif +@@ -579,14 +579,14 @@ + tmpl = StringValue(otemp); + + #ifdef R_RRD_DBG +- snprintf(buf, NUM_BUF_SZ, "n=[%s] : tmpl=%s", STR2CSTR(rrd), STR2CSTR(tmpl)); ++ snprintf(buf, NUM_BUF_SZ, "n=[%s] : tmpl=%s", StringValueCStr(rrd), StringValueCStr(tmpl)); + buf[NUM_BUF_SZ] = 0; + _dbug(R_RRD_DEBUG_SIM, buf); + #endif + a = s_arr_new(self, false, false, args); + + /* now run the command */ +- result = rrd_update_r(STR2CSTR(rrd), STR2CSTR(tmpl), a.len, a.strs); ++ result = rrd_update_r(StringValueCStr(rrd), StringValueCStr(tmpl), a.len, a.strs); + /* cleanup */ + s_arr_del(a); + +@@ -717,14 +717,14 @@ + + #ifdef R_RRD_DBG + snprintf(buf, NUM_BUF_SZ, "restore: xml=%s rrd=%s", +- STR2CSTR(xml), STR2CSTR(rrd)); ++ StringValueCStr(xml), StringValueCStr(rrd)); + buf[NUM_BUF_SZ] = 0; + _dbug(R_RRD_DEBUG_SIM, buf); + #endif + a = s_arr_new(self, false, false, args); +- s_arr_push(STR2CSTR(rrd), &a); +- s_arr_push(STR2CSTR(xml), &a); +- s_arr_push(STR2CSTR(xml), &a); ++ s_arr_push(StringValueCStr(rrd), &a); ++ s_arr_push(StringValueCStr(xml), &a); ++ s_arr_push(StringValueCStr(xml), &a); + + /* now run the command */ + result = rrd_restore(a.len, a.strs); +@@ -998,7 +998,7 @@ + reset_rrd_state(); + + rrd = rb_iv_get(self, "@rrdname"); +- data = rrd_info_r(STR2CSTR(rrd)); ++ data = rrd_info_r(StringValueCStr(rrd)); + + RRD_CHECK_ERROR; + +@@ -1054,7 +1054,7 @@ + rrdname = StringValue(ofname); + rb_iv_set(self, "@rrdname", rrdname); + #ifdef R_RRD_DBG +- snprintf(buf, NUM_BUF_SZ, "rrdname=[%s]", STR2CSTR(rrdname)); ++ snprintf(buf, NUM_BUF_SZ, "rrdname=[%s]", StringValueCStr(rrdname)); + buf[NUM_BUF_SZ] = 0; + _dbug(R_RRD_DEBUG_SIM, buf); + #endif