2020-08-28 16:03:10 +08:00
|
|
|
%global gem_name activestorage
|
|
|
|
|
%{?_with_bootstrap: %global bootstrap 1}
|
|
|
|
|
%global bootstrap 1
|
|
|
|
|
%bcond_with ffmpeg
|
|
|
|
|
Name: rubygem-%{gem_name}
|
2021-02-08 17:57:52 +08:00
|
|
|
Version: 5.2.4.4
|
2020-08-28 16:03:10 +08:00
|
|
|
Release: 1
|
|
|
|
|
Summary: Local and cloud file storage framework
|
|
|
|
|
License: MIT
|
|
|
|
|
URL: http://rubyonrails.org
|
2021-02-08 17:57:52 +08:00
|
|
|
Source0: https://rubygems.org/gems/activestorage-5.2.4.4.gem
|
|
|
|
|
Source1: https://github.com/rails/rails/archive/v5.2.4.4.tar.gz
|
2020-08-28 16:03:10 +08:00
|
|
|
BuildRequires: ruby(release) rubygems-devel ruby
|
|
|
|
|
%if ! 0%{?bootstrap}
|
|
|
|
|
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(mini_magick) rubygem(sqlite3)
|
|
|
|
|
%{?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}
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
gem build ../%{gem_name}-%{version}.gemspec
|
|
|
|
|
%gem_install
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
mkdir -p %{buildroot}%{gem_dir}
|
|
|
|
|
cp -a .%{gem_dir}/* \
|
|
|
|
|
%{buildroot}%{gem_dir}/
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
%if ! 0%{?bootstrap}
|
|
|
|
|
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}
|
|
|
|
|
tar xzvf %{SOURCE1}
|
|
|
|
|
touch Gemfile
|
|
|
|
|
echo 'gem "actionpack"' >> ../Gemfile
|
|
|
|
|
echo 'gem "activerecord"' >> ../Gemfile
|
|
|
|
|
echo 'gem "activejob"' >> ../Gemfile
|
|
|
|
|
echo 'gem "sprockets-rails"' >> ../Gemfile
|
|
|
|
|
echo 'gem "mini_magick"' >> ../Gemfile
|
|
|
|
|
echo 'gem "rails"' >> ../Gemfile
|
|
|
|
|
echo 'gem "sqlite3"' >> ../Gemfile
|
|
|
|
|
cd rails-%{version}/%{gem_name}
|
|
|
|
|
%if ! 0%{?with_ffmpeg}
|
|
|
|
|
mv test/analyzer/video_analyzer_test.rb{,.disable}
|
|
|
|
|
for f in \
|
|
|
|
|
models/preview \
|
|
|
|
|
models/representation \
|
|
|
|
|
previewer/video_previewer
|
|
|
|
|
do
|
|
|
|
|
sed -i '/^ test ".* an MP4 video" do$/,/^ end$/ s/^/#/g' \
|
|
|
|
|
test/${f}_test.rb
|
|
|
|
|
done
|
|
|
|
|
sed -i '/^ test "analyze newly-attached blobs" do$/,/^ end$/ s/^/#/g' \
|
|
|
|
|
test/models/attachments_test.rb
|
|
|
|
|
%endif
|
|
|
|
|
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
|
2021-02-08 17:57:52 +08:00
|
|
|
* 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
|