diff --git a/.gitignore b/.gitignore index ce556ee..ef502b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ /guard-2.14.2.gem /rubygem-guard-2.14.2-spec.tar.gz +/guard-2.15.0.gem +/rubygem-guard-2.15.0-fix-test-suite-stubs.patch +/rubygem-guard-2.15.0-spec.tar.gz diff --git a/rubygem-guard.spec b/rubygem-guard.spec index d190a9a..6571426 100644 --- a/rubygem-guard.spec +++ b/rubygem-guard.spec @@ -2,26 +2,26 @@ %global gem_name guard Name: rubygem-%{gem_name} -Version: 2.14.2 -Release: 4%{?dist} +Version: 2.15.0 +Release: 1%{?dist} Summary: Guard keeps an eye on your file modifications License: MIT URL: http://guardgem.org Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # git clone https://github.com/guard/guard.git && cd guard -# git checkout v2.14.2 -# tar -czvf rubygem-guard-2.14.2-spec.tar.gz spec/ +# git checkout v2.15.0 && tar -czvf rubygem-guard-2.15.0-spec.tar.gz spec/ Source1: %{name}-%{version}-spec.tar.gz -# Fix rspec random test failure -# https://github.com/guard/guard/pull/894 -Patch0: rubygem-guard-2.14.2-fix-rspec-random-test-failure.patch -# Fix rspec warning message -# https://github.com/guard/guard/pull/893 -Patch1: rubygem-guard-2.14.2-fix-rspec-warning-message.patch +# Cucumber test suite is tightly coupled with guard-cucumber which is not in Fedora yet. +# git clone https://github.com/guard/guard.git && cd guard +# git checkout v2.15.0 && tar -czvf rubygem-guard-2.15.0-features.tar.gz features/ +# Source2: %%{name}-%%{version}-features.tar.gz + +# Ruby 2.6 changed the way Pathname#read works +# PR: https://github.com/guard/guard/pull/923 +Patch0: %{name}-%{version}-fix-test-suite-stubs.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby >= 1.9.3 -BuildRequires: rubygem(rspec) BuildRequires: rubygem(formatador) BuildRequires: rubygem(listen) BuildRequires: rubygem(lumberjack) @@ -30,6 +30,7 @@ BuildRequires: rubygem(notiffany) BuildRequires: rubygem(pry) BuildRequires: rubygem(shellany) BuildRequires: rubygem(thor) +BuildRequires: rubygem(rspec) BuildArch: noarch %description @@ -46,26 +47,18 @@ BuildArch: noarch Documentation for %{name}. %prep -gem unpack %{SOURCE0} +%setup -q -n %{gem_name}-%{version} -b 1 -%setup -q -D -T -n %{gem_name}-%{version} -b 1 - -gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec +# Kill Shebang +sed -i -e '\|^#!|d' lib/guard/rake_task.rb pushd %{_builddir}/ %patch0 -p1 -%patch1 -p1 popd -# Fix Shebang -sed -i -e 's|#!/usr/bin/env ruby|#!/usr/bin/ruby|' bin/%{gem_name} bin/_%{gem_name}-core - -# Kill Shebang -sed -i -e '\|^#!|d' lib/guard/rake_task.rb - %build # Create the gem as gem install only works on a gem file -gem build %{gem_name}.gemspec +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 @@ -81,9 +74,11 @@ mkdir -p %{buildroot}%{_bindir} cp -pa .%{_bindir}/* \ %{buildroot}%{_bindir}/ +mkdir -p %{buildroot}%{_mandir}/man1 +mv %{buildroot}%{gem_instdir}/man/guard.1* %{buildroot}%{_mandir}/man1 + find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x -# Run the test suite. %check pushd .%{gem_instdir} ln -s %{_builddir}/spec spec @@ -91,17 +86,23 @@ ln -s %{_builddir}/spec spec # We don't really care about code coverage. sed -i "/[sS]imple[cC]ov/ s/^/#/" spec/spec_helper.rb +# Correct path to the bin file. +sed -i 's/path = File.expand_path("..\/..\/..\/bin\/guard", __dir__)/path = File.expand_path("..\/..\/..\/guard-2.15.0\/bin\/guard", __dir__)/' spec/lib/guard/bin_spec.rb + # RPM has some unexpected environment variables, ignore them. sed -i '/GEM_SKIP/a \ allow(ENV).to receive(:[]).with("RPM_PACKAGE_NAME").and_call_original' spec/spec_helper.rb -# TODO: Fails with "stub me! (File.exist?("/usr/lib/gems/ruby/ffi-1.9.18/gem.build_complete"))", +# TODO: Fails with "stub me! (File.exist?("/usr/lib/gems/ruby/ffi-1.9.23/gem.build_complete"))", # not entirely sure why sed -i '/it "shows an info message" do/,/^ end$/ s/^/#/' spec/lib/guard/plugin_util_spec.rb +# Pry 0.12 renamed input_array to input_ring, testing with older pry therefore results in failures. +# https://github.com/pry/pry/blob/4fd730783ab7ebb0680c3d4a6709803c04413ead/lib/pry/pry_instance.rb#L39 +sed -i '/let(:pry) { instance_double(Pry, input_ring/ s/input_ring/input_array/' spec/lib/guard/jobs/pry_wrapper_spec.rb + rspec -rspec_helper spec popd - %files %dir %{gem_instdir} %{_bindir}/guard @@ -110,7 +111,7 @@ popd %{gem_instdir}/bin %{gem_instdir}/images %{gem_libdir} -%{gem_instdir}/man +%{_mandir}/man1/guard.1* %exclude %{gem_cache} %{gem_spec} @@ -120,6 +121,9 @@ popd %doc %{gem_instdir}/README.md %changelog +* Sat Feb 09 2019 Jaroslav Prokop - 2.15.0-1 +- Update to guard 2.15.0 + * Sat Feb 02 2019 Fedora Release Engineering - 2.14.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild diff --git a/sources b/sources index 3076fe0..8d381d5 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -SHA512 (guard-2.14.2.gem) = 86fdf906e7c6de3be10b781632efaed692c3740360cf4e9b185f882a64416cbc28fe8dddf2e31b036592fd3c8248b81e15674dc5891e2344fdffd5428cd45471 -SHA512 (rubygem-guard-2.14.2-spec.tar.gz) = 1d1f335bfb9813fbfc443df31726df11473ef914d216f58e1b0711c38672238247d5f478f978494392d2b5f3c472811a9a331d6ab3bec5d37b8201731b79b2b6 +SHA512 (rubygem-guard-2.15.0-fix-test-suite-stubs.patch) = f73ffc5567f17eafdcdae3f56236cf6d58c9c05396b8a47f119dbd500bff0397eb216dc7b93541bbdee813b66a05f727fea34efcf8a337d9f93d724e7de5ae44