rubygem-activerecord/rubygem-activerecord.spec

127 lines
4.1 KiB
RPMSpec
Raw Normal View History

2020-08-28 16:00:02 +08:00
%global gem_name activerecord
Name: rubygem-%{gem_name}
Epoch: 1
2023-01-19 15:04:26 +08:00
Version: 7.0.4
Release: 2
2020-08-28 16:00:02 +08:00
Summary: Object-relational mapper framework (part of Rails)
License: MIT
URL: http://rubyonrails.org
2022-03-29 15:23:39 +08:00
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
2023-01-19 15:04:26 +08:00
# cd rails/activerecord && git archive -v -o activerecord-7.0.4-tests.txz v7.0.4 test/
2022-03-29 15:23:39 +08:00
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
2023-01-19 15:04:26 +08:00
# cd rails && git archive -v -o rails-7.0.4-tools.txz v7.0.4 tools/
2022-03-29 15:23:39 +08:00
Source2: rails-%{version}-tools.txz
2023-01-19 15:04:26 +08:00
# Fixes for Minitest 5.16+
# https://github.com/rails/rails/pull/43807
Patch0: rubygem-activerecord-7.0.2.3-Fix-assert_called_with-with-empty-args-array.patch
# https://github.com/rails/rails/pull/45380
Patch1: rubygem-activerecord-7.0.2.3-Remove-the-multi-call-form-of-assert_called_with.patch
# https://github.com/rails/rails/pull/45370
Patch2: rubygem-activerecord-7.0.2.3-Fix-tests-for-minitest-5.16.patch
Patch3: CVE-2022-44566.patch
Patch4: CVE-2023-22794.patch
2020-08-28 16:00:02 +08:00
Suggests: %{_bindir}/sqlite3
BuildRequires: rubygems-devel rubygem(bcrypt) rubygem(activesupport) = %{version}
BuildRequires: rubygem(activemodel) = %{version} rubygem(builder) rubygem(sqlite3)
2022-03-29 15:23:39 +08:00
BuildRequires: rubygem(actionpack) = %{version} rubygem(pg) rubygem(mocha) rubygem(rack)
2023-01-19 15:04:26 +08:00
BuildRequires: rubygem(zeitwerk) rubygem(benchmark-ips) rubygem(did_you_mean)
2020-08-28 16:00:02 +08:00
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
2022-03-29 15:23:39 +08:00
%setup -q -n %{gem_name}-%{version} -b1 -b2
2020-08-28 16:00:02 +08:00
2023-01-19 15:04:26 +08:00
%patch0 -p2
pushd %{_builddir}
%patch1 -p2
%patch2 -p2
%patch3 -p1
%patch4 -p1
2023-01-19 15:04:26 +08:00
popd
2020-08-28 16:00:02 +08:00
%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}
2022-03-29 15:23:39 +08:00
ln -s %{_builddir}/tools ..
mv %{_builddir}/test .
sed -i '/require .byebug./ s/^/#/g' test/cases/base_prevent_writes_test.rb
2023-01-19 15:04:26 +08:00
sed -i '/assert_slower_by_at_most/ s/1\.4/2.5/' \
test/cases/encryption/performance/envelope_encryption_performance_test.rb
# Test adapters separately
mv -v test/cases/adapters/ %{_builddir}/.
# Run without adapters
ruby -Itest:lib -e '
Dir.glob("./test/cases/**/*_test.rb")
.sort
.reject { |f| f =~ %r|/encryption/performance/| }
.each { |f| require f }'
# Return the adapters to test them
mv -v %{_builddir}/adapters/ test/cases/.
# Run tests for adapters only, but without postgresql
ruby -Itest:lib -e '
Dir.glob("./test/cases/adapters/**/*_test.rb")
.sort
.reject {|x| x =~ %r|/postgresql/| }
.each { |f| require f }'
2020-08-28 16:00:02 +08:00
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:7.0.4-2
- fix CVE-2022-44566 CVE-2023-22794
2023-01-19 15:04:26 +08:00
* Thu Jan 19 2023 yanxiaobing <yanxiaobing@huawei.com> - 1:7.0.4-1
- Upgrade to version 7.0.4
2022-06-17 06:27:58 +00:00
* Tue Mar 29 2022 liyanan <liyanan32@huawei.com> - 6.1.4.1-1
2022-03-29 15:23:39 +08:00
- update to 6.1.4.1
2021-03-15 11:44:32 +08:00
* 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
2020-08-28 16:00:02 +08:00
* Wed Aug 12 2020 chengzihan <chengzihan2@huawei.com> - 5.2.3-1
- Package init