#1 Update to Active Storage 5.2.0.
Merged 6 years ago by pvalena. Opened 6 years ago by pvalena.
rpms/ pvalena/rubygem-activestorage rebase  into  master

file modified
+3 -1
@@ -1,1 +1,3 @@ 

- /activestorage-0.1.gem

+ /activestorage-*.gem

+ /activestorage-*-app.tgz

+ /activestorage-*-tests.tgz

file modified
+86 -38
@@ -1,28 +1,51 @@ 

  # Generated from activestorage-0.1.gem by gem2rpm -*- rpm-spec -*-

  %global gem_name activestorage

  

+ # Circular dependency with rubygem-railties.

+ %{?_with_bootstrap: %global bootstrap 1}

+ %global bootstrap 1

+ 

+ # FFmpeg can be used in tests, but is not available in Fedora

+ %bcond_with ffmpeg

+ 

  Name: rubygem-%{gem_name}

- Version: 0.1

- Release: 2%{?dist}

- Summary: Attach cloud and local files in Rails applications

+ Version: 5.2.0

+ Release: 1%{?dist}

+ Summary: Local and cloud file storage framework

  License: MIT

- # TODO: This was merged into rails, please change the URL witn next version.

- URL: https://github.com/rails/activestorage

+ URL: http://rubyonrails.org

  Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem

+ # git clone https://github.com/rails/rails.git && cd rails/activestorage

+ # git checkout v5.2.0 && tar czvf activestorage-5.2.0-tests.tgz test/

+ Source1: %{gem_name}-%{version}-tests.tgz

  BuildRequires: ruby(release)

  BuildRequires: rubygems-devel

- BuildRequires: ruby >= 2.3.0

- BuildRequires: rubygem(actionpack)

- BuildRequires: rubygem(activejob)

- BuildRequires: rubygem(activerecord)

- BuildRequires: rubygem(activesupport)

+ BuildRequires: ruby

+ %if ! 0%{?bootstrap}

+ BuildRequires: rubygem(actionpack) = %{version}

+ BuildRequires: rubygem(activerecord) = %{version}

+ BuildRequires: rubygem(activejob) = %{version}

+ BuildRequires: rubygem(railties) = %{version}

+ BuildRequires: rubygem(rails) = %{version}

+ BuildRequires: rubygem(sprockets-rails)

+ BuildRequires: rubygem(connection_pool)

+ BuildRequires: rubygem(mini_magick)

  BuildRequires: rubygem(sqlite3)

+ # FFmpeg is not available in Fedora

+ %{?with_ffmpeg:BuildRequires: %{_bindir}/ffmpeg}

+ BuildRequires: %{_bindir}/mutool

+ BuildRequires: %{_bindir}/pdftoppm

+ %endif

+ # Used for creating file previews

+ 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}
@@ -32,14 +55,10 @@ 

  Documentation for %{name}.

  

  %prep

- %setup -q -n  %{gem_name}-%{version}

+ %setup -q -n %{gem_name}-%{version}

  

  %build

- # Create the gem as gem install only works on a gem file

  gem build ../%{gem_name}-%{version}.gemspec

- 

- # %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir

- # by default, so that we can move it into the buildroot in %%install

  %gem_install

  

  %install
@@ -47,43 +66,72 @@ 

  cp -a .%{gem_dir}/* \

          %{buildroot}%{gem_dir}/

  

- 

- 

  %check

- pushd .%{gem_instdir}

- # Get rid of Bundler.

- sed -i '/require "bundler/ s/^/#/' test/test_helper.rb

- 

- # ByeBug is just debuging tool.

- sed -i '/require "byebug"/ s/^/#/' test/test_helper.rb

- 

- # Make the tests pass without service configuration. This appears to be fixed

- # upstream.

- # https://github.com/rails/rails/commit/255b1a149c8be93ede25404c53933bde3acc2dc2

- sed -i '/puts/a\  {}' test/service/shared_service_tests.rb

- 

- ruby -Ilib:test -e "Dir.glob('./test/**/*_test.rb').sort.each {|t| require t}"

+ %if ! 0%{?bootstrap}

+ # fake RAILS_FRAMEWORK_ROOT

+ 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

+ 

+ # Disable tests that require FFmpeg

+ %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}

- %exclude %{gem_instdir}/.gitignore

  %license %{gem_instdir}/MIT-LICENSE

- %exclude %{gem_instdir}/activestorage.gemspec

+ %{gem_instdir}/app

+ %{gem_instdir}/config

