From c35b72de6a42989c4d69359e06d21f8eca064a09 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Jun 18 2020 13:15:59 +0000 Subject: [PATCH 1/2] Initial import. Resolves: rhbz##1845285 --- diff --git a/.gitignore b/.gitignore index e69de29..65b2136 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/listen-*.gem +/rubygem-listen-*-spec.txz diff --git a/rubygem-listen-3.1.5-Fix-issue-with-2.6.patch b/rubygem-listen-3.1.5-Fix-issue-with-2.6.patch new file mode 100644 index 0000000..ed5228d --- /dev/null +++ b/rubygem-listen-3.1.5-Fix-issue-with-2.6.patch @@ -0,0 +1,32 @@ +From 2908365366792ac3ba010fa32bc3be2beaed451a Mon Sep 17 00:00:00 2001 +From: Samuel Williams +Date: Sun, 16 Dec 2018 11:32:45 +1300 +Subject: [PATCH] Use raw Pathname to fix Linux specs. + +--- + spec/lib/listen/adapter/linux_spec.rb | 12 +----------- + 1 file changed, 1 insertions(+), 11 deletions(-) + +diff --git a/spec/lib/listen/adapter/linux_spec.rb b/spec/lib/listen/adapter/linux_spec.rb +index d77f0c0..da48319 100644 +--- a/spec/lib/listen/adapter/linux_spec.rb ++++ b/spec/lib/listen/adapter/linux_spec.rb +@@ -10,17 +10,7 @@ + end + + if linux? +- let(:dir1) do +- instance_double( +- Pathname, +- 'dir1', +- to_s: '/foo/dir1', +- cleanpath: real_dir1 +- ) +- end +- +- # just so cleanpath works in above double +- let(:real_dir1) { instance_double(Pathname, 'dir1', to_s: '/foo/dir1') } ++ let(:dir1) {Pathname.new("/foo/dir1")} + + let(:config) { instance_double(Listen::Adapter::Config) } + let(:queue) { instance_double(Queue) } diff --git a/rubygem-listen.spec b/rubygem-listen.spec new file mode 100644 index 0000000..224a762 --- /dev/null +++ b/rubygem-listen.spec @@ -0,0 +1,96 @@ +# Generated from listen-0.4.7.gem by gem2rpm -*- rpm-spec -*- +%global gem_name listen + +Name: rubygem-%{gem_name} +Version: 3.2.1 +Release: 1%{?dist} +Summary: Listen to file modifications +License: MIT +URL: https://github.com/guard/listen +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +# git clone https://github.com/guard/listen.git --no-checkout +# cd listen && git archive -v -o rubygem-listen-3.2.1-spec.txz v3.2.1 spec +Source1: rubygem-listen-%{version}-spec.txz +BuildRequires: ruby(release) +BuildRequires: rubygems-devel +BuildRequires: ruby +BuildRequires: rubygem(rb-inotify) +BuildRequires: 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} +popd + +# Remove the hardcoded dependencies. We don't have them in Fedora +# (except rb-inotify), they are platform specifis and not needed. +# https://github.com/guard/listen/pull/54 +%gemspec_remove_dep -g rb-fsevent [">= 0.10.3", "~> 0.10"] +sed -i '/def self.usable?$/a return false' lib/listen/adapter/darwin.rb + +%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 +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} +# Move the tests into place +ln -s %{_builddir}/spec spec + +# We removed dependencies from other platforms so let's remove +# tests as well +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 +* Thu Jun 18 2020 Jun Aruga - 3.2.1-1 +- Initial package diff --git a/sources b/sources index e69de29..c909c58 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (listen-3.2.1.gem) = b15ddcf9783f8c22e79bfe2615b8d2ecaa4ed0410000a0ba8e790a400ba3e7744b58c264cbc36e0235dbc60546d94d9d9548719370f9d5e1e959ea28b241d661 +SHA512 (rubygem-listen-3.2.1-spec.txz) = dbd527e6d78d2be0aec7a6a9e32cc32c04f92362b775b26eb1bd62d62b709c0394b24f3a8ef9a718134d02823c93afb486c54ee267c39a04fac32ded2719abb9 From 6a151e9ea8bc88ead72e36d2460e851874f71c05 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Jun 29 2020 18:06:50 +0000 Subject: [PATCH 2/2] Skip the requirement for rubygem-thor and the tests. rubygem-thor is not shipped on epel8. thor is only used in lib/listen/cli.rb. Related: rhbz##1845285 --- diff --git a/rubygem-listen.spec b/rubygem-listen.spec index 224a762..664b0a3 100644 --- a/rubygem-listen.spec +++ b/rubygem-listen.spec @@ -15,7 +15,8 @@ BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby BuildRequires: rubygem(rb-inotify) -BuildRequires: rubygem(thor) +# rubygem-thor is not shipped on epel8. +# BuildRequires: rubygem(thor) BuildRequires: rubygem(rspec) BuildArch: noarch @@ -73,6 +74,9 @@ ln -s %{_builddir}/spec spec # tests as well mv spec/lib/listen/adapter/darwin_spec.rb{,.disabled} +# Skip the tests that needs rubygem-thor, as it is not shipped on epel8. +mv spec/lib/listen/cli_spec.rb{,disabled} + rspec -rspec_helper spec popd @@ -92,5 +96,6 @@ popd %doc %{gem_instdir}/README.md %changelog -* Thu Jun 18 2020 Jun Aruga - 3.2.1-1 +* Mon Jun 29 2020 Jun Aruga - 3.2.1-1 - Initial package +- Skip the requirement for rubygem-thor and the tests.