Sync from SUSE:SLFO:Main ruby3.2 revision 3d3661f46aefc23a84676c631ace786f

This commit is contained in:
Adrian Schröter 2024-05-04 00:11:35 +02:00
commit 5af25b7148
13 changed files with 966 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<flavor>testsuite</flavor>
</multibuild>

9
_service Normal file
View File

@ -0,0 +1,9 @@
<services>
<service name="cargo_vendor" mode="disabled">
<param name="srcdir">ruby-3.2.1/yjit</param>
<param name="update">false</param>
</service>
<service name="cargo_audit" mode="disabled">
<param name="srcdir">ruby-3.2.1/yjit</param>
</service>
</services>

5
cargo_config Normal file
View File

@ -0,0 +1,5 @@
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"

BIN
ruby-3.2.2.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

7
ruby3.2-default.macros Normal file
View File

@ -0,0 +1,7 @@
%rb_default_ruby_suffix ruby3.2
%rb_default_ruby ruby32
%rb_default_ruby_abi ruby:3.2.0
%rb_build_versions %rb_default_ruby
%rb_build_ruby_abis %rb_default_ruby_abi

8
ruby3.2-rpmlintrc Normal file
View File

@ -0,0 +1,8 @@
addFilter("files-duplicate /usr/share/ri/.*")
addFilter("unexpanded-macro /usr/share/ri/.*")
addFilter("ruby3.2.*devel-file-in-non-devel-package.*/usr/lib.*/ruby/gems/3.2.0/gems/")
addFilter("ruby3.2-devel-extra.*devel-file-in-non-devel-package.*/usr/include/ruby-3.2.0.*/")
addFilter("ruby3.2.*devel-file-in-non-devel-package.*/usr/lib.*/ruby/gems/.*")
addFilter("ruby3.2.*env-script-interpreter.*/usr/lib.*/ruby/gems/.*")
addFilter("ruby3.2.*non-executable-script.*/usr/lib.*/ruby/gems/.*")
addFilter("ruby3.2.*non-executable-script.*/usr/lib.*/ruby/.*/bundler/.*")

368
ruby3.2.changes Normal file
View File