+ %{gem_instdir}/db

  %{gem_libdir}

  %exclude %{gem_cache}

  %{gem_spec}

  

  %files doc

  %doc %{gem_docdir}

- %{gem_instdir}/Gemfile

- %{gem_instdir}/Gemfile.lock

+ %doc %{gem_instdir}/CHANGELOG.md

  %doc %{gem_instdir}/README.md

- %{gem_instdir}/Rakefile

- %{gem_instdir}/test

- %exclude %{gem_instdir}/test/service/.*

  

  %changelog

+ * Wed May 02 2018 Pavel Valena <pvalena@redhat.com> - 5.2.0-1

+ - Update to Active Storage 5.2.0.

+ - Moved to Rails repository.

+ 

  * Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

  

file modified
+2 -1
@@ -1,1 +1,2 @@ 

- SHA512 (activestorage-0.1.gem) = c688267d6d51efa87c56bd592427aa1fa09ba37920187f37802c2bdb72210551e914070862943f5ac49c3bdfa201b84acc1dc5f0909a7752dbfa8a4131d31afe

+ SHA512 (activestorage-5.2.0.gem) = 44f28832b8e945c2bbf27d0e8073d93a4ae5ca56915cd6dac670fa02e400b00c04bfa1563449a40958b25e4d4d66935f10f85699961d63b9532b8192781a95fc

+ SHA512 (activestorage-5.2.0-tests.tgz) = cf2326f4ea0821cb4abedecccff25683c54239187a84f6c8c248d24f2c02e986d561c03074a7e39444fbd734fb805c1c19745410850971dbfeaae5712a6957f3

Gem was moved to Rails repository.
Also enhance .spec and .gitignore file.

Built with tests enabled in my Copr.

rebased onto ba81f47

6 years ago

This could be covered by something like "without_ffmpeg" option ...

ruby-packagers-sig is added. Feel free to merge ...

ah, mini_magick is not available in Feodra yet, you could say that explicitly ...

Yes, actually there's blender that does provide the executable, though it's not possible to require it via %{_bindir}ffmpeg. So I could probably even test it locally with ffmpeg enabled.

Thanks for the review.
I will add the with switch too.

ah, mini_magick is not available in Feodra yet, you could say that explicitly ...

Sorry, I didn't realize that at the time.

rebased onto 9a3836a

6 years ago

I've chosen with_ffmpeg.
I've also added Suggests:

Scratch-build (tests disabled):
https://koji.fedoraproject.org/koji/taskinfo?taskID=27475966

Copr build:
https://copr.fedorainfracloud.org/coprs/build/764311/

Changes:

diff --git a/rubygem-activestorage.spec b/rubygem-activestorage.spec
index f1ab0d0..3d82c1e 100644
--- a/rubygem-activestorage.spec
+++ b/rubygem-activestorage.spec
@@ -5,6 +5,9 @@
 %{?_with_bootstrap: %global bootstrap 1}
 %global bootstrap 1

+# FFmpeg can be used in tests, but is not available in Fedora
+%bcond_with ffmpeg
+
 Name: rubygem-%{gem_name}
 Version: 5.2.0
 Release: 1%{?dist}
@@ -28,11 +31,16 @@ BuildRequires: rubygem(sprockets-rails)
 BuildRequires: rubygem(connection_pool)
 BuildRequires: rubygem(mini_magick)
 BuildRequires: rubygem(sqlite3)
-# FFmpeg is not in Fedora
-#BuildRequires: %%{_bindir}/ffmpeg
+# FFmpeg is not available in Fedora
+%{?with_ffmpeg:BuildRequires: %{_bindir}/ffmpeg}
 BuildRequires: %{_bindir}/mutool
 BuildRequires: %{_bindir}/pdftoppm
 %endif
+# Used for creating file previews
+Suggests: %{_bindir}/mutool
+Suggests: %{_bindir}/pdftoppm
+Suggests: %{_bindir}/ffmpeg
+
 BuildArch: noarch

 %description
@@ -82,6 +90,7 @@ echo 'gem "rails"' >> ../Gemfile
 echo 'gem "sqlite3"' >> ../Gemfile

 # Disable tests that require FFmpeg
+%if ! 0%{?with_ffmpeg}
 mv test/analyzer/video_analyzer_test.rb{,.disable}
 for f in \
   models/preview \
@@ -93,6 +102,7 @@ sed -i '/^  test ".* an MP4 video" do$/,/^  end$/ s/^/#/g' \
 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"

rebased onto 2f36adc

6 years ago

Pull-Request has been merged by pvalena

6 years ago