-#
# TODO:
# - include ext/ in docs
# - replace ri with fastri
%bcond_without batteries # Don't include rubygems, json, rake, minitest
%bcond_with bootstrap # build bootstrap version
+%define rel 3
%define ruby_version 1.9
%define basever 1.9.3
-%define patchlevel 426
+%define patchlevel 448
%define doc_version 1_9_3
%define json_ver 1.5.5
%define rake_ver 0.9.2.2
+# when increasing rubygems_ver, please remove "11." prefix in rubygems package release
%define rubygems_ver 1.8.11
%define minitest_ver 2.5.1
+# when increasing rdoc_ver, please remove "11." prefix in rdoc package release
%define rdoc_ver 3.9.5
+%define irb_ver 0.9.6
%define bigdecimal_ver 1.1.0
%define io_console_ver 0.3
Summary: Ruby - interpreted scripting language
Summary(zh_CN.UTF-8): ruby - 一种快速高效的面向对象脚本编程语言
Name: ruby
Version: %{basever}.%{patchlevel}
-# NOTE: do not decrease Release, when updating Version,
-# unless rdoc_ver, rubygems_ver *both* are increased as well
-Release: 11
+Release: %{rel}
Epoch: 1
# Public Domain for example for: include/ruby/st.h, strftime.c, ...
License: (Ruby or BSD) and Public Domain
Group: Development/Languages
Source0: ftp://ftp.ruby-lang.org/pub/ruby/1.9/%{name}-%{basever}-p%{patchlevel}.tar.bz2
-# Source0-md5: c211205e65d7253fc2a4620a34bc9245
+# Source0-md5: aa710d386e5903f78f0231868255e6af
Source1: http://www.ruby-doc.org/download/%{name}-doc-bundle.tar.gz
# Source1-md5: ad1af0043be98ba1a4f6d0185df63876
Source2: http://www.ruby-doc.org/downloads/%{name}_%{doc_version}_stdlib_rdocs.tgz
Patch5: site-and-vendor-arch-flags.patch
# Make mkmf verbose by default
Patch6: mkmf-verbose.patch
+Patch7: strip-ccache.patch
+Patch8: bison3.patch
URL: http://www.ruby-lang.org/
BuildRequires: autoconf >= 2.60
BuildRequires: automake
-BuildRequires: bison
+BuildRequires: bison >= 1.875
BuildRequires: db-devel
BuildRequires: gdbm-devel >= 1.8.3
BuildRequires: libffi-devel
# ruby-modules deprecated, rpm5 generates ruby(abi) itself
Provides: ruby-modules(ver) = %{ruby_version}
%if %{with batteries}
-Provides: rake = %{rake_ver}
-Provides: ruby-json = %{json_ver}
Provides: ruby-minitest = %{minitest_ver}
-Provides: ruby-rake = %{rake_ver}
-Obsoletes: ruby-json <= 1.5.4
Obsoletes: ruby-minitest <= 1.5.0
-Obsoletes: ruby-rake < 0.9.2.2
%endif
%description modules
Ruby standard modules and utilities:
- erb - Tiny eRuby
-- irb - interactive Ruby
- testrb - automatic runner for Test::Unit of Ruby
%description modules -l pl.UTF-8
Standardowe moduły i narzędzia Ruby:
- erb - mały eRuby
-- irb - interaktywny Ruby
- testrb - automatyczny runner dla Ruby Test::Unit
%package tk
Summary(pl.UTF-8): Biblioteki programistyczne interpretera języka Ruby
Group: Development/Languages
Requires: %{name}-modules = %{epoch}:%{version}-%{release}
+Requires: gcc
+Requires: glibc-devel
Requires: pkgconfig
%description devel
%description examples -l pl.UTF-8
Przykłady programów w języku Ruby.
-# IMPORTANT: keep this as last package, as we reset Epoch
+# IMPORTANT: keep irb, rdoc, rubygems, rake, json as last packages as we reset epoch/version/release
+# and %{version},%{release} macros may not be used directly as they take last
+# subpackage value not main package one what you intend to use
+
+%package irb
+Summary: The Interactive Ruby
+Version: %{irb_ver}
+Group: Development/Languages
+Release: %{basever}.%{patchlevel}.%{rel}
+Epoch: 0
+Requires: %{name}-modules = 1:%{basever}.%{patchlevel}-%{rel}
+Provides: irb = %{version}-%{release}
+Provides: ruby(irb) = %{version}-%{release}
+%if "%{_rpmversion}" >= "5"
+BuildArch: noarch
+%endif
+
+%description irb
+The irb is acronym for Interactive Ruby. It evaluates ruby expression
+from the terminal.
+
%package rdoc
Summary: A tool to generate HTML and command-line documentation for Ruby projects
Summary(pl.UTF-8): Narzędzie do generowania dokumentacji HTML i linii poleceń dla projektów w Rubym
Version: %{rdoc_ver}
+# remove "11." when rdoc_ver is increased
+Release: 11.%{basever}.%{patchlevel}.%{rel}
Epoch: 0
License: GPL v2 and Ruby and MIT
Group: Development/Libraries
-Requires: %{name}-modules = 1:%{basever}.%{patchlevel}-%{release}
+Requires: %{name}-modules = 1:%{basever}.%{patchlevel}-%{rel}
Obsoletes: rdoc <= 0.9.0
%if "%{_rpmversion}" >= "5"
BuildArch: noarch
Summary: RubyGems - the Ruby standard for packaging Ruby libraries
Summary(pl.UTF-8): RubyGems - standard Ruby'ego pakietowania bibliotek
Version: %{rubygems_ver}
+# remove "11." when rubygems_ver is increased
+Release: 11.%{basever}.%{patchlevel}.%{rel}
Epoch: 0
License: Ruby or MIT
Group: Development/Libraries
-Requires: %{name}-modules = 1:%{basever}.%{patchlevel}-%{release}
+Requires: %{name}-modules = 1:%{basever}.%{patchlevel}-%{rel}
Requires: %{name}-rdoc >= %{rdoc_ver}
+Suggests: %{name}-devel
Provides: rubygems = %{rubygems_ver}
%if "%{_rpmversion}" >= "5"
BuildArch: noarch
RubyGems to standardowe narzędzie języka Ruby do publikowania i
zarządzania zewnętrznymi bibliotekami.
+%package rake
+Summary: Rake is a Make-like program implemented in Ruby
+Summary(pl.UTF-8): Program typu Make dla języka Ruby
+Version: %{rake_ver}
+Release: %{basever}.%{patchlevel}.%{rel}
+Epoch: 0
+License: MIT
+Group: Development/Languages
+Provides: rake = %{rake_ver}
+Conflicts: ruby-modules < 1:1.9.3.429-2
+%if "%{_rpmversion}" >= "5"
+BuildArch: noarch
+%endif
+
+%description rake
+Rake is a simple Ruby build program with capabilities similar to make.
+
+It has the following features:
+- Rakefiles (rake's version of Makefiles) are completely defined in
+ standard Ruby syntax. No XML files to edit. No quirky Makefile syntax
+ to worry about (is that a tab or a space?)
+- Users can specify tasks with prerequisites.
+- Rake supports rule patterns to synthesize implicit tasks.
+- Rake is lightweight. It can be distributed with other projects as a
+ single file. Projects that depend upon rake do not require that rake
+ be installed on target systems.
+
+%description rake -l pl.UTF-8
+Rake to prosty program do budowania w języku Ruby o możliwościach
+podobnych do make.
+
+Ma następujące cechy:
+- Pliki Rakefile (rake'owa odmiana plików Makefile) są definiowane
+ całkowicie w standardowej składni języka Ruby. Nie trzeba modyfikować
+ plików XML. Nie trzeba martwić się kaprysami składni Makefile (czy to
+ tabulacja czy spacja?).
+- Użytkownicy mogą określać zadania z ich zależnościami.
+- Rake obsługuje wzorce reguł do tworzenia z nich wynikowych zadań.
+- Rake jest lekki. Może być rozpowszechniany z innymi projektami jako
+ pojedynczy plik. Projekty używające rake'a nie wymagają go
+ zainstalowanego na systemach docelowych.
+
+%package json
+Summary: JSON library for Ruby
+Summary(pl.UTF-8): Biblioteka JSON dla języka Ruby
+Version: %{json_ver}
+Release: %{basever}.%{patchlevel}.%{rel}
+Epoch: 0
+License: MIT
+Group: Development/Languages
+Obsoletes: ruby-json-rubyforge
+Conflicts: ruby-modules < 1:1.9.3.429-3
+
+%description json
+This is a JSON implementation as a Ruby extension in C.
+
+%description json -l pl.UTF-8
+Biblioteka JSON dla języka Ruby.
+
%prep
%if %{with bootstrap}
%setup -q -n %{name}-%{basever}-p%{patchlevel} -a1 -a2 -a3 -a100
%patch3 -p1
%patch4 -p1
%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
# must be regenerated with new bison
%{__rm} parse.{c,h}
install -d $RPM_BUILD_ROOT{%{ruby_rdocdir},%{_examplesdir}/%{name}-%{version}} \
$RPM_BUILD_ROOT{%{ruby_vendorarchdir},%{ruby_ridir}} \
$RPM_BUILD_ROOT%{ruby_vendorlibdir}/net \
+ $RPM_BUILD_ROOT%{ruby_vendordir}/data \
$RPM_BUILD_ROOT{%{legacy_archdir}/racc,%{legacy_sitelibdir},%{legacy_sitearchdir},%{legacy_vendorarchdir},%{legacy_libdir}/tasks} \
%{__make} install %{?with_doc:install-doc} \
%{__rm} -rf $RPM_BUILD_ROOT%{_docdir}/%{name}/html
+ln -sf %{gem_dir}/gems/rake-%{rake_ver}/bin/rake $RPM_BUILD_ROOT%{_bindir}/rake
+
%if %{without batteries}
# packaged separately
%{__rm} -r $RPM_BUILD_ROOT%{ruby_libdir}/{rubygems,rake,json,minitest}
%attr(755,root,root) %ghost %{_libdir}/libruby.so.1.9
%{_mandir}/man1/ruby.1*
-%if %{with batteries}
-# rake
-%attr(755,root,root) %{_bindir}/rake
-%{_mandir}/man1/rake.1*
-%endif
-
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/%{vendordir}
%dir %{_datadir}/%{name}
-%dir %{_datadir}/%{name}/%{vendordir}
%dir %{ruby_libdir}
%dir %{ruby_archdir}
+%dir %{ruby_vendordir}
+%dir %{ruby_vendordir}/data
%dir %{ruby_vendorlibdir}
%dir %{ruby_vendorarchdir}
%attr(755,root,root) %{ruby_archdir}/t*.so
%endif
+%files irb
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/irb
+%{ruby_libdir}/irb.rb
+%{ruby_libdir}/irb
+%{_mandir}/man1/irb.1*
+
%files rdoc
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/rdoc
%{ruby_libdir}/rubygems
%{ruby_libdir}/rubygems.rb
%{ruby_libdir}/ubygems.rb
+
+%files rake
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/rake
+%{_mandir}/man1/rake.1*
+%{ruby_libdir}/rake
+%dir %{gem_dir}/gems/rake-%{rake_ver}
+%dir %{gem_dir}/gems/rake-%{rake_ver}/bin
+%attr(755,root,root) %{gem_dir}/gems/rake-%{rake_ver}/bin/rake
+%{gem_dir}/specifications/rake-%{rake_ver}.gemspec
+
+%files json
+%defattr(644,root,root,755)
+%{ruby_libdir}/json
+%dir %{ruby_archdir}/json
+%dir %{ruby_archdir}/json/ext
+%attr(755,root,root) %{ruby_archdir}/json/ext/*.so
+%{gem_dir}/specifications/json-%{json_ver}.gemspec
%endif
%files modules
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/erb
-%attr(755,root,root) %{_bindir}/irb
%attr(755,root,root) %{_bindir}/testrb
%{ruby_libdir}/bigdecimal
%{ruby_libdir}/cgi
%{ruby_libdir}/drb
%{ruby_libdir}/fiddle
%{ruby_libdir}/io
-%{ruby_libdir}/irb
%{ruby_libdir}/matrix
%{ruby_libdir}/net
%{ruby_libdir}/openssl
%exclude %{ruby_libdir}/rubygems.rb
%exclude %{ruby_libdir}/ubygems.rb
%endif
+%exclude %{ruby_libdir}/irb.rb
%exclude %{ruby_libdir}/mkmf.rb
%attr(755,root,root) %{ruby_archdir}/[a-s]*.so
%attr(755,root,root) %{ruby_archdir}/[u-z]*.so
%{gem_dir}/specifications/io-console-%{io_console_ver}.gemspec
%if %{with batteries}
-# json
-%{ruby_libdir}/json
-%dir %{ruby_archdir}/json
-%dir %{ruby_archdir}/json/ext
-%attr(755,root,root) %{ruby_archdir}/json/ext/*.so
-%{gem_dir}/specifications/json-%{json_ver}.gemspec
-
# minitest
%{ruby_libdir}/minitest
%{gem_dir}/specifications/minitest-%{minitest_ver}.gemspec
-
-# rake
-%{ruby_libdir}/rake
-%dir %{gem_dir}/gems/rake-%{rake_ver}
-%dir %{gem_dir}/gems/rake-%{rake_ver}/bin
-%attr(755,root,root) %{gem_dir}/gems/rake-%{rake_ver}/bin/rake
-%{gem_dir}/specifications/rake-%{rake_ver}.gemspec
%endif
# parents of gem_dir
%dir %{gem_dir}
%dir %{gem_dir}/specifications
%{_mandir}/man1/erb.1*
-%{_mandir}/man1/irb.1*
%{_mandir}/man1/ri.1*
%{_mandir}/man1/testrb.1*