%global commit 6a96698f42475975375b027b4d3bf5d8511b4a8f
%global gem_name jgrep
Name: rubygem-%{gem_name}
Version: 1.3.3
Release: 2%{?dist}
Summary: Query JSON structure with a matching language
Group: Development/Tools
License: ASL 2.0
URL: http://jgrep.org/
Source0: https://github.com/ploubser/JSON-Grep/archive/%{commit}/JSON-Grep-%{commit}.tar.gz
Patch0: 0001-Fix-test-run.patch
BuildArch: noarch
BuildRequires: rubygems-devel
%if 0%{?rhel} == 0
BuildRequires: rubygem(rspec)
BuildRequires: rubygem(mocha)
%endif
Requires: ruby(release) >= 1.8
Requires: rubygems
Provides: rubygem(%{gem_name}) = %{version}-%{release}
%description
JGrep is Ruby-based CLI tool and API for parsing and displaying JSON data
using a logical expression syntax. It allows you to search a list of JSON
documents and return specific documents or values based on logical truths.
%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
%description doc
Documentation for %{name}
%prep
%setup -qn JSON-Grep-%{commit}
%patch0 -p1
%build
gem build %{gem_name}.gemspec
%gem_install
%install
mkdir -p %{buildroot}%{gem_dir}
mkdir -p %{buildroot}%{_bindir}
cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/
cp -a ./%{_bindir}/* %{buildroot}%{_bindir}
%if 0%{?rhel} == 0
%check
rspec -Ilib spec
%endif
%files
%{_bindir}/*
%dir %{gem_instdir}
%{gem_instdir}/bin
%{gem_libdir}
%exclude %{gem_cache}
%exclude %{gem_instdir}/*.gemspec
%{gem_spec}
%doc COPYING README.markdown
%files doc
%{gem_docdir}
%changelog
* Wed Apr 30 2014 Lubomir Rintel <lkundrak@v3.sk> - 1.3.3-3
- Disable tests on rhel
* Tue Apr 29 2014 Lubomir Rintel <lkundrak@v3.sk> - 1.3.3-2
- Run tests (Lukas Bezdicka, #1092000)
- Fix issue with tests. (Guess adding the run was a good idea...)
* Mon Apr 28 2014 Lubomir Rintel <lkundrak@v3.sk> - 1.3.3-1
- Initial packaging