%global gem_name listen Name: rubygem-%{gem_name} Version: 3.1.5 Release: 1 Summary: Listen to file modifications License: MIT URL: https://github.com/guard/listen Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem Source1: https://github.com/guard/%{gem_name}/archive/v%{version}.tar.gz # Fix test suite on Ruby 2.6. # https://github.com/guard/listen/commit/466594233b9ee4377cc9f3a845ab8c60b33134a8 # https://github.com/guard/listen/commit/2908365366792ac3ba010fa32bc3be2beaed451a Patch0: rubygem-listen-3.1.5-Fix-issue-with-2.6.patch BuildRequires: ruby(release) rubygems-devel ruby rubygem(rb-inotify) rubygem(thor) BuildRequires: rubygem(rspec) BuildArch: noarch %description The Listen gem listens to file modifications and notifies you about the changes. Works everywhere! %package doc Summary: Documentation for %{name} Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc Documentation for %{name}. %prep %setup -q -n %{gem_name}-%{version} -b 1 pushd %{_builddir} ln -s %{_builddir}/%{gem_name}-%{version}/spec spec %patch0 -p1 popd %gemspec_remove_dep -g rb-fsevent [">= 0.9.4", "~> 0.9"] sed -i '/def self.usable?$/a return false' lib/listen/adapter/darwin.rb %gemspec_remove_dep -g ruby_dep "~> 1.2" sed -i '/ruby_dep/ s/^/#/' lib/listen.rb sed -i '/RubyDep/ s/^/#/' lib/listen.rb %build gem build ../%{gem_name}-%{version}.gemspec %gem_install %install mkdir -p %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ mkdir -p %{buildroot}%{_bindir} cp -a .%{_bindir}/* \ %{buildroot}%{_bindir}/ find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x %check pushd .%{gem_instdir} ln -s %{_builddir}/%{gem_name}-%{version}/spec spec mv spec/lib/listen/adapter/darwin_spec.rb{,.disabled} rspec -rspec_helper spec popd %files %dir %{gem_instdir} %{_bindir}/listen %license %{gem_instdir}/LICENSE.txt %{gem_instdir}/bin %{gem_libdir} %exclude %{gem_cache} %{gem_spec} %files doc %doc %{gem_docdir} %doc %{gem_instdir}/CHANGELOG.md %doc %{gem_instdir}/CONTRIBUTING.md %doc %{gem_instdir}/README.md %changelog * Mon Aug 24 2020 tushenmei - 3.1.5-1 - package init