-#
-# NOTE: - segfaults on ppc during building when is built with `--with-pthreads'
-# /home/users/builder/rpm/BUILD/ruby-1.8.5-p2/lib/mkmf.rb:147: [BUG] Segmentation fault
-# ruby 1.8.5 (2006-12-04) [powerpc-linux]
-#
-# - on the other hand when ruby is built on pcc with `--without-pthreads'
-# compilation of tk extensions fails with message:
-#
-# Ruby is not compiled with --enable-pthread, but your Tcl/Tk
-# ** library seems to be compiled with pthread support. This
-# ** combination may cause frequent hang or segmentation fault
-# ** errors when Ruby/Tk is working.
+# TODO
+# - include ext/ in docs
+# - replace ri with fastri
+# - patch ri to search multiple indexes (one per package), so RPMs can
+# install ri docs
#
# Conditional build:
%bcond_without doc # skip generating docs (which is time-consuming). Intended for speed up test builds
%bcond_without emacs # skip building package with ruby-mode for emacs
+%bcond_without tk # skip building package with Tk bindings
+%bcond_with onigurma
#
%define ruby_ver 1.8
%define ruby_ridir %{_datadir}/ri/%{ruby_ver}/system
Summary: Ruby - interpreted scripting language
-Summary(ja): ¥ª¥Ö¥¸¥§¥¯¥È»Ø¸þ¸À¸ìRuby¥¤¥ó¥¿¥×¥ê¥¿
-Summary(pl): Ruby - interpretowany jêzyk skryptowy
-Summary(pt_BR): Linguagem de script orientada a objeto
-Summary(zh_CN): ruby - Ò»ÖÖ¿ìËÙ¸ßЧµÄÃæÏò¶ÔÏó½Å±¾±à³ÌÓïÑÔ
+Summary(ja.UTF-8): ã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88æ\8c\87å\90\91è¨\80èª\9eRubyã\82¤ã\83³ã\82¿ã\83\97ã\83ªã\82¿
+Summary(pl.UTF-8): Ruby - interpretowany język skryptowy
+Summary(pt_BR.UTF-8): Linguagem de script orientada a objeto
+Summary(zh_CN.UTF-8): ruby - 一种快速高效的面向对象脚本编程语言
Name: ruby
-Version: 1.8.5p2
-Release: 4.2
+Version: 1.8.7
+Release: 1
Epoch: 1
License: The Ruby License
Group: Development/Languages
-Source0: ftp://ftp.ruby-lang.org/pub/ruby/%{name}-1.8.5-p2.tar.gz
-# Source0-md5: a3517a224716f79b14196adda3e88057
+%define patchlevel 22
+Source0: ftp://ftp.ruby-lang.org/pub/ruby/1.8/%{name}-%{version}-p%{patchlevel}.tar.bz2
+# Source0-md5: 2d57acee0d80531e14ec0f6826a1f9fb
Source1: http://www.ibiblio.org/pub/languages/ruby/doc/%{name}-texi-1.4-en.tar.gz
# Source1-md5: 839fda4af52b5c5c6d21f879f7fc62bf
Source2: http://www.math.sci.hokudai.ac.jp/~gotoken/ruby/%{name}-uguide-981227.tar.gz
Source3: http://www.ibiblio.org/pub/languages/ruby/doc/%{name}faq-990927.tar.gz
# Source3-md5: 634c25b14e19925d10af3720d72e8741
Source4: irb.1
-Source5: http://www.geocities.jp/kosako3/oniguruma/archive/onigd2_5_7.tar.gz
-# Source5-md5: dcaa0b3608990791a5348e94b2f427d5
+Source5: http://www.geocities.jp/kosako3/oniguruma/archive/onigd2_5_9.tar.gz
+# Source5-md5: 7e4c2b197387232afd9a11378feeb246
%define stdlibdoc_version 0.10.1
Source6: http://www.ruby-doc.org/download/stdlib/%{name}-doc-stdlib-%{stdlibdoc_version}.tgz
# Source6-md5: 5437c281b44e7a4af142d2bd35eba407
Source11: testrb.1
Source12: %{name}-mode-init.el
Patch0: %{name}-info.patch
-Patch1: %{name}-LIB_PREFIX.patch
Patch2: %{name}-mkmf-shared.patch
-Patch3: %{name}-ac260.patch
+Patch5: %{name}-lib64.patch
URL: http://www.ruby-lang.org/
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: readline-devel >= 4.2
BuildRequires: sed >= 4.0
BuildRequires: texinfo
+%if %{with tk}
BuildRequires: tk-devel
+%endif
BuildRequires: unzip
Requires(post,postun): /sbin/ldconfig
Provides: ruby(ver) = %{ruby_ver}
Obsoletes: rdoc
Obsoletes: ruby-REXML
Obsoletes: ruby-doc < 1.8.4
+Obsoletes: ruby-fastthread
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
# bleh, some nasty (gcc or ruby) bug still not fixed
This package contains only shared library and ruby interpreter. To get
full-functional ruby environment install ruby-modules package.
-%description -l ja
-Ruby¤Ï¥·¥ó¥×¥ë¤«¤Ä¶¯ÎϤʥª¥Ö¥¸¥§¥¯¥È»Ø¸þ¥¹¥¯¥ê¥×¥È¸À¸ì¤Ç¤¹¡¥Ruby¤ÏºÇ½é
-¤«¤é½ã¿è¤Ê¥ª¥Ö¥¸¥§¥¯¥È»Ø¸þ¸À¸ì¤È¤·¤ÆÀ߷פµ¤ì¤Æ¤¤¤Þ¤¹¤«¤é¡¤¥ª¥Ö¥¸¥§¥¯¥È
-»Ø¸þ¥×¥í¥°¥é¥ß¥ó¥°¤ò¼ê·Ú¤Ë¹Ô¤¦»ö¤¬½ÐÍè¤Þ¤¹¡¥¤â¤Á¤í¤óÄ̾ï¤Î¼ê³¤·¿¤Î¥×
-¥í¥°¥é¥ß¥ó¥°¤â²Äǽ¤Ç¤¹¡¥
+%description -l ja.UTF-8
+Rubyはシンプルかつ強力なオブジェクト指向スクリプト言語です.Rubyは最初
+から純粋なオブジェクト指向言語として設計されていますから,オブジェクト
+指向プログラミングを手軽に行う事が出来ます.もちろん通常の手続き型のプ
+ログラミングも可能です.
-%description -l pl
-Ruby to interpretowany jêzyk skryptowy, w sam raz dla ³atwego i
-szybkiego pisania zorientowanych obiektowo programów. Ma wiele funkcji
-u³atwiaj±cych przetwarzanie plików tekstowych i wykonywanie prac
-zwi±zanych z zarz±dzaniem systemu (podobnie jak Perl). Jest prosty,
-rozszerzalny i przeno¶ny.
+%description -l pl.UTF-8
+Ruby to interpretowany język skryptowy, w sam raz dla łatwego i
+szybkiego pisania zorientowanych obiektowo programów. Ma wiele funkcji
+ułatwiających przetwarzanie plików tekstowych i wykonywanie prac
+związanych z zarządzaniem systemu (podobnie jak Perl). Jest prosty,
+rozszerzalny i przenośny.
-Ten pakiet zawiera tylko bibliotekê dzielon± i interpreter ruby.
-Zainstaluj pakiet ruby-modules, je¿eli potrzebujesz w pe³ni
-funkcjonalnego ¶rodowiska ruby.
+Ten pakiet zawiera tylko bibliotekę dzieloną i interpreter ruby.
+Zainstaluj pakiet ruby-modules, jeżeli potrzebujesz w pełni
+funkcjonalnego środowiska ruby.
-%description -l pt_BR
-Ruby é uma linguagem de script interpretada de programação orientada a
-objeto. Possui diversas características para processamento de texto. É
-simples, extensível e direta.
+%description -l pt_BR.UTF-8
+Ruby é uma linguagem de script interpretada de programação orientada a
+objeto. Possui diversas características para processamento de texto. É
+simples, extensível e direta.
%package modules
Summary: Ruby standard modules and utilities
-Summary(pl): Standardowe modu³y i narzêdzia dla jêzyka Ruby
+Summary(pl.UTF-8): Standardowe moduły i narzędzia dla języka Ruby
Group: Development/Languages
Requires: %{name} = %{epoch}:%{version}-%{release}
Provides: ruby-modules(ver) = %{ruby_ver}
- ri - Ruby interactive reference
- testrb - automatic runner for Test::Unit of Ruby
-%description modules -l pl
-Standardowe modu³y i narzêdzia Ruby:
-- erb - ma³y eRuby
-- rdoc - narzêdzie do dokumentowania kodu ¼ród³owego
+%description modules -l pl.UTF-8
+Standardowe moduły i narzędzia Ruby:
+- erb - mały eRuby
+- rdoc - narzędzie do dokumentowania kodu źródłowego
- irb - interaktywny Ruby
- ri - interaktywna dokumentacja Ruby
- testrb - automatyczny runner dla Ruby Test::Unit
%package tk
Summary: Ruby/Tk bindings
-Summary(pl): Wi±zania Ruby/Tk
+Summary(pl.UTF-8): Wiązania Ruby/Tk
Group: Development/Languages
Requires: %{name}-modules = %{epoch}:%{version}-%{release}
%description tk
This pachage contains Ruby/Tk bindings.
-%description tk -l pl
-Ten pakiet zawiera wi±zania Ruby/Tk.
+%description tk -l pl.UTF-8
+Ten pakiet zawiera wiązania Ruby/Tk.
%package devel
Summary: Ruby development libraries
-Summary(pl): Biblioteki programistyczne interpretera jêzyka Ruby
+Summary(pl.UTF-8): Biblioteki programistyczne interpretera języka Ruby
Group: Development/Languages
Requires: %{name}-modules = %{epoch}:%{version}-%{release}
%description devel
Ruby development libraries.
-%description devel -l pl
-Biblioteki programistyczne interpretera jêzyka Ruby.
+%description devel -l pl.UTF-8
+Biblioteki programistyczne interpretera języka Ruby.
%package static
Summary: Ruby static libraries
-Summary(pl): Biblioteki statyczne Ruby
+Summary(pl.UTF-8): Biblioteki statyczne Ruby
Group: Development/Languages
Requires: %{name}-devel = %{epoch}:%{version}-%{release}
%description static
Ruby static libraries.
-%description static -l pl
+%description static -l pl.UTF-8
Biblioteki statyczne Ruby.
%package doc
Summary: Ruby HTML documentation
-Summary(pl): Dokumentacja HTML do Ruby
+Summary(pl.UTF-8): Dokumentacja HTML do Ruby
Group: Documentation
%description doc
Ruby HTML documentation: FAQ, guide, core and standard library.
-%description doc -l pl
+%description doc -l pl.UTF-8
Dokumentacja HTML do Ruby: FAQ, przewodnik, dokumentacja dla core i
stdlib.
%package doc-ri
Summary: Ruby ri documentation
-Summary(pl): Dokumentacja Ruby w formacie ri
+Summary(pl.UTF-8): Dokumentacja Ruby w formacie ri
Group: Documentation
Requires: %{name}-modules = %{epoch}:%{version}-%{release}
%description doc-ri
Ruby ri documentation.
-%description doc-ri -l pl
+%description doc-ri -l pl.UTF-8
Dokumentacja Ruby w formacie ri.
%package examples
Summary: Ruby examples
-Summary(pl): Przyk³ady dla jêzyka Ruby
+Summary(pl.UTF-8): Przykłady dla języka Ruby
Group: Development/Languages
%description examples
Ruby examples.
-%description examples -l pl
-Przyk³ady programów w jêzyku Ruby.
+%description examples -l pl.UTF-8
+Przykłady programów w języku Ruby.
%package emacs-mode
Summary: Ruby mode and debugger for Emacs
-Summary(pl): Tryb Ruby i debugger dla Emacsa
+Summary(pl.UTF-8): Tryb Ruby i debugger dla Emacsa
Group: Development/Tools
Requires: %{name}-modules = %{epoch}:%{version}-%{release}
Requires: emacs-common
%description emacs-mode
Ruby mode and debugger for Emacs.
-%description emacs-mode -l pl
+%description emacs-mode -l pl.UTF-8
Tryb Ruby i debugger dla Emacsa.
%prep
-%setup -q -a1 -a2 -a3 -a5 -a6 -a7 -n %{name}-1.8.5-p2
+%setup -q -n %{name}-%{version}-p%{patchlevel} -a1 -a2 -a3 -a5 -a6 -a7
%patch0 -p1
-%patch1 -p1
%patch2 -p1
-%patch3 -p0
+%patch5 -p1
find . -name '*.rb' -o -name '*.cgi' -o -name '*.test' -o -name 'ruby.1' \
-o -name 'ruby.info*' -o -name '*.html' -o -name '*.tcl' -o -name '*.texi' \
%build
cp -f /usr/share/automake/config.sub .
+%if %{with onigurma}
cd oniguruma
%configure \
--with-rubydir=..
%{__make} 18
cd ..
+%endif
%{__autoconf}
%configure \
--enable-shared \
-%ifnarch powerpc ppc ppc64
+ --with-default-kcode=utf8 \
--enable-pthread
-%else
- --disable-pthread
-%endif
%{__make}
%{__make} clean -C %{name}-texi-1.4-en
%if %{with doc}
mkdir rdoc
-RUBYLIB="lib:`find ext/ .ext/ -type d | tr '\n' ':'`"
+RUBYLIB=".:lib:`find ext/ .ext/ -type d | tr '\n' ':'`"
export RUBYLIB
+LD_LIBRARY_PATH=$(pwd)
+export LD_LIBRARY_PATH
-LD_LIBRARY_PATH=. ./ruby bin/rdoc --inline-source --op rdoc/core \
+./miniruby bin/rdoc --inline-source --op rdoc/core \
array.c bignum.c class.c compar.c dir.c dln.c dmyext.c enum.c \
error.c eval.c file.c gc.c hash.c inits.c io.c lex.c main.c marshal.c \
math.c numeric.c object.c pack.c parse.c prec.c process.c random.c range.c \
mv ruby-doc-stdlib-%{stdlibdoc_version}/stdlib rdoc/stdlib
mv ri/%{ruby_ver}/site ri/%{ruby_ver}/system
-LD_LIBRARY_PATH=. ./ruby bin/rdoc --ri -o ri/%{ruby_ver}/system \
+./miniruby bin/rdoc --ri -o ri/%{ruby_ver}/system \
array.c bignum.c class.c compar.c dir.c dln.c \
dmyext.c enum.c error.c eval.c file.c gc.c hash.c inits.c io.c lex.c main.c \
marshal.c math.c numeric.c object.c pack.c parse.c prec.c process.c \
# ruby emacs mode - borrowed from FC-4
%if %{with emacs}
install misc/*.el $RPM_BUILD_ROOT%{_emacs_lispdir}/%{name}-mode
-rm -f $RPM_BUILD_ROOT%{_emacs_lispdir}/%{name}-mode/rubydb2x.el
+rm -f $RPM_BUILD_ROOT%{_emacs_lispdir}/%{name}-mode/rubydb2x.el*
install %{SOURCE12} $RPM_BUILD_ROOT%{_emacs_lispdir}/site-start.d
cat << EOF > path.el
(setq load-path (cons "." load-path) byte-compile-warnings nil)
%dir %{_libdir}/%{name}/site_ruby
%dir %{_libdir}/%{name}/site_ruby/%{ruby_ver}
%dir %{_libdir}/%{name}/site_ruby/%{ruby_ver}/*-linux*
+%dir %{_libdir}/%{name}/vendor_ruby
+%dir %{_libdir}/%{name}/vendor_ruby/%{ruby_ver}
+%dir %{_libdir}/%{name}/vendor_ruby/%{ruby_ver}/*-linux*
%dir %{_datadir}/%{name}
%dir %{_datadir}/ri
%dir %{_datadir}/ri/%{ruby_ver}
%defattr(644,root,root,755)
%{_libdir}/lib*.a
+%if %{with tk}
%files tk
%defattr(644,root,root,755)
%{_libdir}/%{name}/%{ruby_ver}/tcltk.rb
%{_libdir}/%{name}/%{ruby_ver}/tk
%{_libdir}/%{name}/%{ruby_ver}/tkextlib
%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/t*.so
+%endif
%files modules
%defattr(644,root,root,755)
%{_libdir}/%{name}/%{ruby_ver}/bigdecimal
%{_libdir}/%{name}/%{ruby_ver}/cgi
%{_libdir}/%{name}/%{ruby_ver}/date
+%{_libdir}/%{name}/%{ruby_ver}/digest
%{_libdir}/%{name}/%{ruby_ver}/dl
%{_libdir}/%{name}/%{ruby_ver}/drb
%{_libdir}/%{name}/%{ruby_ver}/io
%dir %{_libdir}/%{name}/%{ruby_ver}/*-linux*/io
%dir %{_libdir}/%{name}/%{ruby_ver}/*-linux*/racc
%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/[a-s]*.so
+%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/thread.so
%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/[u-z]*.so
%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/digest/*.so
%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/io/*.so