# TODO:
-# - provide standalone ruby-tk package (to replace retired -tk subpackage)
# - include ext/ in docs
# - replace ri with fastri
# - patch ri to search multiple indexes (one per package), so RPMs can install ri docs
%bcond_with bootstrap # build bootstrap version
%bcond_with tests # build without tests
-%define rel 5
+%define rel 2
%define ruby_version 2.4
-%define patchlevel 4
+%define patchlevel 6
%define pkg_version %{ruby_version}.%{patchlevel}
%define ruby_suffix %{!?with_default_ruby:%{ruby_version}}
%define doc_version 2_4_3
Group: Development/Languages
# https://www.ruby-lang.org/en/downloads/
Source0: https://cache.ruby-lang.org/pub/ruby/%{ruby_version}/%{oname}-%{pkg_version}.tar.xz
-# Source0-md5: 4f30cefb7d50c6fa4d801f47ed9d82ca
+# Source0-md5: e906495b65f9f31de4ceb0d4bbbea8b1
Source2: http://www.ruby-doc.org/downloads/%{oname}_%{doc_version}_stdlib_rdocs.tgz
# Source2-md5: d21fb29009644bd174dbba0dad53f1f5
Source3: http://www.ruby-doc.org/downloads/%{oname}_%{doc_version}_core_rdocs.tgz
# Source53-md5: fea30f45a2f81ffa474fd984d297e2ea
Source54: http://www.unicode.org/Public/9.0.0/ucd/UnicodeData.txt
# Source54-md5: dde25b1cf9bbb4ba1140ac12e4128b0b
-Source100: ftp://ftp.ruby-lang.org/pub/ruby/1.8/%{oname}-1.8.7-p330.tar.gz
-# Source100-md5: 50a49edb787211598d08e756e733e42e
Source4: rdoc.1
Source5: testrb.1
Source6: operating_system.rb
-#Patch1: %{oname}-ffs.patch
+Patch1: rubygems.patch
Patch2: fix-bison-invocation.patch
Patch3: mkmf-verbose.patch
Patch4: strip-ccache.patch
BuildRequires: pkgconfig
BuildRequires: readline-devel >= 4.2
BuildRequires: rpm-build >= 5.4.10-49
+# which version is minimum now? 1.8.7 is not enough, fails with:
+# ./tool/generic_erb.rb:31: syntax error, unexpected ':', expecting ')'
+# ...O.popen("tput smso", "r", err: IO::NULL, &:read) rescue nil)
+BuildRequires: ruby >= 1:1.9
BuildRequires: sed >= 4.0
BuildRequires: systemtap-sdt-devel
BuildRequires: tar >= 1:1.22
%if %{without bootstrap}
# bootstrap needs ruby binary, erb module
BuildRequires: rpm-rubyprov
-BuildRequires: ruby
BuildRequires: ruby-modules
%endif
Requires(post,postun): /sbin/ldconfig
%define json_ver 2.0.4
%define minitest_ver 5.10.1
%define net_telnet_ver 0.1.1
-%define openssl_ver 2.0.7
+%define openssl_ver 2.0.9
%define power_assert_ver 0.4.1
%define psych_ver 2.2.2
%define rake_ver 12.0.0
%define rdoc_ver 5.0.0
-%define rubygems_ver 2.6.14.1
+%define rubygems_ver 2.6.14.4
%define test_unit_ver 3.2.3
%define xmlrpc_ver 0.2.1
Version: %{test_unit_ver}
Release: %{pkg_version}.%{rel}
Epoch: 0
-Group: Development/Libraries
# lib/test/unit/diff.rb is a double license of the Ruby license and PSF license.
# lib/test-unit.rb is a dual license of the Ruby license and LGPLv2.1 or later.
License: (Ruby or BSD) and (Ruby or BSD or Python) and (Ruby or BSD or LGPL v2+)
+Group: Development/Libraries
+Requires: ruby-power_assert = %{power_assert_ver}-%{pkg_version}.%{rel}
%if "%{_rpmversion}" >= "5"
BuildArch: noarch
%endif
wywołującego je. Aby to osiągnąć wystarczy bardzo mało kodu.
%prep
-%setup -q -n %{oname}-%{pkg_version} -a2 -a3 %{?with_bootstrap:-a100}
-#%patch1 -p1
+%setup -q -n %{oname}-%{pkg_version} -a2 -a3
+%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
-o -name 'ruby.1' -o -name '*.html' -o -name '*.tcl' ')' \
| xargs %{__sed} -i 's,/usr/local/bin/,%{_bindir}/,'
+%if %{with bootstrap}
+# avoid regeneration, needs iostring module
+touch enc/unicode/9.0.0/*.h
+%endif
+
%build
rubygems_ver=$(awk '/VERSION =/ && $1 == "VERSION" {print $3}' lib/rubygems.rb | xargs)
if [ $rubygems_ver != %{rubygems_ver} ]; then
cp -f /usr/share/automake/config.sub .
-# build ruby-1.8.7 first
-%if %{with bootstrap}
-cd %{oname}-1.8.7-p330
-%configure
-%{__make}
-cd ..
-%endif
-
%{__autoconf}
%configure \
- %{?with_bootstrap:--with-baseruby=%{oname}-1.8.7-p330/miniruby} \
+ %{?with_bootstrap:--with-baseruby="%{_bindir}/ruby -I$(pwd)/lib"} \
--program-suffix=%{ruby_suffix} \
--with-archlibdir=%{_libdir} \
--with-rubygemsdir=%{rubygems_dir} \
--with-ruby-version='' \
%{__make} -j1 main \
- COPY="cp -p" Q= \
- %{?with_bootstrap:BASERUBY="%{oname}-1.8.7-p330/miniruby -I./ruby-1.8.7-p330/lib"}
+ COPY="cp -p" \
+ V=1
%if %{with doc}
%{__make} -j1 rdoc
ln -s %{gem_dir}/gems/minitest-%{minitest_ver}/lib/minitest $RPM_BUILD_ROOT%{ruby_libdir}
install -d $RPM_BUILD_ROOT%{ruby_libdir}/test
-ln -s %{gem_dir}/gems/test-unit-%{test_unit_ver}/lib/unit $RPM_BUILD_ROOT%{ruby_libdir}/test
+ln -s %{gem_dir}/gems/test-unit-%{test_unit_ver}/lib/test/unit $RPM_BUILD_ROOT%{ruby_libdir}/test
install -d $RPM_BUILD_ROOT%{gem_dir}/gems/psych-%{psych_ver}/lib
install -d $RPM_BUILD_ROOT%{gem_libdir}/psych-%{psych_ver}/lib