Blob Blame History Raw
%global gem_name exception_notification

Name: rubygem-%{gem_name}
Version: 4.1.4
Release: 1%{?dist}
Summary: Exception notification for Rails apps
Group: Development/Languages
License: MIT
URL: https://smartinez87.github.io/exception_notification/3.x/
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# Remove bundler dependency from Rakefile. Probably cannot go upstream, because
# upstream prefers bundler.
Patch1: 0001-rake-remove-Bundler-and-Appraisal-deps.patch
# These dependencies (tinder, pigeon-carrier, slack-notifier, and sidekiq) are
# not yet present in Fedora.
Patch2: 0002-make-tinder-gem-optional-for-test-suite.patch
Patch3: 0003-make-pigeon-carrier-gem-optional-for-test-suite.patch
Patch4: 0004-make-slack-notifier-gem-optional-for-test-suite.patch
Patch5: 0005-make-sidekiq-gem-optional-for-test-suite.patch
%if 0%{?el7}
Requires: ruby(release) >= 2
Requires: ruby(rubygems)
Requires: rubygem(actionmailer) >= 3.0.4
Requires: rubygem(activesupport) >= 3.0.4
%endif
BuildRequires: ruby(release) >= 2
BuildRequires: rubygems-devel
BuildRequires: rubygem(actionmailer) >= 3.0.4
BuildRequires: rubygem(activesupport) >= 3.0.4
BuildRequires: rubygem(hipchat)
BuildRequires: rubygem(httparty)
BuildRequires: rubygem(minitest)
BuildRequires: rubygem(mocha)
BuildRequires: rubygem(rake)
BuildRequires: rubygem(rails) >= 3.0.4
BuildRequires: rubygem(sqlite3)
BuildArch: noarch
%if 0%{?el7}
Provides: rubygem(%{gem_name}) = %{version}
%endif

%description
The Exception Notification gem provides a set of notifiers for sending
notifications when errors occur in a Rack/Rails application. The built-in
notifiers can deliver notifications by email, campfire rooms or via
webhooks.


%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description doc
Documentation for %{name}.

%prep
gem unpack %{SOURCE0}

%autosetup -p 1 -D -T -n  %{gem_name}-%{version}

gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec

# Remove unnecessary bundler dependency from dummy Rails in test suite
sed -i '/bundler/d' test/dummy/config/boot.rb
# With bundler gone, we need to explicitly load exception_notification here
echo "require 'exception_notification'" >> test/dummy/config/boot.rb

# Remove /usr/bin/env from shebang so RPM doesn't consider this a dependency
sed -i 's|#!/usr/bin/env ruby|#!/usr/bin/ruby|' test/dummy/script/rails

# Remove developer-only files.
for f in Appraisals Gemfile \
test/dummy/.gitignore \
test/dummy/lib/tasks/.gitkeep \
test/dummy/public/stylesheets/.gitkeep ; do
  rm $f
  sed -i "s|\"$f\",||g" %{gem_name}.gemspec
done

%build
# Create the gem as gem install only works on a gem file
gem build %{gem_name}.gemspec

%gem_install

# remove unnecessary gemspec
pushd .%{gem_instdir}
  rm %{gem_name}.gemspec
popd

%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
       %{buildroot}%{gem_dir}/

%check
pushd .%{gem_instdir}
  # The reason we simply run "rake" here is that the Rakefile contains some
  # steps for setting up the sqlite database. These are non-trivial to do
  # outside of Rake.
  # The default command is to stage the DB, then run the tests. Here we go.
  rake
popd


%files
%dir %{gem_instdir}
%license %{gem_instdir}/MIT-LICENSE
%doc %{gem_instdir}/README.md
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}

%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGELOG.rdoc
%doc %{gem_instdir}/CONTRIBUTING.md
%{gem_instdir}/examples
%exclude %{gem_instdir}/test
%exclude %{gem_instdir}/gemfiles
%exclude %{gem_instdir}/Rakefile


%changelog
* Fri Jan 08 2016 Ken Dreyer <ktdreyer@ktdreyer.com> - 4.1.4-1
- Update to 4.1.4 (rhbz#1288675)
- Drop Fedora 20 conditionals
- Use %%autosetup macro

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Jun 11 2015 Ken Dreyer <ktdreyer@ktdreyer.com> - 4.1.1-1
- Update to 4.1.1 (rhbz#1229933)

* Mon Apr 06 2015 Ken Dreyer <ktdreyer@ktdreyer.com> - 4.1.0-1
- Update to 4.1.0 (rhbz#1209084)
- More patches for tests
- Use %%license macro

* Wed Jun 11 2014 Ken Dreyer <ktdreyer@ktdreyer.com> - 4.0.1-3
- Remove dot files in %%prep
- Move README to main package
- Exclude more files from -doc
- Drop hipchat patch and BR: rubygem(hipchat)
- Remove gem2rpm comment
- Update URL
- Update for Minitest 5 (RHBZ #1107105)

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Thu Oct 03 2013 Ken Dreyer <ktdreyer@ktdreyer.com> - 4.0.1-1
- Update to 4.0.1
- Drop upstreamed patches and LICENSE file
- Drop BR: ruby, since BR: ruby(release) does the same thing
- Patch out the dependency on hipchat

* Fri Sep 06 2013 Ken Dreyer <ktdreyer@ktdreyer.com> - 4.0.0-2
- Close -doc %%description with "."
- Remove executable attr from LICENSE
- Remove developer-only .gitkeep and .gitignore files

* Wed Sep 04 2013 Ken Dreyer <ktdreyer@ktdreyer.com> - 4.0.0-1
- Update to 4.0.0

* Fri Aug 10 2012 Ken Dreyer <ktdreyer@ktdreyer.com> - 2.6.1-1
- Initial package, created by gem2rpm 0.8.1