rubygem-activestorage/rubygem-activestorage.spec

143 lines
4.9 KiB
RPMSpec
Raw Normal View History

2020-08-28 16:03:10 +08:00
%global gem_name activestorage
%bcond_without bootstrap
2020-08-28 16:03:10 +08:00
%bcond_with ffmpeg
Name: rubygem-%{gem_name}
2023-08-17 15:00:42 +08:00
Version: 7.0.7
2024-02-28 11:31:51 +08:00
Release: 2
2020-08-28 16:03:10 +08:00
Summary: Local and cloud file storage framework
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 https://github.com/rails/rails.git
2023-08-17 15:00:42 +08:00
# cd rails/activestorage && git archive -v -o activestorage-7.0.7-tests.txz v7.0.7 test/
Source1: %{gem_name}-%{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-08-17 15:00:42 +08:00
# cd rails && git archive -v -o rails-7.0.7-tools.txz v7.0.7 tools/
Source2: rails-%{version}-tools.txz
2024-02-28 11:31:51 +08:00
# https://github.com/rails/rails/commit/723f54566023e91060a67b03353e7c03e7436433
Patch0: CVE-2024-26144.patch
2020-08-28 16:03:10 +08:00
BuildRequires: ruby(release) rubygems-devel ruby
%if %{without bootstrap}
2020-08-28 16:03:10 +08:00
BuildRequires: rubygem(actionpack) = %{version} rubygem(activerecord) = %{version}
BuildRequires: rubygem(activejob) = %{version} rubygem(railties) = %{version}
BuildRequires: rubygem(rails) = %{version} rubygem(sprockets-rails) rubygem(connection_pool)
BuildRequires: rubygem(image_processing) rubygem(sqlite3)
2020-08-28 16:03:10 +08:00
%{?with_ffmpeg:BuildRequires: %{_bindir}/ffmpeg}
BuildRequires: %{_bindir}/mutool %{_bindir}/pdftoppm
%endif
Suggests: %{_bindir}/mutool
Suggests: %{_bindir}/pdftoppm
Suggests: %{_bindir}/ffmpeg
BuildArch: noarch
%description
Attach cloud and local files in Rails applications.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version} -b1 -b2
2024-02-28 11:31:51 +08:00
%patch0 -p2
2020-08-28 16:03:10 +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
%if %{without bootstrap}
2020-08-28 16:03:10 +08:00
ln -s %{gem_dir}/specifications/rails-%{version}.gemspec .%{gem_dir}/gems/rails.gemspec
ln -s %{gem_dir}/gems/railties-%{version}/ .%{gem_dir}/gems/railties
ln -s %{gem_dir}/gems/activerecord-%{version}/ .%{gem_dir}/gems/activerecord
ln -s %{gem_dir}/gems/activejob-%{version}/ .%{gem_dir}/gems/activejob
ln -s %{gem_dir}/gems/actionpack-%{version}/ .%{gem_dir}/gems/actionpack
ln -s %{gem_dir}/gems/activesupport-%{version}/ .%{gem_dir}/gems/activesupport
ln -s ${PWD}%{gem_instdir} .%{gem_dir}/gems/%{gem_name}
pushd .%{gem_dir}/gems/%{gem_name}
ln -s %{_builddir}/tools ..
cp -a %{_builddir}/test .
2020-08-28 16:03:10 +08:00
touch Gemfile
echo 'gem "actionpack"' >> ../Gemfile
echo 'gem "activerecord"' >> ../Gemfile
echo 'gem "activejob"' >> ../Gemfile
echo 'gem "sprockets-rails"' >> ../Gemfile
echo 'gem "image_processing"' >> ../Gemfile
2020-08-28 16:03:10 +08:00
echo 'gem "rails"' >> ../Gemfile
echo 'gem "sqlite3"' >> ../Gemfile
%if %{without ffmpeg}
2020-08-28 16:03:10 +08:00
mv test/analyzer/video_analyzer_test.rb{,.disable}
2023-01-19 14:46:23 +08:00
mv test/analyzer/audio_analyzer_test.rb{,.disable}
mv test/previewer/video_previewer_test.rb{,.disable}
2020-08-28 16:03:10 +08:00
for f in \
models/preview \
models/representation \
%{nil}
2020-08-28 16:03:10 +08:00
do
sed -i '/^ test ".* MP4 video.*" do$/,/^ end$/ s/^/#/g' \
2020-08-28 16:03:10 +08:00
test/${f}_test.rb
done
%endif
2023-01-19 14:46:23 +08:00
# Blobs seem to be broken
# https://github.com/rails/rails/pull/40226
# https://github.com/rails/rails/issues/44395
sed -i -e '/test "optimized variation of GIF"/ a skip' \
-e '/thumbnail variation of extensionless GIF/ a skip' \
2023-01-19 14:46:23 +08:00
-e '/test "resized variation of PSD blob" do/ a skip' \
-e '/test "resized variation of BMP blob" do/ a skip' \
-e '/test "resized variation of ICO blob" do/ a skip' \
-e '/test "resized variation of GIF blob" do/ a skip' \
-e '/test "optimized variation of GIF blob" do/ a skip' \
test/models/variant_test.rb
2020-08-28 16:03:10 +08:00
export RUBYOPT="-I${PWD}/../%{gem_name}/lib"
export PATH="${PWD}/../%{gem_name}/exe:$PATH"
export BUNDLE_GEMFILE=${PWD}/../Gemfile
ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
popd
%endif
%files
%dir %{gem_instdir}
%license %{gem_instdir}/MIT-LICENSE
%{gem_instdir}/app
%{gem_instdir}/config
%{gem_instdir}/db
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGELOG.md
%doc %{gem_instdir}/README.md
%changelog
2024-02-28 11:31:51 +08:00
* Wed Feb 28 2024 yaoxin <yao_xin001@hoperun.com> - 7.0.7-2
- Fix CVE-2024-26144
2023-08-17 15:00:42 +08:00
* Thu Aug 17 2023 Ge Wang <wang__ge@126.com> - 7.0.7-1
- Upgrade to version 7.0.7
2023-01-19 14:46:23 +08:00
* Thu Jan 19 2023 wangkai <wangkai385@h-partners.com> - 7.0.4-1
- Upgrade to version 7.0.4
* Wed Mar 02 2022 jiangxinyu <jiangxinyu@kylinos.cn> - 6.1.4.1-1
- update to 6.1.4.1
* Mon Feb 8 2021 sunguoshuai<sunguoshuai@huawei.com>- 5.2.4.4-1
- Upgrade to 5.2.4.4
2020-08-28 16:03:10 +08:00
* Wed Aug 12 2020 chengzihan <chengzihan2@huawei.com> - 5.2.3-1
- Package init