%global gem_name logstasher Name: rubygem-%{gem_name} Version: 0.6.1 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 # git clone https://github.com/shadabahmed/logstasher.git && cd logstasher # git checkout v0.6.1 # tar -czf rubygem-logstasher-0.6.1-repo.tgz sample_logstash_configurations spec/ LICENSE README.md Source1: %{name}-%{version}-repo.tgz # 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 BuildArch: noarch BuildRequires: rubygems-devel # for tests: #BuildRequires: rubygem(logstash-event) => 1.2 #BuildRequires: rubygem(rails) >= 3.0 #BuildRequires: rubygem(redis) #BuildRequires: rubygem(request_store) #BuildRequires: rubygem(rspec) >= 3 # explicit runtime dependency on activesupport # https://github.com/shadabahmed/logstasher/pull/55 Requires: rubygem(activesupport) >= 3.0 %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} tar xzf %{SOURCE1} %patch0 -p1 %if 0%{?fedora} && 0%{?fedora} <= 20 || 0%{?rhel} && 0%{?rhel} <= 7 %patch1 -p1 %else %patch2 -p1 %endif 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 gem build %{gem_name}.gemspec %gem_install %install mkdir -p %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ cp -a sample_logstash_configurations/ spec/ LICENSE README.md \ %{buildroot}%{gem_instdir}/ # Missing dependencies #%%check #pushd .%%{gem_instdir} #rspec -Ilib -Ispec spec #popd %files %doc %{gem_instdir}/LICENSE %dir %{gem_instdir}/ %{gem_libdir}// %exclude %{gem_cache} %{gem_spec} %files doc %doc %{gem_instdir}/README.md %doc %{gem_docdir}/ %{gem_instdir}/sample_logstash_configurations/ %{gem_instdir}/spec/ %changelog * Tue Sep 16 2014 František Dvořák - 0.6.1-1 - New version * Wed Sep 10 2014 František Dvořák - 0.6.0-2 - Explicit runtime dependency on activesupport * Thu Aug 28 2014 František Dvořák - 0.6.0-1 - Initial package