[packages/tomoe] - added ruby patch, package ruby binding

qboosh qboosh at pld-linux.org
Tue Nov 13 15:53:47 CET 2012


commit 19d2e237e7992e6b1639d264ce9eeaac0488bacb
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Tue Nov 13 15:53:50 2012 +0100

    - added ruby patch, package ruby binding

 tomoe-ruby.patch | 32 ++++++++++++++++++++++++++++++++
 tomoe.spec       | 50 +++++++++++++++++++++++++++++++++++++-------------
 2 files changed, 69 insertions(+), 13 deletions(-)
---
diff --git a/tomoe.spec b/tomoe.spec
index af26060..a5a2a29 100644
--- a/tomoe.spec
+++ b/tomoe.spec
@@ -1,7 +1,7 @@
 #
 # Conditional build:
-%bcond_without	python		# build without python bindings
-%bcond_with	ruby		# build with ruby bindings
+%bcond_without	python		# build without Python bindings
+%bcond_without	ruby		# build without Ruby bindings
 %bcond_without	static_libs	# don't build static libraries
 #
 Summary:	Handwritten input system for Japanese and Chinese
@@ -17,13 +17,17 @@ Patch0:		%{name}-multiarch-conflict.patch
 Patch1:		%{name}-bz502662.patch
 Patch2:		%{name}-svn-libs.patch
 Patch3:		%{name}-glib2.32.patch
+Patch4:		%{name}-ruby.patch
 URL:		http://tomoe.sourceforge.jp/
 BuildRequires:	apr-util-devel
+BuildRequires:	autoconf >= 2.57
+BuildRequires:	automake
 BuildRequires:	gettext-devel
 BuildRequires:	glib2-devel >= 1:2.4.0
 BuildRequires:	gtk-doc >= 1.4
 BuildRequires:	hyperestraier-devel
 BuildRequires:	intltool >= 0.35.0
+BuildRequires:	libtool
 BuildRequires:	libxslt-progs
 BuildRequires:	mysql-devel
 BuildRequires:	pakchois-devel
@@ -37,7 +41,7 @@ BuildRequires:	python-pygobject-devel
 BuildRequires:	python-pygtk-devel
 %endif
 %if %{with ruby}
-BuildRequires:	ruby-gnome2-devel
+BuildRequires:	ruby-glib2-devel
 %endif
 Requires:	glib2 >= 1:2.4.0
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -129,6 +133,7 @@ Summary:	Tomoe bindings for Ruby
 Summary(pl.UTF-8):	Wiązania tomoe dla języka Ruby
 Group:		Development/Languages
 Requires:	%{name} = %{version}-%{release}
+Requires:	ruby-glib2
 
 %description -n ruby-tomoe
 Tomoe bindings for Ruby.
@@ -136,14 +141,29 @@ Tomoe bindings for Ruby.
 %description -n ruby-tomoe -l pl.UTF-8
 Wiązania tomoe dla języka Ruby.
 
+%package -n ruby-tomoe-devel
+Summary:	Header file for Ruby/Tomoe library
+Summary(pl.UTF-8):	Plik nagłówkowy biblioteki Ruby/Tomoe
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+Requires:	ruby-glib2-devel
+Requires:	ruby-tomoe = %{version}-%{release}
+
+%description -n ruby-tomoe-devel
+Header file for Ruby/Tomoe library.
+
+%description -n ruby-tomoe-devel -l pl.UTF-8
+Plik nagłówkowy biblioteki Ruby/Tomoe.
+
 %prep
 %setup -q
 %patch0 -p0
 %patch1 -p0
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1 -b .orig
 
-%{__sed} 's|#!/usr/bin/env ruby|#!/usr/bin/ruby|' data/xml2est.rb
+%{__sed} -i -e 's|#!/usr/bin/env ruby|#!/usr/bin/ruby|' data/xml2est.rb
 
 %build
 %{__libtoolize}