@ -0,0 +1,368 @@
-------------------------------------------------------------------
Tue Nov 7 10:01:55 UTC 2023 - Dominique Leuenberger <dimstar@opensuse.org>
- Fix build with RPM 4.19: unnumbered patches are no longer
supported.
-------------------------------------------------------------------
Thu Mar 30 14:23:04 UTC 2023 - Marcus Rueckert <mrueckert@suse.de>
- update to 3.2.2 (boo#1209891 CVE-2023-28755 boo#1209967 CVE-2023-28756)
https://www.ruby-lang.org/en/news/2023/03/30/redos-in-time-cve-2023-28756/
https://www.ruby-lang.org/en/news/2023/03/28/redos-in-uri-cve-2023-28755/
https://www.ruby-lang.org/en/news/2023/03/30/ruby-3-2-2-released/
- drop ruby-3.1.3-remove-timezone-test.patch
solved differently upstream
-------------------------------------------------------------------
Wed Feb 8 13:05:41 UTC 2023 - Marcus Rueckert <mrueckert@suse.de>
- Update to 3.2.1
https://www.ruby-lang.org/en/news/2023/02/08/ruby-3-2-1-released/
-------------------------------------------------------------------
Mon Jan 9 16:27:29 UTC 2023 - Marcus Rueckert <mrueckert@suse.de>
- Fix Source url (3.1 vs 3.2)
-------------------------------------------------------------------
Tue Dec 27 13:39:48 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- Set the correct ABI version
-------------------------------------------------------------------
Sun Dec 25 09:19:30 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- Update to 3.2.0
https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/
- Drop ruby-3.1.3-remove-timezone-test.patch:
Fix included in update
- Refreshed use-pie.patch
-------------------------------------------------------------------
Thu Dec 22 10:20:24 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- Added ruby-3.1.3-remove-timezone-test.patch:
Disable tests that rely on singapore's old TZ data
-------------------------------------------------------------------
Tue Dec 6 13:19:33 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- disable yjit
-------------------------------------------------------------------
Tue Dec 6 12:44:02 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- disable readline/reline tests as they require system ruby
-------------------------------------------------------------------
Tue Dec 6 12:43:30 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- rust edition 2021 is supported since 1.56.0. Change buildrequires
accordingly
-------------------------------------------------------------------
Tue Dec 6 10:48:43 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- Update to 3.2.0~rc1
https://www.ruby-lang.org/en/news/2022/12/06/ruby-3-2-0-rc1-released/
-------------------------------------------------------------------
Mon Dec 5 09:12:11 UTC 2022 - Andreas Schwab <schwab@suse.de>
- Update rb_arch_short macro
-------------------------------------------------------------------
Fri Dec 2 13:48:19 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- Use the correct ABI version in the macros
-------------------------------------------------------------------
Thu Nov 24 16:05:11 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- remove the bundled gems workaround
-------------------------------------------------------------------
Thu Nov 17 12:02:15 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- bump ruby-common dependency to the version with the ruby 3.2
fixes
-------------------------------------------------------------------
Thu Nov 17 10:27:43 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- bump version in the macro files to 3.2
-------------------------------------------------------------------
Fri Nov 11 18:34:56 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- limit yjit to x86_64 and aarch64 as those are the only to
platforms it supports
-------------------------------------------------------------------
Fri Nov 11 17:13:14 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- enable yjit so we can test it before the final release and see if
we want to leave it on in the package.
-------------------------------------------------------------------
Fri Nov 11 15:57:31 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- Branch off ruby 3.2 package with preview 3
-------------------------------------------------------------------
Tue May 3 23:49:37 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- turn off jemalloc again until we figure out how to do the dlopen
on libruby properly like vim and yast do
-------------------------------------------------------------------
Fri Apr 29 13:25:14 UTC 2022 - Martin Liška <mliska@suse.cz>
- Do not depend on binutils-gold as it will be removed
in the future as it's obsoleted. Use lld instead of it
for clang build.
-------------------------------------------------------------------
Wed Apr 13 13:41:18 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- use rb_soname instead of hard coding the ruby package name
-------------------------------------------------------------------
Wed Apr 13 10:09:28 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- add buildignore for ruby and ruby-common so we do not pull
gem2rpm for the testsuite
-------------------------------------------------------------------
Wed Apr 13 08:16:06 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- Update to 3.1.2 (boo#1198441 boo#1198440)
https://www.ruby-lang.org/en/news/2022/04/12/ruby-3-1-2-released/
- CVE-2022-28738: Double free in Regexp compilation
- CVE-2022-28739: Buffer overrun in String-to-Float conversion
-------------------------------------------------------------------
Tue Mar 29 17:41:48 UTC 2022 - Dirk Müller <dmueller@suse.com>
- move tests into separate testsuite _multibuild:
* reduces buildrequires on main package (procps which is behind systemd:mini)
* reduces depth of distro rebuild chain
- exclude more tests that require network
- make test failures fatal, they pass now
- light subset of spec-cleaner cleanups
- prefer %%global over %%define, they get evaluated at parse time
-------------------------------------------------------------------
Tue Mar 8 08:39:20 UTC 2022 - Dirk Müller <dmueller@suse.com>
- use valgrind for more supported platforms
- run tests in parallel for better build times
- set PATH for test to just built ruby interpreter
- skip network tests, they hang on timeouts, slowing down the build
- remove exceptions for armv7 testing, these are all fixed
-------------------------------------------------------------------
Tue Feb 22 15:32:13 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- Update to 3.1.1
https://www.ruby-lang.org/en/news/2022/02/18/ruby-3-1-1-released/
- drop 77fe1fca0abb56f7f07725c0a3803d53a315c853.patch:
included in update
-------------------------------------------------------------------
Sun Feb 6 18:40:18 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- Build ruby with jemalloc for sle 15 up
-------------------------------------------------------------------
Wed Feb 2 15:45:00 UTC 2022 - Marcus Rueckert <mrueckert@suse.de>
- Added https://github.com/ruby/ipaddr/commit/77fe1fca0abb56f7f07725c0a3803d53a315c853.patch
Fix vagrant with ruby 3.1
-------------------------------------------------------------------
Sun Dec 26 19:48:49 UTC 2021 - Marcus Rueckert <mrueckert@suse.de>
- renable LTO
- apply workaround from https://bugs.ruby-lang.org/issues/18373#note-8
-------------------------------------------------------------------
Sun Dec 26 03:28:38 UTC 2021 - Marcus Rueckert <mrueckert@suse.de>
- Update to 3.1.0
https://www.ruby-lang.org/en/news/2021/12/25/ruby-3-1-0-released/
- disable LTO for now as it makes debugging the mkmf/rbinstall
problem easier
-------------------------------------------------------------------
Tue Dec 14 10:08:35 UTC 2021 - Stephan Kulow <coolo@suse.com>
- Initial 3.1 preview - currently failing, hoping for the next preview
-------------------------------------------------------------------
Thu Nov 25 11:23:08 UTC 2021 - Marcus Rueckert <mrueckert@suse.de>
- update to 3.0.3 (boo#1193081 boo#1193080 boo#1193035)
https://www.ruby-lang.org/en/news/2021/11/24/ruby-3-0-3-released/
- CVE-2021-41817: Regular Expression Denial of Service
Vulnerability of Date Parsing Methods
- CVE-2021-41816: Buffer Overrun in CGI.escape_html
- CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse
-------------------------------------------------------------------
Wed Nov 10 17:02:48 UTC 2021 - Marcus Rueckert <mrueckert@suse.de>
- provide the correct rubygems version
-------------------------------------------------------------------
Sat Nov 6 18:59:17 UTC 2021 - Klaus Kämpf <kkaempf@suse.com>
- update to 3.0.2
https://www.ruby-lang.org/en/news/2021/07/07/ruby-3-0-2-released/
* CVE-2021-31810: Trusting FTP PASV responses vulnerability in Net::FTP
* CVE-2021-32066: A StartTLS stripping vulnerability in Net::IMAP
* CVE-2021-31799: A command injection vulnerability in RDoc
-------------------------------------------------------------------
Tue Aug 24 07:26:12 UTC 2021 - Stephan Kulow <coolo@suse.com>
- Do not create links for /etc/alternatives at all but rely on
rpm's %ghosts being creating at runtime in %post
This aligns ruby3.0 with ruby2.7 and ruby-common
-------------------------------------------------------------------
Thu Jul 8 12:46:56 UTC 2021 - Stephan Kulow <coolo@suse.com>
- Fix links in /etc/alternatives not to point to itself
-------------------------------------------------------------------
Tue Apr 13 11:30:03 UTC 2021 - Marcus Rueckert <mrueckert@suse.de>
- update to ruby 3.0.1 (boo#1184644)
https://www.ruby-lang.org/en/news/2021/04/05/ruby-3-0-1-released/
- CVE-2021-28965: XML round-trip vulnerability in REXML
Complete list of changes at
https://github.com/ruby/ruby/compare/v3_0_0...v3_0_1
- drop https://github.com/rubygems/rubygems/pull/4317.patch
included in update
-------------------------------------------------------------------
Mon Jan 25 18:09:45 UTC 2021 - Marcus Rueckert <mrueckert@suse.de>
- add https://github.com/rubygems/rubygems/pull/4317.patch
make sure the gem plugins path does not contain the buildroot
-------------------------------------------------------------------
Fri Dec 25 06:28:46 UTC 2020 - Marcus Rueckert <mrueckert@suse.de>
- update to ruby 3.0.0
https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/
-------------------------------------------------------------------
Fri Dec 25 00:18:54 UTC 2020 - Marcus Rueckert <mrueckert@suse.de>
- Update to ruby 3.0.0~rc1
https://www.ruby-lang.org/en/news/2020/12/20/ruby-3-0-0-rc1-released/
-------------------------------------------------------------------
Wed Dec 9 14:29:31 UTC 2020 - Marcus Rueckert <mrueckert@suse.de>
- Update to ruby 3.0.0~preview2
https://www.ruby-lang.org/en/news/2020/12/08/ruby-3-0-0-preview2-released/
- 3972.patch
-------------------------------------------------------------------
Tue Oct 27 11:30:47 UTC 2020 - Marcus Rueckert <mrueckert@suse.de>
- fix typo in the ruby macros file
-------------------------------------------------------------------
Tue Oct 27 11:22:03 UTC 2020 - Marcus Rueckert <mrueckert@suse.de>
- no longer luse the url for the 3972.patch, as the code in the PR
was rebased and no longer applies to the code in preview 1.
-------------------------------------------------------------------
Sun Oct 25 18:07:26 UTC 2020 - Marcus Rueckert <mrueckert@suse.de>
- fix the macros to actually use 3.0.0
-------------------------------------------------------------------
Mon Sep 28 11:34:08 UTC 2020 - Marcus Rueckert <mrueckert@suse.de>
- added https://patch-diff.githubusercontent.com/raw/rubygems/rubygems/pull/3972.patch
to fix regression in rubygems buildroot support
https://github.com/rubygems/rubygems/issues/3971
-------------------------------------------------------------------
Mon Sep 28 00:51:49 UTC 2020 - Marcus Rueckert <mrueckert@suse.de>
- Update to 3.0.0~preview1
https://www.ruby-lang.org/en/news/2020/09/25/ruby-3-0-0-preview1-released/
-------------------------------------------------------------------
Tue Apr 28 17:59:59 UTC 2020 - Marcus Rueckert <mrueckert@suse.de>
- make sure that update-alternative weight for the default
distribution is always greater than our normal weight
-------------------------------------------------------------------
Tue Apr 28 17:18:35 UTC 2020 - Marcus Rueckert <mrueckert@suse.de>
- make the update-alternative weight based on the ruby version
-------------------------------------------------------------------
Tue Apr 14 07:47:25 UTC 2020 - Bernhard Wiedemann <bwiedemann@suse.com>
- Add ruby2.7-drop-build-date.patch (boo#1047218)
-------------------------------------------------------------------
Tue Apr 7 22:53:35 UTC 2020 - Marcus Rueckert <mrueckert@suse.de>
- Update to 2.7.1 (boo#1167244 boo#1168938)
- CVE-2020-10663: Unsafe Object Creation Vulnerability in JSON
(Additional fix)
- CVE-2020-10933: Heap exposure vulnerability in the socket
library
https://github.com/ruby/ruby/compare/v2_7_0...v2_7_1
-------------------------------------------------------------------
Tue Feb 18 13:54:37 UTC 2020 - Stefan Brüns <stefan.bruens@rwth-aachen.de>
- Apply fixes/changes from ruby2.6 package lost in ruby2.7 switch:
* Fix mangling of shebangs, do not replace shell invocations with
ruby, correcly replace "/usr/bin/env ruby". (bnc#1156797)
* Cleanup spec file:
+ Drop support for obsolete distro versions
+ use license macro, remove defattr
* Use valgrind-client-headers instead of full valgrind-devel
package where available, reducing build package footprint.
* Remove unused libX11-devel BuildRequires.
-------------------------------------------------------------------
Sat Dec 28 08:03:54 UTC 2019 - Marcus Rueckert <mrueckert@suse.de>
- update to final release of 2.7.0
http://www.ruby-lang.org/en/news/2019/12/25/ruby-2-7-0-released/
- update the use-pie.patch to apply cleanly again
-------------------------------------------------------------------
Tue Jul 9 14:16:36 UTC 2019 - Marcus Rueckert <mrueckert@suse.de>
- fix running tests (boo#1140844)
just passing the DISABLED_TESTS variable is wrong. probably a
relict from calling the test scripts directly. use TESTOPTS now.
-------------------------------------------------------------------
Sun Jun 23 02:59:03 UTC 2019 - Marcus Rueckert <mrueckert@suse.de>
- add gmp to the buildrequires
-------------------------------------------------------------------
Sat Jun 22 21:07:33 UTC 2019 - Marcus Rueckert <mrueckert@suse.de>
- starting package with 2.7.0-preview1

16
ruby3.2.macros Normal file
View File

@ -0,0 +1,16 @@
#
# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
#
# if you change any macros here you have to update the copy in the
# prjconf aswell.
#
# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
#
%rubygemsruby32() rubygem(ruby:3.2.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}}
%rubygemsxruby32() %{expand:%%{rubygemsx%*}}
%rubyruby32() ruby3.2 %{expand:%%rubyx%*} %{expand:%%{ruby%*}}
%rubyxruby32() %{expand:%%{rubyx%*}}
%rubydevelruby32() ruby3.2-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}}
%rubydevelxruby32() %{expand:%%{rubydevelx%*}}

507
ruby3.2.spec Normal file
View File

@ -0,0 +1,507 @@
#
# spec file
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%ifarch x86_64 aarch64
%bcond_with yjit
%else
%bcond_with yjit
%endif
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "testsuite"
%define psuffix -testsuite
%else
%define psuffix %{nil}
%endif
####
#!!!
#!!! when updating, check versions of embedded rubygems in package stdlib below
#!!!
####
%global patch_level p0
Name: ruby3.2%{psuffix}
Version: 3.2.2
Release: 0
%global pkg_version %{version}
# make the exported API version explicit
%global api_version 3.2.0
%global rb_binary_suffix .ruby3.2
%global rb_soname ruby3.2
%global _rb_ua_weight 32
# ruby-macros and ruby-common version
%global rpm_macros_version 3
#
%define libname libruby3_2-3_2
# keep in sync with macro file!
%global rb_ver %{api_version}
%global rb_arch %(echo %{_target_cpu}-linux-gnu | sed -e "s/ppc/powerpc/")
%global rb_arch_short %(echo %{_target_cpu}-linux-gnu | sed -e "s/ppc/powerpc/ ; s/i[0-9]86/x86/")
%global rb_libdir %{_libdir}/ruby/%{rb_ver}/
%global rb_archdir %{_libdir}/ruby/%{rb_ver}/%{rb_arch}
%global rb_extdir %{_libdir}/ruby/gems/%{rb_ver}/extensions/
%global rb_extarchdir %{_libdir}/ruby/gems/%{rb_ver}/extensions/%{rb_arch_short}/
%global rb_extversionedarchdir %{_libdir}/ruby/gems/%{rb_ver}/extensions/%{rb_arch_short}/%{rb_ver}
%global rb_extdocdir %{_libdir}/ruby/gems/%{rb_ver}/doc/extensions
%global rb_extarchdocdir %{_libdir}/ruby/gems/%{rb_ver}/doc/extensions/%{rb_arch_short}
%global rb_include_dir %{_includedir}/ruby-%{api_version}
%if "%{rb_default_ruby_suffix}" == "%{rb_soname}"
%global is_default_ruby 1
%global rb_ua_weight 1%{_rb_ua_weight}
%else
%global rb_ua_weight %{_rb_ua_weight}
%endif
%define ua_binaries bundle bundler racc rake rbs rdoc ri typeprof rdbg
# keep in sync with macro file!
#
# from valgrind.spec
%ifarch %ix86 aarch64 x86_64 ppc64le s390x
%define use_valgrind 1
%endif
%bcond_without build_docs
%if 0%{?suse_version} >= 1500
%bcond_with jemalloc
%else
%bcond_with jemalloc
%endif
%bcond_with clang
%bcond_with separate_stdlib
%bcond_with system_ruby
#
URL: https://www.ruby-lang.org/
Source: https://cache.ruby-lang.org/pub/ruby/3.2/ruby-%{pkg_version}.tar.xz
Source3: %{rb_soname}.macros
Source4: %{rb_soname}-default.macros
Source5: vendor.tar.xz
Source6: cargo_config
Source98: series
Source99: %{rb_soname}-rpmlintrc
Patch0: use-pie.patch
BuildRequires: ruby-bundled-gems-rpmhelper
%if %{with clang}
BuildRequires: clang
BuildRequires: lld
BuildRequires: llvm-devel
%endif
BuildRequires: gmp-devel
%if %{with jemalloc}
BuildRequires: jemalloc-devel
%endif
BuildRequires: autoconf
BuildRequires: libffi-devel
BuildRequires: libyaml-devel
BuildRequires: ncurses-devel
BuildRequires: openssl-devel
BuildRequires: pkg-config
BuildRequires: update-alternatives
%if "%{flavor}" == "testsuite"
#!BuildIgnore: ruby
#!BuildIgnore: ruby-common
BuildRequires: %{rb_soname}
BuildRequires: netcfg
BuildRequires: procps
BuildRequires: timezone
%endif
%if %{with yjit}
BuildRequires: cargo >= 1.56.0
BuildRequires: rust >= 1.56.0
%endif
%if %{with system_ruby}
BuildRequires: ruby
%endif
BuildRequires: readline-devel
BuildRequires: zlib-devel
%if 0%{?use_valgrind}
%if 0%{?suse_version} < 1550
BuildRequires: valgrind-devel
%else
BuildRequires: valgrind-client-headers
%endif
%endif
BuildRequires: xz
Provides: ruby(abi) = %{rb_ver}
Conflicts: ruby(abi) = %{rb_ver}
Provides: ruby32 = %{version}-%{release}
%if 0%{?is_default_ruby}
Provides: ruby-default = %{version}-%{release}
Conflicts: otherproviders(ruby-default)
%endif
Requires: %{libname} = %{version}
%if %{with separate_stdlib}
Requires: %{name}-stdlib = %{version}
%else
Provides: %{name}-stdlib = %{version}-%{release}
Obsoletes: %{name}-stdlib < %{version}-%{release}
%endif
PreReq: update-alternatives
Requires: ruby-common >= 3.2
Summary: An Interpreted Object-Oriented Scripting Language
License: BSD-2-Clause OR Ruby
Group: Development/Languages/Ruby
%description
Ruby is an interpreted scripting language for object-oriented programming. It
has many features for processing text files and performing system management
tasks (as in Perl). It is extensible.
* Ruby features:
- Simple Syntax
- *Normal* Object-Oriented features (class, method calls, for
example)
- *Advanced* Object-Oriented features(Mix-in, Singleton-method, for
example)
- Operator Overloading
- Exception Handling
- Iterators and Closures
- Garbage Collection
- Dynamic Loading of Object Files (on some architectures)
%package -n %{libname}
Summary: Dynamic runtime library for Ruby
# Both ruby and ruby-stdlib now depend explicitly on libruby by version,
# however it was not always the case, so the conflicts statements below
# are needed to handle updates.
Group: System/Libraries
Conflicts: %{name} < %{version}-%{release}
Conflicts: %{name}-stdlib < %{version}-%{release}
%description -n %{libname}
Dynamic runtime library for Ruby
%package doc
Summary: Documentation and samples for Ruby
Group: Development/Languages/Ruby
%description doc
Documentation and samples for Ruby
%if %{with separate_stdlib}
%package stdlib
Summary: The Ruby standard library
Group: Development/Languages/Ruby
Provides: ruby-stdlib = %{version}-%{release}
Requires: %{libname} = %{version}
%description stdlib
The Ruby standard library
%endif
%package devel
Summary: Development files to link against Ruby
Group: Development/Languages/Ruby
Requires: %{name} = %{version}
Provides: rubygems = 3.2.22
Provides: rubygems_with_buildroot_patch
%if %{with jemalloc}
Requires: jemalloc-devel
%endif
%description devel
Development files to link against Ruby.
%package devel-extra
Summary: Special development files of ruby, normally not installed
Group: Development/Languages/Ruby
Requires: %{name}-devel = %{version}
%description devel-extra
Development files to link against Ruby.
%package doc-ri
Summary: Ruby Interactive Documentation
Group: Development/Languages/Ruby
Requires: %{name} = %{version}
BuildArch: noarch
%description doc-ri
This package contains the RI docs for ruby
%package doc-html
Summary: This package contains the HTML docs for ruby
Group: Development/Languages/Ruby
Requires: %{name} = %{version}
BuildArch: noarch
%description doc-html
This package contains the HTML docs for ruby
%package examples
Summary: Example scripts for ruby
Group: Development/Languages/Ruby
Requires: %{name} = %{version}
BuildArch: noarch
%description examples
Example scripts for ruby
%package test-suite
Summary: An Interpreted Object-Oriented Scripting Language
Group: Development/Languages/Ruby
Requires: %{name} = %{version}
BuildArch: noarch
%description test-suite
Ruby is an interpreted scripting language for object-oriented programming. It
has many features for processing text files and performing system management
tasks (as in Perl). It is extensible.
* Ruby features:
- Simple Syntax
- *Normal* Object-Oriented features (class, method calls, for
example)
- *Advanced* Object-Oriented features(Mix-in, Singleton-method, for
example)
- Operator Overloading
- Exception Handling
- Iterators and Closures
- Garbage Collection
- Dynamic Loading of Object Files (on some architectures)
%prep
%autosetup -p1 -n ruby-%{pkg_version}
pushd yjit
tar xf %{SOURCE5}
install -m 0644 -D %{SOURCE6} .cargo/config
popd
find sample -type f -perm /a=x -ls -exec chmod a-x \{\} \+
# replace "/usr/bin/env ruby" and "/usr/local/bin/ruby" with correct path
grep -Erl '^#! */.*ruby' benchmark bootstraptest ext lib sample test \
| xargs -r perl -p -i -e 's|^#!\s*\S+\s*ruby\S*(\s+.*)?$|#!/usr/bin/ruby%{rb_binary_suffix} $1|'
%build
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
%if %{with clang}
export CC="clang"
export CXX="clang++"
export LD="lld"
%endif
# iseq.c needs -fno-strict-aliasing
export CFLAGS="%{optflags} -fno-strict-aliasing -std=gnu99"
%configure \
--with-baseruby=%{_bindir}/ruby \
%if %{with yjit}
--enable-yjit \
%endif
%if %{with jemalloc}
--with-jemalloc \
%endif
--enable-pie \
%if 0%{?suse_version} >= 1550
--with-compress-debug-sections=none \
%endif
--program-suffix="%{rb_binary_suffix}" \
--with-soname=%{rb_soname} \
--target=%{_target_platform} \
%if 0%{?use_valgrind}
--with-valgrind \
%endif
%if %{without build_docs}
--disable-install-doc \
--disable-install-rdoc \
--disable-install-capi \
%endif
--with-mantype=man \
--enable-shared \
--disable-static \
--disable-rpath
make %{?_smp_mflags} all V=1 STRIP=/bin/true
%install
%if "%{flavor}" != "testsuite"
%make_install V=1 STRIP=/bin/true
perl -p -i -e 's|#!/usr/local/bin/ruby|%{_bindir}/ruby|g' $(grep -r -l /usr/local/bin/ruby %{buildroot})
echo "%defattr(-,root,root,-)" > devel-extra-excludes
echo "%defattr(-,root,root,-)" > devel-extra-list
install -D -d -m 0755 %{buildroot}%{rb_include_dir}
for i in iseq.h insns.inc insns_info.inc revision.h version.h thread_pthread.h \
ruby_atomic.h method.h internal.h id.h vm_core.h vm_opts.h node.h eval_intern.h vm_debug.h; do
install -m 644 $i %{buildroot}%{rb_include_dir}/
echo "%exclude %{rb_include_dir}/$i" >> devel-extra-excludes
echo "%{rb_include_dir}/$i" >> devel-extra-list
done
# Create gem native extensions dir
# use shell scripting here as we're executing the just installed binary
%define rb_binary %{buildroot}%{_bindir}/ruby -I %{buildroot}%{rb_libdir} -I %{buildroot}%{rb_archdir}
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
install -D -m 0644 %{SOURCE3} %{buildroot}%{_rpmmacrodir}/macros.suse-ruby3.2
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
%if 0%{?is_default_ruby}
install -D -m 0644 %{SOURCE4} %{buildroot}%{_rpmmacrodir}/macros.suse-ruby3.2-default
for bin in %{buildroot}%{_bindir}/{erb,gem,irb,ruby}%{rb_binary_suffix} ; do
# yes really hard links
ln $bin ${bin%%%{rb_binary_suffix}}
done
for man in %{buildroot}%{_mandir}/man1/*%{rb_binary_suffix}.1* ; do
# yes really hard links
# TODO: this is dangerous as we cant anc
ln $man ${man%%%{rb_binary_suffix}.1}.1
done
ln -s lib%{rb_soname}.so %{buildroot}%{_libdir}/libruby.so
%endif
for bin in %{ua_binaries}; do
# dummy
mv %{buildroot}%_bindir/${bin}%{rb_binary_suffix} %{buildroot}%_bindir/$bin.ruby%{rb_binary_suffix}
#
ln -s %{_sysconfdir}/alternatives/$bin %{buildroot}%_bindir/$bin
#
ln -s %{_sysconfdir}/alternatives/$bin%{rb_binary_suffix} %{buildroot}%_bindir/$bin%{rb_binary_suffix}
done
install -dD %{buildroot}%{rb_extdir} %{buildroot}%{rb_extarchdir} %{buildroot}%{rb_extversionedarchdir} %{buildroot}%{rb_extarchdocdir}
chmod -R go-w,go+rX %{buildroot}%{_libdir}/ruby
# keep in sync with ruby-common/gem_build_cleanup
find %{buildroot} \
\( -name \*.o -o -name Makefile -o -name config.log -o -name config.status -o -name Makefile.html -o -name gem_make.out -o -name mkmf.log -o -name \*.bak -o -name .deps -o -name .libs -o -name CVS \) \
-print0 | xargs -r0 rm -rv || :
# remove more strict in the docu
find %{buildroot}/doc \( -name Makefile.ri -o -name ext -o -name page\*.ri \) -print0 | xargs -r0 rm -rv || :
find %{buildroot} -type d -name '.gem.*' -print0 | xargs -r0 rm -rv || :
find %{buildroot} -type f -name \*.pem -delete
%post
for bin in %{ua_binaries}; do
%{_sbindir}/update-alternatives --install \
%{_bindir}/$bin $bin %{_bindir}/$bin.ruby%{rb_binary_suffix} %{rb_ua_weight}
%{_sbindir}/update-alternatives --install \
%{_bindir}/$bin%{rb_binary_suffix} $bin%{rb_binary_suffix} %{_bindir}/$bin.ruby%{rb_binary_suffix} %{rb_ua_weight}
done
%preun
if [ "$1" = 0 ] ; then
for bin in %{ua_binaries}; do
%{_sbindir}/update-alternatives --remove $bin %{_bindir}/$bin.ruby%{rb_binary_suffix}
%{_sbindir}/update-alternatives --remove $bin%{rb_binary_suffix} %{_bindir}/$bin.ruby%{rb_binary_suffix}
done
fi
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%endif
%if "%{flavor}" == "testsuite"
%check
DISABLE_TESTS=""
# Allow MD5 in OpenSSL.
# https://bugs.ruby-lang.org/issues/9154
export OPENSSL_ENABLE_MD5_VERIFY=1
export LD_LIBRARY_PATH="$PWD"
export PATH=%{buildroot}%{_bindir}:$PATH
make test test-tool test-all V=1 TESTOPTS="%{?_smp_mflags} -q --tty=no $DISABLE_TESTS" TESTS="-x test_rinda -x test_address_resolve -x test_tcp -x test_gem_installer -x test_readline -x test_reline"
%else
%files
%ghost %{_sysconfdir}/alternatives/bundle
%ghost %{_sysconfdir}/alternatives/bundle%{rb_binary_suffix}
%ghost %{_sysconfdir}/alternatives/bundler
%ghost %{_sysconfdir}/alternatives/bundler%{rb_binary_suffix}
%ghost %{_sysconfdir}/alternatives/erb*
%ghost %{_sysconfdir}/alternatives/racc
%ghost %{_sysconfdir}/alternatives/racc%{rb_binary_suffix}
%ghost %{_sysconfdir}/alternatives/rake
%ghost %{_sysconfdir}/alternatives/rake%{rb_binary_suffix}
%ghost %{_sysconfdir}/alternatives/rbs
%ghost %{_sysconfdir}/alternatives/rbs%{rb_binary_suffix}
%ghost %{_sysconfdir}/alternatives/rdbg
%ghost %{_sysconfdir}/alternatives/rdbg%{rb_binary_suffix}
%ghost %{_sysconfdir}/alternatives/rdoc
%ghost %{_sysconfdir}/alternatives/rdoc%{rb_binary_suffix}
%ghost %{_sysconfdir}/alternatives/ri
%ghost %{_sysconfdir}/alternatives/ri%{rb_binary_suffix}
%ghost %{_sysconfdir}/alternatives/typeprof
%ghost %{_sysconfdir}/alternatives/typeprof%{rb_binary_suffix}
%{_bindir}/bundle*
%{_bindir}/erb*
%{_bindir}/gem*
%{_bindir}/rdbg*
%{_bindir}/irb*
%{_bindir}/rake*
%{_bindir}/rdoc*
%{_bindir}/rbs*
%{_bindir}/ri*
%{_bindir}/ruby*
%{_bindir}/racc*
%{_bindir}/typeprof*
%{_mandir}/man1/irb*.1%{?ext_man}
%{_mandir}/man1/erb*.1%{?ext_man}
#{_mandir}/man1/rake*.1*
%{_mandir}/man1/ri*.1%{?ext_man}
%{_mandir}/man1/ruby*.1%{?ext_man}
%doc ChangeLog KNOWNBUGS.rb NEWS.md README.EXT README.EXT.ja README.ja.md README.md CONTRIBUTING.md
%license COPYING COPYING.ja GPL LEGAL BSDL
%{_rpmmacrodir}/macros.suse-ruby3.2*
%if %{with separate_stdlib}
%files stdlib
%endif
%{_libdir}/ruby/
%dir %{rb_extdir}
%dir %{rb_extarchdir}
%dir %{rb_extversionedarchdir}
%dir %{rb_extdocdir}
%dir %{rb_extarchdocdir}
%files -n %{libname}
%{_libdir}/libruby*.so.*
%files devel -f devel-extra-excludes
%{rb_include_dir}/
%{_libdir}/libruby*.so
%{_libdir}/pkgconfig/ruby-3.2.pc
%files devel-extra -f devel-extra-list
%if %{with build_docs}
%files doc
%doc doc/* sample/
%files doc-ri
%dir %{_datadir}/ri/
%{_datadir}/ri/%{rb_ver}/
%endif
%endif
%changelog

1
series Normal file
View File

@ -0,0 +1 @@
use-pie.patch

13
use-pie.patch Normal file
View File

@ -0,0 +1,13 @@
Index: ruby-3.2.0/template/Makefile.in
===================================================================
--- ruby-3.2.0.orig/template/Makefile.in
+++ ruby-3.2.0/template/Makefile.in
@@ -302,7 +302,7 @@ miniruby$(EXEEXT):
$(PROGRAM):
@$(RM) $@
$(ECHO) linking $@
- $(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
+ $(Q) $(PURIFY) $(CC) -pie $(EXE_LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
$(Q) $(POSTLINK)
$(PROGRAM): @XRUBY_LIBPATHENV_WRAPPER@

BIN
vendor.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.