rubygem-activerecord/rubygem-activerecord.spec
wszlight 87c00726ad fix CVE-2022-44566
fix CVE-2022-44566 CVE-2023-22794

(cherry picked from commit ead83c6d23c77103756b10a0ec6501a8a5601c52)
2023-02-23 17:19:28 +08:00

102 lines
3.3 KiB
RPMSpec

%global gem_name activerecord
Name: rubygem-%{gem_name}
Epoch: 1
Version: 6.1.4.1
Release: 2
Summary: Object-relational mapper framework (part of Rails)
License: MIT
URL: http://rubyonrails.org
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# The gem doesn't ship with the test suite.
# You may check it out like so
# git clone http://github.com/rails/rails.git
# cd rails/activerecord && git archive -v -o activerecord-6.1.4.1-tests.txz v6.1.4.1 test/
Source1: activerecord-%{version}-tests.txz
# The tools are needed for the test suite, are however unpackaged in gem file.
# You may check it out like so
# git clone http://github.com/rails/rails.git --no-checkout
# cd rails && git archive -v -o rails-6.1.4.1-tools.txz v6.1.4.1 tools/
Source2: rails-%{version}-tools.txz
Patch0: CVE-2022-44566-pre0.patch
Patch1: CVE-2022-44566-pre1.patch
Patch2: CVE-2022-44566.patch
Patch3: CVE-2023-22794.patch
Suggests: %{_bindir}/sqlite3
BuildRequires: rubygems-devel rubygem(bcrypt) rubygem(activesupport) = %{version}
BuildRequires: rubygem(activemodel) = %{version} rubygem(builder) rubygem(sqlite3)
BuildRequires: rubygem(actionpack) = %{version} rubygem(pg) rubygem(mocha) rubygem(rack)
BuildArch: noarch
%description
Implements the ActiveRecord pattern (Fowler, PoEAA) for ORM. It ties database
tables and classes together for business objects, like Customer or
Subscription, that can find, save, and destroy themselves without resorting to
manual SQL.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version} -b1 -b2
pushd %{_builddir}/
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
popd
%build
gem build ../%{gem_name}-%{version}.gemspec
%gem_install
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
%check
pushd .%{gem_instdir}
ln -s %{_builddir}/tools ..
mv %{_builddir}/test .
sed -i '/^\s*def test_generates_absolute_path_with_given_root$/ a skip' \
test/cases/tasks/sqlite_rake_test.rb
sed -i '/require .byebug./ s/^/#/g' test/cases/base_prevent_writes_test.rb
mv test/cases/adapters/sqlite3/explain_test.rb{,.disable}
ruby -rpg -Itest:lib -e 'Dir.glob("./test/cases/**/*_test.rb").sort.each{ |f| require f }'
popd
%files
%dir %{gem_instdir}
%license %{gem_instdir}/MIT-LICENSE
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGELOG.md
%doc %{gem_instdir}/README.rdoc
%{gem_instdir}/examples
%changelog
* Wed Feb 22 2023 wushaozheng <wushaozheng@ncti-gba.cn> - 1:6.1.4.1-2
- fix CVE-2022-44566
* Wed Mar 02 2022 jiangxinyu <jiangxinyu@kylinos.cn> - 6.1.4.1-1
- update to 6.1.4.1
* Fri Jan 15 2021 Ge Wang <wangge20@huawei.com> - 5.2.4.4-3
- fix check failure
* Tue Mar 16 2021 wangyue <wangyue92@huawei.com> - 5.2.4.4-2
- fix CVE-2021-22880
* Mon Feb 8 2021 sunguoshuai<sunguoshuai@huawei.com>- 5.2.4.4-1
- Upgrade to 5.2.4.4
* Wed Aug 12 2020 chengzihan <chengzihan2@huawei.com> - 5.2.3-1
- Package init