[ruby-revolution/f17: 1/2] Rebuilt and patched for Ruby 1.9.3.
Vít Ondruch
vondruch at fedoraproject.org
Wed Feb 29 13:25:35 UTC 2012
commit eafa270c1dc6107821f6908fb91dcecb4b95285c
Author: Vít Ondruch <vondruch at redhat.com>
Date: Wed Feb 29 14:25:08 2012 +0100
Rebuilt and patched for Ruby 1.9.3.
revolution-ruby-1.9.patch | 178 +++++++++++++++++++++++++++++++++++++++++++++
ruby-revolution.spec | 16 ++--
2 files changed, 187 insertions(+), 7 deletions(-)
---
diff --git a/revolution-ruby-1.9.patch b/revolution-ruby-1.9.patch
new file mode 100644
index 0000000..1e823d6
--- /dev/null
+++ b/revolution-ruby-1.9.patch
@@ -0,0 +1,178 @@
+--- revolution.c.orig 2007-12-06 06:52:42.000000000 +0100
++++ revolution.c 2012-02-29 13:15:46.479780689 +0100
+@@ -139,7 +139,7 @@
+ ECal* cal;
+ GError* error = 0;
+ VALUE rb_uid = rb_iv_get(self,"@tasks_source");
+- char* uid = RTEST(rb_uid) ? RSTRING(StringValue(rb_uid))->ptr : NULL;
++ char* uid = RTEST(rb_uid) ? RSTRING_PTR(StringValue(rb_uid)) : NULL;
+ if(!uid)
+ cal = e_cal_new_system_tasks();
+ else {
+@@ -154,7 +154,7 @@
+ ECal* cal;
+ GError* error = 0;
+ VALUE rb_uid = rb_iv_get(self,"@calendar_source");
+- char* uid = RTEST(rb_uid) ? RSTRING(StringValue(rb_uid))->ptr : NULL;
++ char* uid = RTEST(rb_uid) ? RSTRING_PTR(StringValue(rb_uid)) : NULL;
+ if(!uid)
+ cal = e_cal_new_system_calendar();
+ else {
+@@ -348,7 +348,7 @@
+ ECalComponentText* summary = g_new(ECalComponentText, 1);
+ VALUE rb_summary = rb_iv_get(rb_task, "@summary");
+ if (rb_summary != Qnil) {
+- summary->value = RSTRING(StringValue(rb_summary))->ptr;
++ summary->value = RSTRING_PTR(StringValue(rb_summary));
+ summary->altrep = "";
+ }
+ e_cal_component_set_summary(e_task, summary);
+@@ -367,7 +367,7 @@
+ * Deletes a task from the Evolution task list.
+ */
+ static VALUE revolution_delete_task(VALUE self, VALUE rb_uid) {
+- char* uid = RSTRING(StringValue(rb_uid))->ptr;
++ char* uid = RSTRING_PTR(StringValue(rb_uid));
+ GError* error = NULL;
+ e_cal_remove_object(open_tasks(self), uid, &error);
+ check_error(error, "Unable to remove task: %s");
+@@ -446,7 +446,7 @@
+ * Deletes an appointment from the Evolution calendar.
+ */
+ static VALUE revolution_delete_appointment(VALUE self, VALUE rb_uid) {
+- char* uid = RSTRING(StringValue(rb_uid))->ptr;
++ char* uid = RSTRING_PTR(StringValue(rb_uid));
+ GError* error = NULL;
+ e_cal_remove_object(open_calendar(self), uid, &error);
+ check_error(error, "Unable to remove calendar item: %s");
+@@ -472,7 +472,7 @@
+ ECalComponentText* summary = g_new(ECalComponentText, 1);
+ VALUE rb_summary = rb_iv_get(rb_appt, "@summary");
+ if (rb_summary != Qnil) {
+- summary->value = RSTRING(StringValue(rb_summary))->ptr;
++ summary->value = RSTRING_PTR(StringValue(rb_summary));
+ summary->altrep = "";
+ }
+ e_cal_component_set_summary(e_appt, summary);
+@@ -492,7 +492,7 @@
+ ECalComponentOrganizer organizer = {NULL, NULL, NULL, NULL};
+ VALUE rb_organizer = rb_iv_get(rb_appt, "@organizer");
+ if (rb_organizer != Qnil) {
+- char* value = RSTRING(StringValue(rb_organizer))->ptr;
++ char* value = RSTRING_PTR(StringValue(rb_organizer));
+ organizer.value = value;
+ organizer.cn = value;
+ e_cal_component_set_organizer(e_appt, &organizer);
+@@ -539,9 +539,9 @@
+ GError* error = 0;
+ GList* appts, *l;
+ VALUE start_fmt = rb_funcall(rb_start, rb_intern("strftime"), 1, rb_str_new2("%Y%m%dT%H%M%SZ"));
+- char* start_str = RSTRING(StringValue(start_fmt))->ptr;
++ char* start_str = RSTRING_PTR(StringValue(start_fmt));
+ VALUE end_fmt = rb_funcall(rb_end, rb_intern("strftime"), 1, rb_str_new2("%Y%m%dT%H%M%SZ"));
+- char* end_str = RSTRING(StringValue(end_fmt))->ptr;
++ char* end_str = RSTRING_PTR(StringValue(end_fmt));
+ char* query = g_strconcat("(occur-in-time-range? (make-time \"", start_str, "\") (make-time \"", end_str, "\"))", NULL);
+ e_cal_get_object_list_as_comp(open_calendar(self), query, &appts, &error);
+ check_error(error, "Unable to query calendar %s");
+@@ -564,7 +564,7 @@
+ * Gets a single appointment using its unique id
+ */
+ static VALUE revolution_get_appointment_by_uid(VALUE self, VALUE appt_uid) {
+- char* uid = RSTRING(StringValue(appt_uid))->ptr;
++ char* uid = RSTRING_PTR(StringValue(appt_uid));
+ GError* error = NULL;
+ GList* appt;
+ char* query = g_strconcat("(uid? \"", uid, "\")", NULL);
+@@ -595,7 +595,7 @@
+ static VALUE revolution_get_appointments_with_query(VALUE self, VALUE rb_query) {
+ GError* error = 0;
+ GList* appts, *l;
+- e_cal_get_object_list_as_comp(open_calendar(self), RSTRING(StringValue(rb_query))->ptr, &appts, &error);
++ e_cal_get_object_list_as_comp(open_calendar(self), RSTRING_PTR(StringValue(rb_query)), &appts, &error);
+ check_error(error, "Unable to query calendar %s");
+ VALUE result = rb_ary_new();
+ for (l = appts; l;l = l->next) {
+@@ -869,7 +869,7 @@
+ * return any contacts whose named contained "Smith" - Joe Smith, Fred Smithson, etc.
+ */
+ static VALUE revolution_get_contacts_with_query(VALUE self, VALUE rb_query) {
+- EBookQuery* query = e_book_query_from_string(RSTRING(StringValue(rb_query))->ptr);
++ EBookQuery* query = e_book_query_from_string(RSTRING_PTR(StringValue(rb_query)));
+ VALUE result = copy_contacts(run_query(open_book(), query));
+ e_book_query_unref(query);
+ return result;
+@@ -882,7 +882,7 @@
+ * Gets contacts by name; returns any name that contains the passed in parameter
+ */
+ static VALUE revolution_get_contacts_by_name(VALUE self, VALUE rb_name) {
+- EBookQuery* query = e_book_query_from_string(g_strdup_printf ("(contains \"full_name\" \"%s\")", RSTRING(StringValue(rb_name))->ptr));
++ EBookQuery* query = e_book_query_from_string(g_strdup_printf ("(contains \"full_name\" \"%s\")", RSTRING_PTR(StringValue(rb_name))));
+ VALUE result = copy_contacts(run_query(open_book(), query));
+ e_book_query_unref(query);
+ return result;
+@@ -901,7 +901,7 @@
+ // and the bug is fixed as per here:
+ // http://bugzilla.gnome.org/show_bug.cgi?id=309276
+ // but using e_book_get_contact works fine too
+- char* uid = RSTRING(StringValue(contact_uid))->ptr;
++ char* uid = RSTRING_PTR(StringValue(contact_uid));
+ GError* error = NULL;
+ EContact* ev_contact = e_contact_new();
+ e_book_get_contact(open_book(), uid, &ev_contact, &error);
+@@ -918,7 +918,7 @@
+ */
+ static VALUE revolution_delete_contact(VALUE self, VALUE contact_uid) {
+ GError* error = 0;
+- e_book_remove_contact(open_book(), RSTRING(StringValue(contact_uid))->ptr, &error);
++ e_book_remove_contact(open_book(), RSTRING_PTR(StringValue(contact_uid)), &error);
+ check_error(error, "Unable to delete contact: %s");
+ return Qnil;
+ }
+@@ -929,7 +929,7 @@
+ addresses = rb_funcall(addresses, rb_intern("reverse"), 0);
+ VALUE rb_addr = Qnil;
+ while ((rb_addr = rb_ary_pop(addresses)) != Qnil) {
+- char* addr = RSTRING(StringValue(rb_addr))->ptr;
++ char* addr = RSTRING_PTR(StringValue(rb_addr));
+ EVCardAttribute* attr = e_vcard_attribute_new (NULL, EVC_EMAIL);
+ e_vcard_attribute_add_value(attr, addr);
+ e_vcard_attribute_add_param_with_value(attr, e_vcard_attribute_param_new (EVC_TYPE), type);
+@@ -941,7 +941,7 @@
+ void string_exporter(const VALUE rb_contact, EContact* ev_contact, const char* ruby_iv_name, int ev_field) {
+ VALUE value = rb_iv_get(rb_contact, ruby_iv_name);
+ if (value != Qnil) {
+- e_contact_set(ev_contact, ev_field, RSTRING(StringValue(value))->ptr);
++ e_contact_set(ev_contact, ev_field, RSTRING_PTR(StringValue(value)));
+ }
+ }
+
+@@ -949,11 +949,11 @@
+ EContactName* name = e_contact_name_new ();
+ VALUE fname = rb_iv_get(rb_contact, "@first_name");
+ if (fname) {
+- name->given = RSTRING(StringValue(fname))->ptr;
++ name->given = RSTRING_PTR(StringValue(fname));
+ }
+ VALUE lname = rb_iv_get(rb_contact, "@last_name");
+ if (lname) {
+- name->family = RSTRING(StringValue(lname))->ptr;
++ name->family = RSTRING_PTR(StringValue(lname));
+ }
+ e_contact_set(ev_contact, E_CONTACT_FULL_NAME, e_contact_name_to_string (name));
+ // Hm, this causes problems... if I leave it here it segfaults,
+@@ -993,11 +993,11 @@
+ VALUE rb_addr = Qnil;
+ while ((rb_addr = rb_ary_pop(im_addresses)) != Qnil) {
+ VALUE prov = rb_iv_get(rb_addr, "@provider");
+- char* provider = RSTRING(StringValue(prov))->ptr;
++ char* provider = RSTRING_PTR(StringValue(prov));
+ VALUE loc = rb_iv_get(rb_addr, "@location");
+- char* location = RSTRING(StringValue(loc))->ptr;
++ char* location = RSTRING_PTR(StringValue(loc));
+ VALUE ad = rb_iv_get(rb_addr, "@address");
+- char* addr = RSTRING(StringValue(ad))->ptr;
++ char* addr = RSTRING_PTR(StringValue(ad));
+ e_contact_set(ev_contact, GPOINTER_TO_INT(g_hash_table_lookup(im_hash, g_strconcat(provider, location, NULL))), addr);
+ }
+ }
diff --git a/ruby-revolution.spec b/ruby-revolution.spec
index 2a54d12..2b29051 100644
--- a/ruby-revolution.spec
+++ b/ruby-revolution.spec
@@ -1,8 +1,5 @@
-%{!?ruby_sitelib: %global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
-%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
-
%define modname revolution
-%define rubyabi 1.8
+%define rubyabi 1.9.1
%define repoid 4341
%define mainver 0.5
@@ -19,7 +16,7 @@
Name: ruby-%{modname}
Version: %{mainver}
-Release: %{fedorarel}%{?svnid:.svn%svnid}%{?dist}.13
+Release: %{fedorarel}%{?svnid:.svn%svnid}%{?dist}.14
Summary: Ruby binding for the Evolution email client
Group: Development/Languages
@@ -27,6 +24,7 @@ License: BSD with advertising or GPLv2
URL: http://revolution.rubyforge.org/
#Source0: http://rubyforge.org/frs/download.php/%{repoid}/%{modname}-%{mainver}.zip
Source0: %{modname}-%{mainver}-svn%{svnid}.zip
+Patch0: revolution-ruby-1.9.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: ruby
@@ -44,13 +42,14 @@ with a BSD or GPL license - by InfoEther.
%prep
%setup -q -n %{modname}-%{version}%{?svnid:-svn%{svnid}}
+%patch0 -p0
find . -type f -exec %{__chmod} 0644 {} ';'
%{__rm} -rf www/CVS
find . -name .svn | sort -r | xargs %{__rm} -rf
%build
-ruby extconf.rb
+ruby extconf.rb --vendor
%{__make} %{?_smp_mflags}
%install
@@ -70,9 +69,12 @@ ruby extconf.rb
%doc README
%doc www/
-%{ruby_sitearch}/%{modname}.so
+%{ruby_vendorarchdir}/%{modname}.so
%changelog
+* Wed Feb 29 2012 Bohuslav Kabrda <bkabrda at redhat.com> - 0.5-4.svn210.14
+- Rebuilt and patched for Ruby 1.9.3.
+
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.5-4.svn210.13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
More information about the scm-commits
mailing list