%global gem_name logstasher Name: rubygem-%{gem_name} Version: 0.6.0 Release: 1%{?dist} Summary: Awesome rails logs Group: Development/Languages License: MIT URL: https://github.com/shadabahmed/logstasher Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # bundler killer patch # (not intended for upstream) Patch0: logstasher-tests-unbundle.diff # compatibility with logstash-event >= 1.2, ruby 2.0 # (not intended for upstream) Patch1: logstasher-tests-time-ruby20.diff # compatibility with logstash-event >= 1.2, ruby 2.1 # (not intended for upstream) Patch2: logstasher-tests-time-ruby21.diff # fix tests on Fedora # https://github.com/shadabahmed/logstasher/commit/a0f34c081b1da4b67551a61bde8acbc7733f001b Patch3: logstasher-tests-gemdir.diff # add license text # https://github.com/shadabahmed/logstasher/commit/c6c08d1acf5beec44b35a7a93c5f539bb0022c6f Patch4: logstasher-license.diff BuildArch: noarch BuildRequires: rubygems-devel # no tests: # - requires rspec >= 3 # - missing redis in EPEL7 #BuildRequires: rubygem(logstash-event) => 1.2 #BuildRequires: rubygem(rails) >= 3.0 #BuildRequires: rubygem(redis) #BuildRequires: rubygem(request_store) #BuildRequires: rubygem(rspec) >= 3 %if 0%{?fedora} && 0%{?fedora} <= 20 || 0%{?rhel} && 0%{?rhel} <= 7 Requires: ruby(release) Requires: ruby(rubygems) Requires: rubygem(logstash-event) => 1.1.0 Requires: rubygem(request_store) Provides: rubygem(%{gem_name}) = %{version} %endif %description Logstasher gem generates logstash compatible logs in JSON format. It can also easily log events from Rails. %package doc Summary: Documentation for %{name} Group: Documentation BuildArch: noarch Requires: %{name} = %{version}-%{release} %description doc Documentation for %{name}. %prep gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} %patch0 -p1 %if 0%{?fedora} && 0%{?fedora} <= 20 || 0%{?rhel} && 0%{?rhel} <= 7 %patch1 -p1 %else %patch2 -p1 %endif %patch3 -p1 %patch4 -p1 gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec # Remove < 1.2 restriction for logstash-event # (requires the compatibility patch in tests) sed -i -e 's|\(%q,\) \[.*\]|\1 [">= 1.1.0"]|' %{gem_name}.gemspec %build # Create the gem as gem install only works on a gem file gem build %{gem_name}.gemspec %gem_install %install mkdir -p %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ cp -p LICENSE %{buildroot}%{gem_instdir}/ # Missing dependencies #%%check #pushd .%%{gem_instdir} ## when using bundler: ##export RAILS_VERSION=4.0.0 #rspec -Ilib -Ispec spec #popd %files %doc %{gem_instdir}/LICENSE %dir %{gem_instdir} %{gem_libdir}/ %exclude %{gem_cache} %{gem_spec} %exclude %{gem_instdir}/%{gem_name}.gemspec %exclude %{gem_instdir}/.gitignore %exclude %{gem_instdir}/.rspec %exclude %{gem_instdir}/.travis.yml %files doc %doc %{gem_docdir} %{gem_instdir}/README.md %{gem_instdir}/sample_logstash_configurations/ %{gem_instdir}/spec/ %{gem_instdir}/Gemfile %{gem_instdir}/Guardfile %{gem_instdir}/Rakefile %changelog * Thu Aug 28 2014 František Dvořák - 0.6.0-1 - Initial package