%define subver 1.9 %define rubyver 1.9.3 %define patchversion p194 %define rel 1 Summary: Object Oriented Script Language Name: ruby Version: %{rubyver}.%{patchversion} Release: %mkrel %rel License: Ruby or GPLv2 Group: Development/Ruby BuildRequires: autoconf BuildRequires: byacc BuildRequires: ncurses-devel BuildRequires: readline-devel BuildRequires: tcl-devel tk-devel BuildRequires: db-devel BuildRequires: gdbm-devel >= 1.8.3 BuildRequires: openssl-devel BuildRequires: zlib-devel Obsoletes: ruby-rexml Provides: ruby-rexml # explicit file provides (since such requires are automatically added by find-requires) Provides: /usr/bin/ruby Provides: ruby(abi) = %subver Source0: http://ftp.ruby-lang.org/pub/ruby/%{subver}/ruby-%{rubyver}-%{patchversion}.tar.bz2 Source3: ruby.macros Patch0: ruby-lib64.patch Patch1: ruby-do-not-use-system-ruby-to-generate-ri-doc.patch Patch2: ruby-add-old-os-to-search-path.patch Patch3: ruby-do_not_propagate_no-undefined.patch URL: http://www.ruby-lang.org/ %package doc Summary: Documentation for the powerful language Ruby Group: Development/Ruby BuildArch: noarch %package devel Summary: Development file for the powerful language Ruby Group: Development/Ruby Requires: %{name} = %{version} %package tk Summary: Tk extension for the powerful language Ruby Group: Development/Ruby Requires: %{name} = %{version} %description Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, and extensible. %description doc Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, and extensible. This package contains the Ruby's documentation %description devel Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, and extensible. This package contains the Ruby's devel files. %description tk Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, and extensible. This package contains the Tk extension for Ruby. %prep %setup -q -n ruby-%{rubyver}-%{patchversion} %build CFLAGS=`echo %optflags | sed 's/-fomit-frame-pointer//'` %configure2_5x --enable-shared --disable-rpath --enable-pthread %make %install %makeinstall_std install-doc install -d %buildroot%{_docdir}/%{name}-%{version} cp -a COPYING* ChangeLog README* ToDo sample %buildroot%{_docdir}/%{name}-%{version} bzcat %{SOURCE1} > %buildroot%{_docdir}/%{name}-%{version}/FAQ.html install -d %buildroot%{_datadir}/emacs/site-lisp cp -a misc/ruby-mode.el %buildroot%{_datadir}/emacs/site-lisp install -d %buildroot%{_sysconfdir}/emacs/site-start.d cat <%buildroot%{_sysconfdir}/emacs/site-start.d/%{name}.el (autoload 'ruby-mode "ruby-mode" "Ruby editing mode." t) (add-to-list 'auto-mode-alist '("\\\\.rb$" . ruby-mode)) (add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode)) EOF (cd %buildroot%{_docdir}/%{name}-%{version} ; tar xfj %{SOURCE2} ; cd Pro*; mv -f html/* . ; rm -rf html xml) # Make the file/dirs list, filtering out tcl/tk and devel files ( cd %buildroot \ && find usr/lib/ruby/%{subver} \ \( -not -type d -printf "/%%p\n" \) \ -or \( -type d -printf "%%%%dir /%%p\n" \) \ ) | egrep -v '/(tcl)?tk|(%{my_target_cpu}-%{_target_os}%{abi}/.*[ha]$)' > %{name}.list # Fix scripts permissions and location find %buildroot sample -type f | file -i -f - | grep text | cut -d: -f1 >text.list cat text.list | xargs chmod 0644 # Magic grepping to get only files with '#!' in the first line cat text.list | xargs grep -n '^#!' | grep ':1:#!' | cut -d: -f1 >shebang.list cat shebang.list | xargs sed -i -e 's|/usr/local/bin|/usr/bin|; s|\./ruby|/usr/bin/ruby|' cat shebang.list | xargs chmod 0755 # Install the rpm macros mkdir -p %buildroot%{_sysconfdir}/rpm/macros.d cp %{SOURCE3} %buildroot%{_sysconfdir}/rpm/macros.d %check make test %clean rm -rf %buildroot %files -f %{name}.list %defattr(-, root, root) %dir %{_docdir}/%{name}-%{version} %{_docdir}/%{name}-%{version}/README %{_bindir}/* %dir %{_prefix}/lib/%{name}/ %{_libdir}/libruby.so.* %{_prefix}/lib/%{name}/site_ruby %{_mandir}/*/* %{_datadir}/emacs/site-lisp/* %config(noreplace) %{_sysconfdir}/emacs/site-start.d/* %{_sysconfdir}/rpm/macros.d/%{name}.macros %files doc %defattr(-, root, root) %{_datadir}/ri %dir %{_docdir}/%{name}-%{version} %{_docdir}/%{name}-%{version}/COPYING* %{_docdir}/%{name}-%{version}/ChangeLog %{_docdir}/%{name}-%{version}/README.* %{_docdir}/%{name}-%{version}/FAQ.html %{_docdir}/%{name}-%{version}/ToDo %{_docdir}/%{name}-%{version}/sample %{_docdir}/%{name}-%{version}/ProgrammingRuby* %files devel %defattr(-, root, root) %{_prefix}/lib/%{name}/%{subver}/%{my_target_cpu}-%{_target_os}%{abi}/*.[ah] %{_libdir}/libruby-static.a %{_libdir}/libruby.so %files tk %defattr(-, root, root) %{_prefix}/lib/%{name}/%{subver}/%{my_target_cpu}-%{_target_os}%{abi}/tcltk* %{_prefix}/lib/%{name}/%{subver}/%{my_target_cpu}-%{_target_os}%{abi}/tk* %{_prefix}/lib/%{name}/%{subver}/tcltk* %{_prefix}/lib/%{name}/%{subver}/tk* %{_prefix}/lib/%{name}/%{subver}/test/unit/ui/tk