Blame SPECS/rubygem-railties.spec

239fb7
%{?scl:%scl_package rubygem-%{gem_name}}
239fb7
%{!?scl:%global pkg_name %{name}}
239fb7
239fb7
# Generated from railties-3.0.3.gem by gem2rpm -*- rpm-spec -*-
239fb7
%global gem_name railties
239fb7
239fb7
# Circular dependency with rubygem-{rails,jquery-rails,uglifier}.
239fb7
%{?_with_bootstrap: %global bootstrap 1}
239fb7
239fb7
# Fallback to rh-nodejs4 rh-nodejs4-scldevel is probably not available in
239fb7
# the buildroot.
239fb7
%{?scl:%{!?scl_nodejs:%global scl_nodejs rh-nodejs4}}
239fb7
%{?scl:%{!?scl_prefix_nodejs:%global scl_prefix_nodejs %{scl_nodejs}-}}
239fb7
239fb7
Name: %{?scl_prefix}rubygem-%{gem_name}
239fb7
Version: 5.0.1
239fb7
Release: 4%{?dist}
239fb7
Summary: Tools for creating, working with, and running Rails applications
239fb7
Group: Development/Languages
239fb7
License: MIT
239fb7
URL: http://rubyonrails.org
239fb7
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
239fb7
# Get the test suite:
239fb7
# git clone http://github.com/rails/rails.git && cd rails/railties/
239fb7
# git checkout v5.0.1 && tar czvf railties-5.0.1-tests.tgz test/
239fb7
Source1: railties-%{version}-tests.tgz
239fb7
# Run bundler with --local. This is for Red Hat only. Not for Fedora.
239fb7
# https://bugzilla.redhat.com/show_bug.cgi?id=1317078
239fb7
Patch100: rubygem-railties-default-to-bundle-install-local.patch
239fb7
Patch101: rubygem-railties-default-to-bundle-install-local-test.patch
239fb7
239fb7
# Fix: Ruby 2.4 compatibility
239fb7
# https://github.com/rails/rails/pull/27412/commits/c79c40ed82186fc5000cf5beea697b286422bcdb
239fb7
Patch1: rubygem-railties-5.0.1-limit-length-of-secret.patch
239fb7
239fb7
# Fix: Minitest 5.10 compatibility
239fb7
# https://github.com/rails/rails/pull/27739
239fb7
Patch2: rubygem-railties-5.0.1-Use-new-minitest-assert-false-message.patch
239fb7
239fb7
# Relax the Listen dependency to make the default app works out of the box.
239fb7
# https://github.com/rails/rails/pull/26695
239fb7
Patch3: railties-5.0.1-Allow-the-use-of-listen-3.1.x.patch
239fb7
239fb7
# Fix SQLite 3.16.0+ compatibility.
239fb7
# https://github.com/rails/rails/pull/27734
239fb7
Patch4: railties-5.0.1-update-CREATE-TABLE-statements-generated-by-sqlite3-command.patch
239fb7
239fb7
# dbconsole requires the executable.
239fb7
Requires: sqlite
239fb7
# Let's keep Requires and BuildRequires sorted alphabeticaly
239fb7
Requires: %{?scl_prefix_ruby}ruby(release)
239fb7
Requires: %{?scl_prefix_ruby}ruby(rubygems)
239fb7
Requires: %{?scl_prefix}rubygem(actionpack) = %{version}
239fb7
Requires: %{?scl_prefix}rubygem(activesupport) = %{version}
239fb7
Requires: %{?scl_prefix}rubygem(method_source)
239fb7
Requires: %{?scl_prefix_ruby}rubygem(rake) >= 0.8.7
239fb7
Requires: %{?scl_prefix}rubygem(thor) >= 0.18.1
239fb7
BuildRequires: %{?scl_prefix_ruby}ruby(release)
239fb7
BuildRequires: %{?scl_prefix_ruby}ruby(rubygems)
239fb7
BuildRequires: %{?scl_prefix_ruby}ruby
239fb7
BuildRequires: %{?scl_prefix_ruby}rubygems-devel
239fb7
BuildRequires: %{?scl_prefix}rubygem(actioncable) = %{version}
239fb7
BuildRequires: %{?scl_prefix}rubygem(actionmailer) = %{version}
239fb7
BuildRequires: %{?scl_prefix}rubygem(actionpack) = %{version}
239fb7
BuildRequires: %{?scl_prefix}rubygem(activerecord) = %{version}
239fb7
BuildRequires: %{?scl_prefix}rubygem(activesupport) = %{version}
239fb7
BuildRequires: %{?scl_prefix_ruby}rubygem(bundler)
239fb7
BuildRequires: %{?scl_prefix}rubygem(method_source)
239fb7
BuildRequires: %{?scl_prefix_ruby}rubygem(rake)
239fb7
BuildRequires: %{?scl_prefix}rubygem(rack-cache)
239fb7
BuildRequires: %{?scl_prefix}rubygem(sqlite3)
239fb7
BuildRequires: sqlite
239fb7
BuildRequires: %{?scl_prefix}rubygem(sprockets-rails)
239fb7
BuildRequires: %{?scl_prefix}rubygem(thor)
239fb7
%if ! 0%{?bootstrap}
239fb7
BuildRequires: %{?scl_prefix}rubygem(jquery-rails)
239fb7
BuildRequires: %{?scl_prefix}rubygem(uglifier)
239fb7
BuildRequires: %{?scl_prefix}rubygem(rails)
239fb7
BuildRequires: %{?scl_prefix}rubygem(turbolinks)
239fb7
BuildRequires: %{?scl_prefix}rubygem(turbolinks-source)
239fb7
%endif
239fb7
BuildRequires: %{?scl_prefix_nodejs}nodejs
239fb7
BuildArch: noarch
239fb7
Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version}
239fb7
239fb7
# Explicitly require runtime subpackage, as long as older scl-utils do not generate it
239fb7
%{?scl:Requires: %{?scl_prefix}runtime}
239fb7
239fb7
%description
239fb7
Rails internals: application bootup, plugins, generators, and rake tasks.
239fb7
Railties is responsible to glue all frameworks together. Overall, it:
239fb7
* handles all the bootstrapping process for a Rails application;
239fb7
* manages rails command line interface;
239fb7
* provides Rails generators core;
239fb7
239fb7
%package doc
239fb7
Summary: Documentation for %{pkg_name}
239fb7
Group: Documentation
239fb7
Requires: %{?scl_prefix}%{pkg_name} = %{version}-%{release}
239fb7
BuildArch: noarch
239fb7
239fb7
%description doc
239fb7
Documentation for %{pkg_name}.
239fb7
239fb7
%prep
239fb7
%setup -n %{pkg_name}-%{version} -q -c -T
239fb7
%{?scl:scl enable %{scl} - << \EOF}
239fb7
%gem_install -n %{SOURCE0}
239fb7
%{?scl:EOF}
239fb7
239fb7
pushd .%{gem_instdir}
239fb7
%patch3 -p2
239fb7
239fb7
%patch100 -p2 -F 0
239fb7
popd
239fb7
239fb7
%build
239fb7
239fb7
%install
239fb7
mkdir -p %{buildroot}%{gem_dir}
239fb7
cp -a .%{gem_dir}/* \
239fb7
        %{buildroot}%{gem_dir}/
239fb7
239fb7
239fb7
mkdir -p %{buildroot}%{_bindir}
239fb7
cp -p .%{_bindir}/* \
239fb7
        %{buildroot}%{_bindir}/
239fb7
239fb7
find %{buildroot}%{gem_instdir}/exe -type f | xargs chmod a+x
239fb7
239fb7
%check
239fb7
# fake RAILS_FRAMEWORK_ROOT
239fb7
ln -s %{gem_dir}/specifications/rails-%{version}.gemspec .%{gem_dir}/gems/rails.gemspec
239fb7
ln -s %{gem_dir}/gems/activesupport-%{version}/ .%{gem_dir}/gems/activesupport
239fb7
ln -s %{gem_dir}/gems/actionmailer-%{version}/ .%{gem_dir}/gems/actionmailer
239fb7
ln -s %{gem_dir}/gems/activerecord-%{version}/ .%{gem_dir}/gems/activerecord
239fb7
ln -s %{gem_dir}/gems/actionview-%{version}/ .%{gem_dir}/gems/actionview
239fb7
ln -s ${PWD}%{gem_instdir} .%{gem_dir}/gems/railties
239fb7
239fb7
pushd .%{gem_dir}/gems/railties
239fb7
239fb7
# Extract tests.
239fb7
tar xzf %{SOURCE1}
239fb7
239fb7
patch -p2 < %{PATCH1}
239fb7
patch -p2 < %{PATCH2}
239fb7
patch -p2 < %{PATCH4}
239fb7
239fb7
patch -p2 -F 0 < %{PATCH101}
239fb7
239fb7
# Expected by InfoTest#test_rails_version
239fb7
echo '%{version}' > ../RAILS_VERSION
239fb7
239fb7
touch ../Gemfile
239fb7
echo 'gem "actioncable"' >> ../Gemfile
239fb7
echo 'gem "actionmailer"' >> ../Gemfile
239fb7
echo 'gem "actionpack"' >> ../Gemfile
239fb7
echo 'gem "activerecord"' >> ../Gemfile
239fb7
echo 'gem "activesupport"' >> ../Gemfile
239fb7
echo 'gem "method_source"' >> ../Gemfile
239fb7
echo 'gem "rack-test"' >> ../Gemfile
239fb7
echo 'gem "rack-cache"' >> ../Gemfile
239fb7
echo 'gem "rake"' >> ../Gemfile
239fb7
echo 'gem "rdoc"' >> ../Gemfile
239fb7
echo 'gem "sqlite3"' >> ../Gemfile
239fb7
echo 'gem "thor"' >> ../Gemfile
239fb7
echo 'gem "sprockets-rails"' >> ../Gemfile
239fb7
%if ! 0%{?bootstrap}
239fb7
echo 'gem "jquery-rails"' >> ../Gemfile
239fb7
echo 'gem "rails"' >> ../Gemfile
239fb7
echo 'gem "turbolinks"' >> ../Gemfile
239fb7
echo 'gem "uglifier", require: false' >> ../Gemfile
239fb7
%else
239fb7
# Depends on jquer-rails and uglifier.
239fb7
mv test/application/assets_test.rb{,.disable}
239fb7
mv test/application/asset_debugging_test.rb{,.disable}
239fb7
239fb7
sed -i '/def test_scaffold_.*tests_pass_by_default$/,/^    end$/ s/^/#/' test/application/rake_test.rb
239fb7
sed -i '/def test_rake_routes_with_rake_options$/,/^    end$/ s/^/#/' test/application/rake_test.rb
239fb7
sed -i '/def test_rails_routes_displays_message_when_no_routes_are_defined$/,/^    end$/ s/^/#/' test/application/rake_test.rb
239fb7
sed -i '/def test_rails_routes_calls_the_route_inspector$/,/^    end$/ s/^/#/' test/application/rake_test.rb
239fb7
239fb7
sed -i '/def test_generated_controller_works_with_rails_test$/,/^    end$/ s/^/#/' test/application/test_runner_test.rb
239fb7
sed -i '/def test_generated_scaffold_works_with_rails_test$/,/^    end$/ s/^/#/' test/application/test_runner_test.rb
239fb7
239fb7
# Depends on rails.
239fb7
mv test/application/bin_setup_test.rb{,.disable}
239fb7
239fb7
sed -i '/def test_generation_runs_bundle_install_with_full_and_mountable$/,/^  end$/ s/^/#/' test/generators/plugin_generator_test.rb
239fb7
sed -i '/def test_generate_application_.*_when_does_not_exist_in_mountable_engine$/,/^  end$/ s/^/#/' test/generators/plugin_generator_test.rb
239fb7
239fb7
sed -i '/def test_controller_tests_pass_by_default_inside_mountable_engine$/,/^  end$/ s/^/#/' test/generators/scaffold_controller_generator_test.rb
239fb7
sed -i '/def test_controller_tests_pass_by_default_inside_full_engine$/,/^  end$/ s/^/#/' test/generators/scaffold_controller_generator_test.rb
239fb7
239fb7
sed -i '/def test_application_new_exits_with_message_and_non_zero_code_when_generating_inside_existing_rails_directory$/,/^  end$/ s/^/#/' test/generators/app_generator_test.rb
239fb7
sed -i '/def test_application_new_show_help_message_inside_existing_rails_directory$/,/^  end$/ s/^/#/' test/generators/app_generator_test.rb
239fb7
%endif
239fb7
239fb7
# Disable unstable test.
239fb7
# https://github.com/rails/rails/issues/25774
239fb7
sed -i '/^  def test_sqlite3_db_without_defined_rails_root$/,/^  end$/ s/^/#/' test/commands/dbconsole_test.rb
239fb7
239fb7
# This works only when AR is not specified in Gemfile. Not sure how to
239fb7
# workaround this.
239fb7
sed -i '/test "database middleware doesn.t initialize when activerecord is not in frameworks" do$/,/^    end$/ s/^/#/' \
239fb7
  test/application/initializers/frameworks_test.rb
239fb7
239fb7
# TODO: Mismatch in RAILS_FRAMEWORK_ROOT, not sure how to fix it.
239fb7
sed -i '/test "i18n files have lower priority than application ones" do$/,/^    end$/ s/^/#/' \
239fb7
  test/railties/engine_test.rb
239fb7
239fb7
export RUBYOPT="-I${PWD}/../railties/lib -Eutf-8"
239fb7
export PATH="${PWD}/../railties/exe:$PATH"
239fb7
239fb7
# Needed for test/generators/test_runner_in_engine_test.rb and
239fb7
# test/generators/plugin_generator_test.rb
239fb7
export BUNDLE_GEMFILE=${PWD}/../Gemfile
239fb7
239fb7
%{?scl:scl enable %{scl} %{scl_nodejs} - << \EOF}
239fb7
set -e
239fb7
# Tests needs to be executed in isolation.
239fb7
find test -type f -name '*_test.rb' -print0 | \
239fb7
  xargs -0 -n1 -i sh -c "echo '* Test file: {}'; ruby -Itest -- '{}' || exit 255"
239fb7
%{?scl:EOF}
239fb7
popd
239fb7
239fb7
%files
239fb7
# There is no %%license macro on RHEL6.
239fb7
# https://bugzilla.redhat.com/show_bug.cgi?id=1386246
239fb7
%{!?_licensedir:%global license %%doc}
239fb7
239fb7
%dir %{gem_instdir}
239fb7
%{_bindir}/rails
239fb7
%license %{gem_instdir}/MIT-LICENSE
239fb7
%{gem_instdir}/exe
239fb7
%{gem_libdir}
239fb7
%exclude %{gem_cache}
239fb7
%{gem_spec}
239fb7
239fb7
%files doc
239fb7
%doc %{gem_docdir}
239fb7
%doc %{gem_instdir}/CHANGELOG.md
239fb7
%doc %{gem_instdir}/RDOC_MAIN.rdoc
239fb7
%doc %{gem_instdir}/README.rdoc
239fb7
239fb7
%changelog
239fb7
* Wed Feb 15 2017 Jun Aruga <jaruga@redhat.com> - 5.0.1-4
239fb7
- Fix typo.
239fb7
239fb7
* Mon Jan 23 2017 Vít Ondruch <vondruch@redhat.com> - 5.0.1-3
239fb7
- Fix Listen 3.1.x compatibility.
239fb7
239fb7
* Wed Jan 18 2017 Jun Aruga <jaruga@redhat.com> - 5.0.1-2
239fb7
- Update to Railties 5.0.1.
239fb7
239fb7
* Thu Apr 07 2016 Pavel Valena <pvalena@redhat.com> - 4.2.6-3
239fb7
- Apply patch properly
239fb7
239fb7
* Thu Apr 07 2016 Pavel Valena <pvalena@redhat.com> - 4.2.6-2
239fb7
- Fix: apply patch0: run bundler with --local
239fb7
239fb7
* Mon Apr 04 2016 Pavel Valena <pvalena@redhat.com> - 4.2.6-1
239fb7
- Update to 4.2.6
239fb7
239fb7
* Wed Mar 30 2016 vagrant - 4.2.5.1-7
239fb7
- Run bundle install with --local
239fb7
  - Resolves: rhbz#1317078
239fb7
239fb7
* Mon Feb 29 2016 Pavel Valena <pvalena@redhat.com> - 4.2.5.1-6
239fb7
- Enable tests
239fb7
- Add thread_safe build dependency
239fb7
239fb7
* Mon Feb 29 2016 Pavel Valena <pvalena@redhat.com> - 4.2.5.1-5
239fb7
- Fix rubygem-thor dependency prefix
239fb7
239fb7
* Wed Feb 17 2016 Pavel Valena <pvalena@redhat.com> - 4.2.5.1-4
239fb7
- Update to 4.2.5.1
239fb7
239fb7
* Mon Jan 26 2015 Josef Stribny <jstribny@redhat.com> - 4.1.5-1
239fb7
- Update to 4.1.5
239fb7
239fb7
* Wed Jul 23 2014 Josef Stribny <jstribny@redhat.com> - 4.0.2-3
239fb7
- Patch: Run bundle install with --local when creating new app
239fb7
  - Resolves: rhbz#1115079
239fb7
239fb7
* Wed Feb 05 2014 Josef Stribny <jstribny@redhat.com> - 4.0.2-2
239fb7
- Fix license (SyntaxHighlighter is removed in 4.x.x)
239fb7
239fb7
* Wed Dec 04 2013 Josef Stribny <jstribny@redhat.com> - 4.0.2-1
239fb7
- Update to Railties 4.0.2
239fb7
  - Resolves: rhbz#1037985
239fb7
239fb7
* Thu Nov 21 2013 Josef Stribny <jstribny@redhat.com> - 4.0.1-1
239fb7
- Update to Railties 4.0.1
239fb7
239fb7
* Wed Oct 16 2013 Josef Stribny <jstribny@redhat.com> - 4.0.0-2
239fb7
- Convert to scl.
239fb7
239fb7
* Thu Aug 08 2013 Josef Stribny <jstribny@redhat.com> - 4.0.0-1
239fb7
- Update to Railties 4.0.0.
239fb7
239fb7
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.13-2
239fb7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
239fb7
239fb7
* Tue Jun 11 2013 Josef Stribny <jstribny@redhat.com> - 3.2.13-1
239fb7
- Fix license.
239fb7
239fb7
* Sat Mar 09 2013 Vít Ondruch <vondruch@redhat.com> - 3.2.12-3
239fb7
- Relax RDoc dependency.
239fb7
239fb7
* Fri Mar 08 2013 Vít Ondruch <vondruch@redhat.com> - 3.2.12-2
239fb7
- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
239fb7
239fb7
* Tue Feb 12 2013 Vít Ondruch <vondruch@redhat.com> - 3.2.12-1
239fb7
- Update to Railties 3.2.12.
239fb7
239fb7
* Wed Jan 09 2013 Vít Ondruch <vondruch@redhat.com> - 3.2.11-1
239fb7
- Update to Railties 3.2.11.
239fb7
239fb7
* Fri Jan 04 2013 Vít Ondruch <vondruch@redhat.com> - 3.2.10-1
239fb7
- Update to Railties 3.2.10.
239fb7
239fb7
* Mon Aug 13 2012 Vít Ondruch <vondruch@redhat.com> - 3.2.8-1
239fb7
- Update to Railties 3.2.8.
239fb7
239fb7
* Mon Jul 30 2012 Vít Ondruch <vondruch@redhat.com> - 3.2.7-1
239fb7
- Update to Railties 3.2.7.
239fb7
239fb7
* Mon Jul 23 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 3.2.6-1
239fb7
- Update to Railties 3.2.6.
239fb7
- Move some files into -doc subpackage.
239fb7
- Remove the unneeded %%defattr.
239fb7
- Introduce %%check section (not running tests yet, as they are part of dependency loop).
239fb7
239fb7
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.15-2
239fb7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
239fb7
239fb7
* Fri Jun 15 2012 Vít Ondruch <vondruch@redhat.com> - 3.0.15-1
239fb7
- Update to Railties 3.0.15.
239fb7
239fb7
* Fri Jun 01 2012 Vít Ondruch <vondruch@redhat.com> - 3.0.13-1
239fb7
- Update to Railties 3.0.13.
239fb7
239fb7
* Wed Feb 01 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 3.0.11-1
239fb7
- Rebuilt for Ruby 1.9.3.
239fb7
- Update to Railties 3.0.11.
239fb7
239fb7
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.10-2
239fb7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
239fb7
239fb7
* Mon Aug 22 2011 Vít Ondruch <vondruch@redhat.com> - 3.0.10-1
239fb7
- Update to Railties 3.0.10
239fb7
239fb7
* Thu Jul 21 2011 Vít Ondruch <vondruch@redhat.com> - 3.0.9-2
239fb7
- Added missing RDoc dependency.
239fb7
239fb7
* Thu Jul 07 2011 Vít Ondruch <vondruch@redhat.com> - 3.0.9-1
239fb7
- Update to Railties 3.0.9
239fb7
239fb7
* Mon Jun 27 2011  <mmorsi@redhat.com> - 3.0.5-2
239fb7
- include fix for BZ #715385
239fb7
239fb7
* Tue Mar 29 2011 Vít Ondruch <vondruch@redhat.com> - 3.0.5-1
239fb7
- Updated to Railties 3.0.5
239fb7
239fb7
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.3-8
239fb7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
239fb7
239fb7
* Wed Feb 02 2011  <Minnikhanov@gmail.com> - 3.0.3-7
239fb7
- Fix Comment 11 #665560. https://bugzilla.redhat.com/show_bug.cgi?id=668090#c11
239fb7
- Take LICENSE file from upstream.
239fb7
239fb7
* Mon Jan 31 2011  <Minnikhanov@gmail.com> - 3.0.3-6
239fb7
- Fix Comment 9 #665560. https://bugzilla.redhat.com/show_bug.cgi?id=668090#c9
239fb7
- Temporarily test suite is blocked.
239fb7
239fb7
* Thu Jan 27 2011  <Minnikhanov@gmail.com> - 3.0.3-5
239fb7
- Fix Comment 7 #665560. https://bugzilla.redhat.com/show_bug.cgi?id=668090#c7 
239fb7
239fb7
* Tue Jan 25 2011  <Minnikhanov@gmail.com> - 3.0.3-4
239fb7
- Fix Comment 5 #665560. https://bugzilla.redhat.com/show_bug.cgi?id=668090#c5 
239fb7
239fb7
* Mon Jan 24 2011  <Minnikhanov@gmail.com> - 3.0.3-3
239fb7
- Fix Comment 3 #665560. https://bugzilla.redhat.com/show_bug.cgi?id=668090#c3 
239fb7
239fb7
* Sun Jan 23 2011  <Minnikhanov@gmail.com> - 3.0.3-2
239fb7
- Fix Comment 1 #665560. https://bugzilla.redhat.com/show_bug.cgi?id=668090#c1 
239fb7
239fb7
* Fri Jan 07 2011  <Minnikhanov@gmail.com> - 3.0.3-1
239fb7
- Initial package