diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c92c1cc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/rb-inotify-0.9.7.gem diff --git a/.rh-ror50-rubygem-rb-inotify.metadata b/.rh-ror50-rubygem-rb-inotify.metadata new file mode 100644 index 0000000..ca2702e --- /dev/null +++ b/.rh-ror50-rubygem-rb-inotify.metadata @@ -0,0 +1 @@ +a47c5e88135cc959bb520894d635d631fa23a3f6 SOURCES/rb-inotify-0.9.7.gem diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/rubygem-rb-inotify-0.9.7-Avoid-crashing-when-fd-is-closed.patch b/SOURCES/rubygem-rb-inotify-0.9.7-Avoid-crashing-when-fd-is-closed.patch new file mode 100644 index 0000000..f7f80f8 --- /dev/null +++ b/SOURCES/rubygem-rb-inotify-0.9.7-Avoid-crashing-when-fd-is-closed.patch @@ -0,0 +1,23 @@ +From 99d2101eaa71adc40737ae45cb03d3ae86fdad4a Mon Sep 17 00:00:00 2001 +From: Cezary Baginski +Date: Fri, 29 Jul 2016 13:26:22 +0200 +Subject: [PATCH] avoid crashing on Ruby 2.3.1 when fd is closed + +--- + lib/rb-inotify/notifier.rb | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/lib/rb-inotify/notifier.rb b/lib/rb-inotify/notifier.rb +index c2f6ddc..516e78f 100644 +--- a/lib/rb-inotify/notifier.rb ++++ b/lib/rb-inotify/notifier.rb +@@ -302,6 +302,9 @@ def readpartial(size) + # If the IO has already been closed, reading from it will cause + # Errno::EBADF. + return nil ++ rescue IOError => ex ++ return nil if ex.message =~ /stream closed/ ++ raise + end + + tries = 0 diff --git a/SOURCES/rubygem-rb-inotify-0.9.7-Prevent-error-when-closing-notifier-in-watch-callback.patch b/SOURCES/rubygem-rb-inotify-0.9.7-Prevent-error-when-closing-notifier-in-watch-callback.patch new file mode 100644 index 0000000..952aef6 --- /dev/null +++ b/SOURCES/rubygem-rb-inotify-0.9.7-Prevent-error-when-closing-notifier-in-watch-callback.patch @@ -0,0 +1,22 @@ +From a3ff7cc8cd7c4e57a4e6d5a885d515946081239f Mon Sep 17 00:00:00 2001 +From: Cezary Baginski +Date: Tue, 3 May 2016 00:03:50 +0200 +Subject: [PATCH] Avoid crashing after fd is closed (fix: #41) + +--- + lib/rb-inotify/event.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/rb-inotify/event.rb b/lib/rb-inotify/event.rb +index f6e9551..11701ac 100644 +--- a/lib/rb-inotify/event.rb ++++ b/lib/rb-inotify/event.rb +@@ -125,7 +125,7 @@ def initialize(data, notifier) + # + # @private + def callback! +- watcher.callback!(self) ++ watcher && watcher.callback!(self) + end + + # Returns the size of this event object in bytes, diff --git a/SPECS/rubygem-rb-inotify.spec b/SPECS/rubygem-rb-inotify.spec new file mode 100644 index 0000000..2278642 --- /dev/null +++ b/SPECS/rubygem-rb-inotify.spec @@ -0,0 +1,133 @@ +%{?scl:%scl_package rubygem-%{gem_name}} +%{!?scl:%global pkg_name %{name}} + +%global gem_name rb-inotify + +Name: %{?scl_prefix}rubygem-%{gem_name} +Version: 0.9.7 +Release: 2%{?dist} +Summary: A Ruby wrapper for Linux's inotify, using FFI +Group: Development/Languages +License: MIT +URL: http://github.com/nex3/rb-inotify +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +# The following two patches make rubygem-rerun test suite passing. +# When closing a notifier from within the callback-block of a watch, then +# the process call on the notifier will fail. +# https://github.com/nex3/rb-inotify/issues/41 +Patch0: rubygem-rb-inotify-0.9.7-Prevent-error-when-closing-notifier-in-watch-callback.patch +# Avoid crashing on Ruby 2.3.1 when fd is closed. +# https://github.com/nex3/rb-inotify/pull/59 +Patch1: rubygem-rb-inotify-0.9.7-Avoid-crashing-when-fd-is-closed.patch + +Requires: %{?scl_prefix_ruby}ruby(release) +Requires: %{?scl_prefix_ruby}ruby(rubygems) +Requires: %{?scl_prefix}rubygem(ffi) +BuildRequires: %{?scl_prefix_ruby}ruby(release) +BuildRequires: %{?scl_prefix_ruby}ruby(rubygems) +BuildRequires: %{?scl_prefix_ruby}ruby +BuildRequires: %{?scl_prefix_ruby}rubygems-devel +BuildArch: noarch +Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version} + +# Explicitly require runtime subpackage, as long as older scl-utils do not generate it +%{?scl:Requires: %{?scl_prefix}runtime} + +%description +A Ruby wrapper for Linux's inotify, using FFI. + +%package doc +Summary: Documentation for %{pkg_name} +Group: Documentation +Requires: %{?scl_prefix}%{pkg_name} = %{version}-%{release} +BuildArch: noarch + +%description doc +Documentation for %{pkg_name}. + +%prep +%setup -n %{pkg_name}-%{version} -q -c -T +%{?scl:scl enable %{scl} - << \EOF} +%gem_install -n %{SOURCE0} +%{?scl:EOF} + +pushd .%{gem_instdir} +%patch0 -p1 +%patch1 -p1 +popd + +%build + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ + +%files +# There is no %%license macro on RHEL6. +# https://bugzilla.redhat.com/show_bug.cgi?id=1386246 +%{!?_licensedir:%global license %%doc} + +%dir %{gem_instdir} +%exclude %{gem_instdir}/.* +%license %{gem_instdir}/MIT-LICENSE +%{gem_libdir} +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_docdir} +%doc %{gem_instdir}/README.md +%doc %{gem_instdir}/VERSION +%{gem_instdir}/Rakefile +%{gem_instdir}/%{gem_name}.gemspec + +%changelog +* Tue Sep 06 2016 Vít Ondruch - 0.9.7-2 +- Avoid crashing when fd is closed. + +* Fri Jul 01 2016 Vít Ondruch - 0.9.7-1 +- Update to rb-inotify 0.9.7. + +* Thu Feb 04 2016 Fedora Release Engineering - 0.9.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jun 18 2015 Fedora Release Engineering - 0.9.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Tue Oct 07 2014 Josef Stribny - 0.9.5-1 +- Update to 0.9.5 + +* Sun Jun 08 2014 Fedora Release Engineering - 0.8.8-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sun Aug 04 2013 Fedora Release Engineering - 0.8.8-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Mar 07 2013 Vít Ondruch - 0.8.8-3 +- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0 + +* Thu Feb 14 2013 Fedora Release Engineering - 0.8.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Jul 24 2012 Vít Ondruch - 0.8.8-1 +- Update to rb-inotify 0.8.8. + +* Sat Jul 21 2012 Fedora Release Engineering - 0.8.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Feb 03 2012 Vít Ondruch - 0.8.1-5 +- Rebuilt for Ruby 1.9.3. + +* Sat Jan 14 2012 Fedora Release Engineering - 0.8.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Feb 09 2011 Fedora Release Engineering - 0.8.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Oct 11 2010 Michal Fojtik - 0.8.1-2 +- Removed unused macros +- Moved Rakefile into doc + +* Tue Oct 05 2010 Michal Fojtik - 0.8.1-1 +- Initial package