@@ -170,6 +190,7 @@ install -d $RPM_BUILD_ROOT%{_datadir}/tomoe/dict
 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
 %{__rm} $RPM_BUILD_ROOT%{_libdir}/tomoe/module/{dict,recognizer}/*.{a,la}
 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/tomoe.{a,la}
+%{?with_ruby:%{__rm} $RPM_BUILD_ROOT%{ruby_sitearchdir}/tomoe.{a,la}}
 
 %if %{without ruby}
 %{__rm} $RPM_BUILD_ROOT%{_datadir}/tomoe/xml2est.rb
@@ -228,15 +249,6 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/tomoe/module/dict/svn.so
 
-%if %{with ruby}
-%files -n ruby-tomoe
-%defattr(644,root,root,755)
-%{ruby_archdir}
-%{_libdir}/ruby/site_ruby/1.8/tomoe.rb
-%{_libdir}/ruby/site_ruby/1.8/*-linux/*
-%attr(755,root,root) %{_datadir}/tomoe/xml2est.rb
-%endif
-
 %if %{with python}
 %files -n python-tomoe
 %defattr(644,root,root,755)
@@ -244,3 +256,15 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/tomoe/python
 %{_pkgconfigdir}/pytomoe.pc
 %endif
+
+%if %{with ruby}
+%files -n ruby-tomoe
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_datadir}/tomoe/xml2est.rb
+%attr(755,root,root) %{ruby_sitearchdir}/tomoe.so
+%{ruby_sitelibdir}/tomoe.rb
+
+%files -n ruby-tomoe-devel
+%defattr(644,root,root,755)
+%{ruby_sitearchdir}/rbtomoe.h
+%endif
diff --git a/tomoe-ruby.patch b/tomoe-ruby.patch
new file mode 100644
index 0000000..04ba72f
--- /dev/null
+++ b/tomoe-ruby.patch
@@ -0,0 +1,32 @@
+--- tomoe-0.6.0/macros/ruby.m4.orig	2007-06-11 03:05:42.000000000 +0200
++++ tomoe-0.6.0/macros/ruby.m4	2012-11-12 21:18:04.642203203 +0100
+@@ -28,14 +28,15 @@
+ 
+   changequote(<<, >>)
+   for var_name in archdir sitearchdir CFLAGS LIBRUBYARG libdir \
+-                  sitelibdir sitearchdir; do
++                  sitelibdir sitearchdir rubyhdrdir sitehdrdir arch; do
+     rbconfig_tmp=`$rbconfig "print Config::CONFIG['$var_name']"`
+     eval "rbconfig_$var_name=\"$rbconfig_tmp\""
+   done
++  rbconfig_archhdrdir="$rbconfig_rubyhdrdir/$rbconfig_arch"
+   changequote([, ])
+ 
+-  RUBY_CFLAGS="$RUBY_CFLAGS -I$rbconfig_archdir "
+-  RUBY_CFLAGS="$RUBY_CFLAGS -I$rbconfig_sitearchdir "
++  RUBY_CFLAGS="$RUBY_CFLAGS -I$rbconfig_archdir -I$rbconfig_rubyhdrdir -I$rbconfig_archhdrdir"
++  RUBY_CFLAGS="$RUBY_CFLAGS -I$rbconfig_sitearchdir -I$rbconfig_sitehdrdir"
+   RUBY_CFLAGS="$RUBY_CFLAGS $rbconfig_CFLAGS "
+   RUBY_LIBS="$rbconfig_LIBRUBYARG"
+   RUBY_LDFLAGS="-L$rbconfig_libdir"
+--- tomoe-0.6.0/bindings/ruby/tomoe-rb-char.c.orig	2007-06-06 02:44:38.000000000 +0200
++++ tomoe-0.6.0/bindings/ruby/tomoe-rb-char.c	2012-11-12 21:20:44.718863156 +0100
+@@ -13,7 +13,7 @@
+     if (NIL_P(xml)) {
+         chr = tomoe_char_new();
+     } else {
+-        chr = tomoe_char_new_from_xml_data(RVAL2CSTR(xml), RSTRING(xml)->len);
++        chr = tomoe_char_new_from_xml_data(RVAL2CSTR(xml), RSTRING_LEN(xml));
+     }
+ 
+     G_INITIALIZE(self, chr);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/tomoe.git/commitdiff/19d2e237e7992e6b1639d264ce9eeaac0488bacb



More information about the pld-cvs-commit mailing list