[hyperestraier/f17: 1/2] Rebuilt for Ruby 1.9.3.
Vít Ondruch
vondruch at fedoraproject.org
Thu Mar 1 14:11:23 UTC 2012
commit 69f86e34ae1ef988045dee36076e40a24a7fab16
Author: Vít Ondruch <vondruch at redhat.com>
Date: Thu Mar 1 15:10:53 2012 +0100
Rebuilt for Ruby 1.9.3.
huperestraier-1.4.13-ruby-19-compat.patch | 76 +++++++++++++++++++++++++++++
hyperestraier.spec | 26 +++++++---
2 files changed, 95 insertions(+), 7 deletions(-)
---
diff --git a/huperestraier-1.4.13-ruby-19-compat.patch b/huperestraier-1.4.13-ruby-19-compat.patch
new file mode 100644
index 0000000..bce5c0f
--- /dev/null
+++ b/huperestraier-1.4.13-ruby-19-compat.patch
@@ -0,0 +1,76 @@
+Description: wraps some api call to use with ruby1.9 as well as ruby1.8
+Origin: vendor
+Author: KURASHIKI Satoru <lurdan at gmail.com>
+
+Index: hyperestraier/rubynative/src/estraier.c
+===================================================================
+--- hyperestraier.orig/rubynative/src/estraier.c 2010-05-23 15:24:39.752082000 +0900
++++ hyperestraier/rubynative/src/estraier.c 2010-05-23 15:25:07.547571000 +0900
+@@ -24,6 +24,18 @@
+ #define VNINFO "@informer"
+ #define VNCOND "@cond"
+
++#ifndef RUBY_19
++#ifndef RARRAY_LEN
++#define RARRAY_LEN(v) (RARRAY(v)->len)
++#endif
++#ifndef RSTRING_LEN
++#define RSTRING_LEN(v) (RSTRING(v)->len)
++#endif
++#ifndef RSTRING_PTR
++#define RSTRING_PTR(v) (RSTRING(v)->ptr)
++#endif
++#endif
++
+ typedef struct {
+ int *ids;
+ int *dbidxs;
+@@ -351,7 +363,7 @@
+ vdoc = rb_iv_get(vself, VNDATA);
+ Data_Get_Struct(vdoc, ESTDOC, doc);
+ Check_Type(vwords, T_ARRAY);
+- len = RARRAY(vwords)->len;
++ len = RARRAY_LEN(vwords);
+ for(i = 0; i < len; i++){
+ Check_Type(rb_ary_entry(vwords, i), T_STRING);
+ }
+@@ -764,7 +776,7 @@
+ CBMAP *hints;
+ int i, dnum, *res, rnum;
+ Check_Type(vdbs, T_ARRAY);
+- dnum = RARRAY(vdbs)->len;
++ dnum = RARRAY_LEN(vdbs);
+ dbs = cbmalloc(dnum * sizeof(ESTMTDB *) + 1);
+ for(i = 0; i < dnum; i++){
+ vdb = rb_ary_entry(vdbs, i);
+@@ -1189,10 +1201,10 @@
+ VALUE str;
+ int i, len;
+ list = cblistopen();
+- len = RARRAY(obj)->len;
++ len = RARRAY_LEN(obj);
+ for(i = 0; i < len; i++){
+ str = rb_ary_entry(obj, i);
+- cblistpush(list, RSTRING(str)->ptr, RSTRING(str)->len);
++ cblistpush(list, RSTRING_PTR(str), RSTRING_LEN(str));
+ }
+ return list;
+ }
+@@ -1218,14 +1230,14 @@
+ int i, len;
+ map = cbmapopenex(31);
+ keys = rb_funcall(obj, rb_intern("keys"), 0);
+- len = RARRAY(keys)->len;
++ len = RARRAY_LEN(keys);
+ for(i = 0; i < len; i++){
+ key = rb_ary_entry(keys, i);
+ val = rb_hash_aref(obj, key);
+ key = rb_String(key);
+ val = rb_String(val);
+- cbmapput(map, RSTRING(key)->ptr, RSTRING(key)->len,
+- RSTRING(val)->ptr, RSTRING(val)->len, 0);
++ cbmapput(map, RSTRING_PTR(key), RSTRING_LEN(key),
++ RSTRING_PTR(val), RSTRING_LEN(val), 0);
+ }
+ return map;
+ }
diff --git a/hyperestraier.spec b/hyperestraier.spec
index 203ae47..a265a5d 100644
--- a/hyperestraier.spec
+++ b/hyperestraier.spec
@@ -1,5 +1,4 @@
-%define rubyver 1.8
-%{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig -e 'puts Config::CONFIG["sitelibdir"]')}
+%global rubyabi 1.9.1
%define qdbm_ver 1.8.75
# Workaround for ruby side bug (bug 226381 c11)
@@ -7,13 +6,16 @@
Name: hyperestraier
Version: 1.4.13
-Release: 9%{?dist}
+Release: 10%{?dist}
Summary: A full-text search system
Group: System Environment/Libraries
License: LGPLv2+
URL: http://hyperestraier.sourceforge.net/
Source0: http://hyperestraier.sourceforge.net/%{name}-%{version}.tar.gz
+# Taken from Debian:
+# http://packages.debian.org/testing/ruby/libestraier-ruby1.9.1
+Patch0: huperestraier-1.4.13-ruby-19-compat.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: bzip2-devel zlib-devel
@@ -22,9 +24,9 @@ BuildRequires: lzo-devel >= 2.02
%endif
BuildRequires: gcc-java libgcj-devel
BuildRequires: qdbm-devel >= %{qdbm_ver}
-BuildRequires: ruby-rdoc
+BuildRequires: rubygem(rdoc)
BuildRequires: ruby-devel
-BuildRequires: ruby(abi) = %{rubyver}
+BuildRequires: ruby(abi) = %{rubyabi}
BuildRequires: perl(ExtUtils::MakeMaker)
%description
@@ -66,7 +68,7 @@ This package contains a Perl interface for Hyper Estraier
Summary: Hyper Estraier Library for Ruby
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
-Requires: ruby(abi) = %{rubyver}
+Requires: ruby(abi) = %{rubyabi}
Provides: ruby(hyperestraier) = %{version}-%{release}
%description -n ruby-hyperestraier
@@ -76,6 +78,8 @@ This package contains a Ruby interface for Hyper Estraier.
%prep
%setup -q
+%patch0 -p1
+
%build
## 0. First:
## - remove rpath
@@ -135,6 +139,11 @@ pushd rubynative
export RUBYLIB=$(pwd)
%{__sed} -i.path -e 's|-O3.*|\`pkg-config --cflags qdbm\`\"|' src/extconf.rb
+
+# Fix placement for Ruby 1.9.
+%{__sed} -i.vendor \
+ -e 's|myrblibdir=.*|myrblibdir=%{ruby_vendorarchdir}|' configure
+
%configure
%{__make} %{?_smp_mflags}
popd
@@ -248,10 +257,13 @@ popd
%doc rubynative/example/
%{_bindir}/*.rb
-%{ruby_sitelib}/*.so
+%{ruby_vendorarchdir}/*.so
%changelog
+* Thu Mar 01 2012 Vít Ondruch <vondruch at redhat.com> - 1.4.13-10
+- Rebuilt for Ruby 1.9.3.
+
* Thu Jan 5 2012 Mamoru Tasaka <mtasaka at fedoraproject.org> - 1.4.13-9
- F-17: rebuild against gcc47
More information about the scm-commits
mailing list