3 # - include ext/ in docs
4 # - replace ri with fastri
5 # - patch ri to search multiple indexes (one per package), so RPMs can install ri docs
6 # - fix inconsistencies with versioned vs not-versioned dirs (see dirname hacks in configure)
9 %bcond_without doc # skip (time-consuming) docs generating; intended for speed up test builds
10 %bcond_without tk # skip building package with Tk bindings
11 %bcond_without batteries # Don't include rubygems, json or rake
12 %bcond_without verpath # LOAD_PATH with version number
13 %bcond_with bootstrap # build bootstrap version
15 %define ruby_version 1.9
17 %define patchlevel 392
18 %define doc_version 1_9_3
19 %define json_ver 1.5.5
20 %define rake_ver 0.9.2.2
21 %define rubygems_ver 1.8.11
22 %define minitest_ver 2.5.1
23 %define rdoc_ver 3.9.5
24 Summary: Ruby - interpreted scripting language
25 Summary(ja.UTF-8): オブジェクト指向言語Rubyインタプリタ
26 Summary(pl.UTF-8): Ruby - interpretowany język skryptowy
27 Summary(pt_BR.UTF-8): Linguagem de script orientada a objeto
28 Summary(zh_CN.UTF-8): ruby - 一种快速高效的面向对象脚本编程语言
30 Version: %{basever}.%{patchlevel}
31 # NOTE: do not decrease Release, when updating Version, unless rdoc_ver was increased as well
34 License: The Ruby License
35 Group: Development/Languages
36 Source0: ftp://ftp.ruby-lang.org/pub/ruby/%{ruby_version}/%{name}-%{basever}-p%{patchlevel}.tar.bz2
37 # Source0-md5: a810d64e2255179d2f334eb61fb8519c
38 Source1: http://www.ruby-doc.org/download/%{name}-doc-bundle.tar.gz
39 # Source1-md5: ad1af0043be98ba1a4f6d0185df63876
40 Source2: http://www.ruby-doc.org/downloads/%{name}_%{doc_version}_stdlib_rdocs.tgz
41 # Source2-md5: ec622612428672c432b6f65dd31a84b5
42 Source3: http://www.ruby-doc.org/downloads/%{name}_%{doc_version}_core_rdocs.tgz
43 # Source3-md5: 1892aadde51d36106c513bced2193dff
44 Source100: ftp://ftp.ruby-lang.org/pub/ruby/1.8/%{name}-1.8.7-p330.tar.gz
45 # Source100-md5: 50a49edb787211598d08e756e733e42e
48 Source6: %{name}-mode-init.el
49 Patch0: %{name}-lib64.patch
50 Patch1: %{name}-ffs.patch
51 Patch2: fix-bison-invocation.patch
52 # http://redmine.ruby-lang.org/issues/5231
53 Patch3: disable-versioned-paths.patch
54 # TODO: Should be submitted upstream?
55 Patch4: arch-specific-dir.patch
56 # http://redmine.ruby-lang.org/issues/5281
57 Patch5: site-and-vendor-arch-flags.patch
58 URL: http://www.ruby-lang.org/
59 BuildRequires: autoconf >= 2.60
60 BuildRequires: automake
62 BuildRequires: db-devel
63 BuildRequires: gdbm-devel >= 1.8.3
64 BuildRequires: libffi-devel
65 BuildRequires: ncurses-devel
66 BuildRequires: openssl-devel
67 BuildRequires: pkgconfig
68 BuildRequires: readline-devel >= 4.2
69 %{!?with_bootstrap:BuildRequires: ruby-modules}
70 BuildRequires: sed >= 4.0
71 BuildRequires: yaml-devel
73 BuildRequires: tk-devel
75 Requires(post,postun): /sbin/ldconfig
76 Provides: ruby(ver) = %{ruby_version}
79 Obsoletes: ruby-doc < 1.8.4
80 Obsoletes: ruby-fastthread
82 Provides: json = %{json_ver}
83 Provides: rake = %{rake_ver}
84 Provides: ruby-json = %{json_ver}
85 Provides: ruby-rake = %{rake_ver}
86 Provides: ruby-rubygems = %{rubygems_ver}
87 Provides: rubygems = %{rubygems_ver}
90 Obsoletes: ruby-rubygems
92 Conflicts: ruby-activesupport < 2.3.11-2
93 Conflicts: ruby-activesupport2 < 2.3.11-2
94 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
96 %define ruby_ridir %{_datadir}/ri/%{ruby_version}/system
97 %define gem_dir %{_datadir}/%{name}/gems/%{ruby_version}
99 # The RubyGems library has to stay out of Ruby directory three, since the
100 # RubyGems should be share by all Ruby implementations.
101 %define rubygems_dir %{_datadir}/rubygems
103 %define ruby_archdir %{_libdir}/%{name}/%{ruby_version}
104 %define ruby_libdir %{_datadir}/%{name}/%{ruby_version}
106 # This is the local lib/arch and should not be used for packaging.
107 %define sitedir site_ruby
108 %define ruby_sitedir %{_prefix}/local/share/%{name}/%{sitedir}
109 %define ruby_sitearchdir %{_prefix}/local/%{_lib}/%{name}/%{sitedir}/%{ruby_version}
110 %define ruby_sitelibdir %{_prefix}/local/share/%{name}/%{sitedir}/%{ruby_version}
112 # This is the general location for libs/archs compatible with all
113 # or most of the Ruby versions available in the PLD repositories.
114 %define vendordir vendor_ruby
115 %define ruby_vendordir %{_datadir}/%{name}/%{vendordir}
116 %define ruby_vendorarchdir %{_libdir}/%{name}/%{vendordir}/%{ruby_version}
117 %define ruby_vendorlibdir %{_datadir}/%{name}/%{vendordir}/%{ruby_version}
119 # TODO: drop legacy loadpaths after all ruby modules rebuilt in Th
120 %define legacy_libdir %{_libdir}/%{name}/%{ruby_version}
121 %define legacy_archdir %{_libdir}/%{name}/%{ruby_version}/%{_arch}-linux
122 %define legacy_sitedir %{_libdir}/%{name}/%{sitedir}
123 %define legacy_sitelibdir %{_libdir}/%{name}/%{sitedir}/%{ruby_version}
124 %define legacy_sitearchdir %{_libdir}/%{name}/%{sitedir}/%{ruby_version}/%{_arch}-linux
125 %define legacy_vendordir %{_libdir}/%{name}/%{vendordir}
126 %define legacy_vendorlibdir %{_libdir}/%{name}/%{vendordir}/%{ruby_version}
127 %define legacy_vendorarchdir%{_libdir}/%{name}/%{vendordir}/%{ruby_version}/%{_arch}-linux
129 %define legacy_siteloadpath %{legacy_sitelibdir}\\0%{legacy_sitearchdir}\\0%{legacy_sitedir}
130 %define legacy_vendorloadpath %{legacy_vendorlibdir}\\0%{legacy_vendorarchdir}
131 %define legacy_loadpath %{legacy_archdir}
132 %define legacy_loadpaths %{legacy_siteloadpath}\\0%{legacy_vendorloadpath}\\0%{legacy_loadpath}
134 # bleh, some nasty (gcc or ruby) bug still not fixed
135 # (SEGV or "unexpected break" on miniruby run during build)
136 %define specflags_ia64 -O0
138 # ruby needs frame pointers for correct exception handling
139 %define specflags_ia32 -fno-omit-frame-pointer
142 Ruby is the interpreted scripting language for quick and easy
143 object-oriented programming. It has many features to process text
144 files and to do system management tasks (as in Perl). It is simple,
145 straight-forward, extensible, and portable.
147 This package contains only shared library and ruby interpreter. To get
148 full-functional ruby environment install ruby-modules package.
150 %description -l ja.UTF-8
151 Rubyはシンプルかつ強力なオブジェクト指向スクリプト言語です.Rubyは最初
152 から純粋なオブジェクト指向言語として設計されていますから,オブジェクト
153 指向プログラミングを手軽に行う事が出来ます.もちろん通常の手続き型のプ ログラミングも可能です.
155 %description -l pl.UTF-8
156 Ruby to interpretowany język skryptowy, w sam raz dla łatwego i
157 szybkiego pisania zorientowanych obiektowo programów. Ma wiele funkcji
158 ułatwiających przetwarzanie plików tekstowych i wykonywanie prac
159 związanych z zarządzaniem systemu (podobnie jak Perl). Jest prosty,
160 rozszerzalny i przenośny.
162 Ten pakiet zawiera tylko bibliotekę dzieloną i interpreter ruby.
163 Zainstaluj pakiet ruby-modules, jeżeli potrzebujesz w pełni
164 funkcjonalnego środowiska ruby.
166 %description -l pt_BR.UTF-8
167 Ruby é uma linguagem de script interpretada de programação orientada a
168 objeto. Possui diversas características para processamento de texto. É
169 simples, extensível e direta.
172 Summary: Ruby standard modules and utilities
173 Summary(pl.UTF-8): Standardowe moduły i narzędzia dla języka Ruby
174 Group: Development/Languages
175 Requires: %{name} = %{epoch}:%{version}-%{release}
176 # workaround for autodep generator not getting version properly
177 Provides: ruby(abi) = %{ruby_version}
178 Provides: ruby-modules(ver) = %{ruby_version}
179 Obsoletes: ruby-minitest
182 Ruby standard modules and utilities:
184 - irb - interactive Ruby
185 - testrb - automatic runner for Test::Unit of Ruby
187 %description modules -l pl.UTF-8
188 Standardowe moduły i narzędzia Ruby:
190 - irb - interaktywny Ruby
191 - testrb - automatyczny runner dla Ruby Test::Unit
194 Summary: Ruby/Tk bindings
195 Summary(pl.UTF-8): Wiązania Ruby/Tk
196 Group: Development/Languages
197 Requires: %{name}-modules = %{epoch}:%{version}-%{release}
200 This pachage contains Ruby/Tk bindings.
202 %description tk -l pl.UTF-8
203 Ten pakiet zawiera wiązania Ruby/Tk.
206 Summary: Ruby development libraries
207 Summary(pl.UTF-8): Biblioteki programistyczne interpretera języka Ruby
208 Group: Development/Languages
209 Requires: %{name}-modules = %{epoch}:%{version}-%{release}
212 Ruby development libraries.
214 %description devel -l pl.UTF-8
215 Biblioteki programistyczne interpretera języka Ruby.
218 Summary: Ruby static libraries
219 Summary(pl.UTF-8): Biblioteki statyczne Ruby
220 Group: Development/Languages
221 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
224 Ruby static libraries.
226 %description static -l pl.UTF-8
227 Biblioteki statyczne Ruby.
230 Summary: Ruby HTML documentation
231 Summary(pl.UTF-8): Dokumentacja HTML do Ruby
235 Ruby HTML documentation: FAQ, guide, core and standard library.
237 %description doc -l pl.UTF-8
238 Dokumentacja HTML do Ruby: FAQ, przewodnik, dokumentacja dla core i
242 Summary: Ruby ri documentation
243 Summary(pl.UTF-8): Dokumentacja Ruby w formacie ri
245 Requires: %{name}-modules = %{epoch}:%{version}-%{release}
248 Ruby ri documentation.
250 %description doc-ri -l pl.UTF-8
251 Dokumentacja Ruby w formacie ri.
254 Summary: Ruby examples
255 Summary(pl.UTF-8): Przykłady dla języka Ruby
256 Group: Development/Languages
258 %description examples
261 %description examples -l pl.UTF-8
262 Przykłady programów w języku Ruby.
264 # IMPORTANT: keep this as last package, as we reset Epoch
266 Summary: A tool to generate HTML and command-line documentation for Ruby projects
269 License: GPL v2 and Ruby and MIT
270 Group: Development/Libraries
271 Requires: %{name}-modules = 1:%{basever}.%{patchlevel}-%{release}
274 RDoc produces HTML and command-line documentation for Ruby projects.
275 RDoc includes the 'rdoc' and 'ri' tools for generating and displaying
276 online documentation.
279 %if %{with bootstrap}
280 %setup -q -n %{name}-%{basever}-p%{patchlevel} -a1 -a2 -a3 -a100
282 %setup -q -n %{name}-%{basever}-p%{patchlevel} -a1 -a2 -a3
291 # must be regenerated with new bison
294 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
296 find -type f '(' -name '*.rb' -o -name '*.cgi' -o -name '*.test' \
297 -o -name 'ruby.1' -o -name '*.html' -o -name '*.tcl' ')' \
298 | xargs %{__sed} -i 's,/usr/local/bin/,%{_bindir}/,'
301 cp -f /usr/share/automake/config.sub .
303 # build ruby-1.8.7 first
304 %if %{with bootstrap}
305 cd %{name}-1.8.7-p330
313 %{?with_bootstrap:--with-baseruby=%{name}-1.8.7-p330/miniruby} \
314 --with-rubylibprefix=%(dirname %{ruby_libdir}) \
315 --with-archdir=%{ruby_archdir} \
316 --with-sitedir=%(dirname %{ruby_sitelibdir}) \
317 --with-sitearchdir=%(dirname %{ruby_sitearchdir}) \
318 --with-vendordir=%(dirname %{ruby_vendorlibdir}) \
319 --with-vendorarchdir=%(dirname %{ruby_vendorarchdir}) \
320 --with-rubygemsdir=%{rubygems_dir} \
321 --with-search-path="%{legacy_loadpaths}" \
324 --disable-install-doc \
325 %{!?with_verpath:--disable-versioned-paths} \
326 --with-ruby-version=minor
330 %{?with_bootstrap:BASERUBY="ruby-1.8.7-p330/miniruby -I./ruby-1.8.7-p330/lib"}
337 rm -rf $RPM_BUILD_ROOT
338 install -d $RPM_BUILD_ROOT{%{ruby_rdocdir},%{_examplesdir}/%{name}-%{version}} \
339 $RPM_BUILD_ROOT%{ruby_libdir}/tasks \
340 $RPM_BUILD_ROOT{%{ruby_vendorarchdir},%{ruby_ridir}} \
341 $RPM_BUILD_ROOT{%{legacy_archdir},%{legacy_sitelibdir},%{legacy_sitearchdir},%{legacy_vendorarchdir}} \
343 %{__make} install %{?with_doc:install-doc} \
344 DESTDIR=$RPM_BUILD_ROOT
346 cp -Rf sample/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
347 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_mandir}/man1
348 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_mandir}/man1
350 %{__rm} -rf $RPM_BUILD_ROOT%{_docdir}/%{name}/html
352 %if %{without batteries}
353 # packaged separately
354 %{__rm} -r $RPM_BUILD_ROOT%{ruby_libdir}/{rubygems,rake,json,tasks}
355 %{__rm} -r $RPM_BUILD_ROOT%{ruby_archdir}/json
356 %{__rm} $RPM_BUILD_ROOT%{ruby_libdir}/{rake,rubygems,json}.rb
357 %{__rm} $RPM_BUILD_ROOT%{_bindir}/{gem,rake}
358 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/rake*
359 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/ri/%{ruby_version}/system/JSON
363 %{__rm} $RPM_BUILD_ROOT%{ruby_ridir}/cache.ri
364 %{__rm} $RPM_BUILD_ROOT%{ruby_ridir}/created.rid
367 rm -rf $RPM_BUILD_ROOT
369 %post -p /sbin/ldconfig
370 %postun -p /sbin/ldconfig
373 %defattr(644,root,root,755)
374 %doc NEWS LEGAL README README.EXT ChangeLog ToDo
375 %attr(755,root,root) %{_bindir}/ruby
376 %if %{with batteries}
377 %attr(755,root,root) %{_bindir}/gem
378 %attr(755,root,root) %{_bindir}/rake
380 %attr(755,root,root) %{_libdir}/libruby.so.*.*.*
381 %attr(755,root,root) %ghost %{_libdir}/libruby.so.1.9
382 %{_mandir}/man1/ruby.1*
383 %if %{with batteries}
384 %{_mandir}/man1/rake.1*
387 %dir %{_libdir}/%{name}
388 %dir %{_libdir}/%{name}/%{vendordir}
389 %dir %{_datadir}/%{name}
390 %dir %{_datadir}/%{name}/%{vendordir}
394 %dir %{ruby_vendorlibdir}
395 %dir %{ruby_vendorarchdir}
398 %dir %{_datadir}/ri/%{ruby_version}
403 # legacy dirs. when everything rebuilt in Th not using these dirs. drop them
404 %dir %{legacy_archdir}
405 %dir %{legacy_sitedir}
406 %dir %{legacy_sitelibdir}
407 %dir %{legacy_sitearchdir}
408 %dir %{legacy_vendorarchdir}
411 %defattr(644,root,root,755)
412 %attr(755,root,root) %{_libdir}/libruby.so
413 %{_includedir}/%{name}-%{ruby_version}
414 %{_pkgconfigdir}/ruby-%{ruby_version}.pc
417 %defattr(644,root,root,755)
418 %{_libdir}/libruby-static.a
422 %defattr(644,root,root,755)
423 %{ruby_libdir}/tcltk.rb
424 %{ruby_libdir}/tk*.rb
426 %{ruby_libdir}/tkextlib
427 %attr(755,root,root) %{ruby_archdir}/t*.so
431 %defattr(644,root,root,755)
432 %attr(755,root,root) %{_bindir}/rdoc
433 %attr(755,root,root) %{_bindir}/ri
434 %{_mandir}/man1/rdoc.1*
436 %dir %{gem_dir}/gems/rdoc-%{rdoc_ver}
437 %dir %{gem_dir}/gems/rdoc-%{rdoc_ver}/bin
438 %attr(755,root,root) %{gem_dir}/gems/rdoc-%{rdoc_ver}/bin/rdoc
439 %{gem_dir}/specifications/rdoc-%{rdoc_ver}.gemspec
440 %attr(755,root,root) %{gem_dir}/gems/rdoc-%{rdoc_ver}/bin/ri
443 %defattr(644,root,root,755)
444 %attr(755,root,root) %{_bindir}/erb
445 %attr(755,root,root) %{_bindir}/irb
446 %attr(755,root,root) %{_bindir}/testrb
447 %{ruby_libdir}/bigdecimal
450 %{ruby_libdir}/digest
453 %{ruby_libdir}/fiddle
456 %{ruby_libdir}/matrix
457 %{ruby_libdir}/minitest
459 %{ruby_libdir}/openssl
460 %{ruby_libdir}/optparse
461 %if %{with batteries}
464 %{ruby_libdir}/rubygems
465 %dir %{ruby_libdir}/tasks
469 %{ruby_libdir}/rbconfig
472 %{ruby_libdir}/ripper
478 %{ruby_libdir}/webrick
479 %{ruby_libdir}/xmlrpc
481 %{ruby_libdir}/[A-Za-s]*.rb
482 %{ruby_libdir}/tempfile.rb
483 %{ruby_libdir}/thread.rb
484 %{ruby_libdir}/thwait.rb
485 %{ruby_libdir}/time.rb
486 %{ruby_libdir}/timeout.rb
487 %{ruby_libdir}/tmpdir.rb
488 %{ruby_libdir}/tracer.rb
489 %{ruby_libdir}/tsort.rb
490 %{ruby_libdir}/[u-z]*.rb
491 %attr(755,root,root) %{ruby_archdir}/[a-s]*.so
492 %attr(755,root,root) %{ruby_archdir}/[u-z]*.so
493 %dir %{ruby_archdir}/digest
494 %attr(755,root,root) %{ruby_archdir}/digest/*.so
495 %dir %{ruby_archdir}/dl
496 %attr(755,root,root) %{ruby_archdir}/dl/callback.so
497 %dir %{ruby_archdir}/enc
498 %attr(755,root,root) %{ruby_archdir}/enc/*.so
499 %dir %{ruby_archdir}/enc/trans
500 %attr(755,root,root) %{ruby_archdir}/enc/trans/*.so
501 %dir %{ruby_archdir}/io
502 %attr(755,root,root) %{ruby_archdir}/io/*.so
503 %if %{with batteries}
504 %dir %{ruby_archdir}/json
505 %dir %{ruby_archdir}/json/ext
506 %attr(755,root,root) %{ruby_archdir}/json/ext/*.so
508 %dir %{ruby_archdir}/mathn
509 %attr(755,root,root) %{ruby_archdir}/mathn/*.so
510 %dir %{ruby_archdir}/racc
511 %attr(755,root,root) %{ruby_archdir}/racc/*.so
512 %{ruby_archdir}/rbconfig.rb
515 %dir %{_datadir}/%{name}/gems
516 #%dir %{_datadir}/%{name}/gems/%{ruby_version}
517 %dir %{_datadir}/%{name}/gems/%{ruby_version}/gems
520 %dir %{gem_dir}/specifications
521 %{gem_dir}/specifications/io-console-*.gemspec
522 %{gem_dir}/specifications/bigdecimal-*.gemspec
523 %if %{with batteries}
524 %dir %{gem_dir}/gems/rake-%{rake_ver}
525 %dir %{gem_dir}/gems/rake-%{rake_ver}/bin
526 %attr(755,root,root) %{gem_dir}/gems/rake-%{rake_ver}/bin/rake
527 %{gem_dir}/specifications/minitest-%{minitest_ver}.gemspec
528 %{gem_dir}/specifications/rake-%{rake_ver}.gemspec
529 %{gem_dir}/specifications/json-%{json_ver}.gemspec
531 %{_mandir}/man1/erb.1*
532 %{_mandir}/man1/irb.1*
533 %{_mandir}/man1/ri.1*
534 %{_mandir}/man1/testrb.1*
537 %defattr(644,root,root,755)
538 %doc ruby-doc-bundle/*
539 %{?with_doc:%doc ruby_%{doc_version}_stdlib}
540 %{?with_doc:%doc ruby_%{doc_version}_core}
544 %defattr(644,root,root,755)
549 %defattr(644,root,root,755)
550 %{_examplesdir}/%{name}-%{version}