9e063b0
%global gem_name gherkin
f0afc09
f0afc09
# %%check section needs cucumber, however cucumber depends on gherkin.
2e2c538
%{!?need_bootstrap:	%global	need_bootstrap	0}
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
Summary: Fast Gherkin lexer/parser
9e063b0
Name: rubygem-%{gem_name}
b2c246d
Version: 2.11.6
2e2c538
Release: 2%{?dist}
Michal Fojtik 6d6df2b
Group: Development/Languages
Michal Fojtik 6d6df2b
License: MIT
b2c246d
URL: http://github.com/cucumber/gherkin
9e063b0
Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
486d19a
b2c246d
Patch1: gherkin-2.11.6-relax-json-dependency.patch
486d19a
f0afc09
Requires: ruby(release)
9e063b0
Requires: ruby(rubygems)
Chris Lalancette 621b2e9
Requires: rubygem(json)
9e063b0
BuildRequires: rubygems-devel
Michal Fojtik 6d6df2b
BuildRequires: ruby-devel
f0afc09
%if 0%{?need_bootstrap} < 1
3318c63
BuildRequires: rubygem(cucumber)
f0afc09
%endif
3318c63
BuildRequires: rubygem(rspec)
9e063b0
Provides: rubygem(%{gem_name}) = %{version}
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
%package doc
Michal Fojtik 6d6df2b
Summary: Documentation for %{name}
Michal Fojtik 6d6df2b
Group: Documentation
Michal Fojtik 6d6df2b
Requires:%{name} = %{version}-%{release}
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
%description doc
Michal Fojtik 6d6df2b
Documentation for %{name}
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
%description
Michal Fojtik 6d6df2b
A fast Gherkin lexer/parser based on the Ragel State Machine Compiler.
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
%prep
f0afc09
%gem_install -n %{SOURCE0}
9e063b0
b2c246d
pushd .%{gem_dir}
b2c246d
%patch1 -p0
9e063b0
popd
Chris Lalancette 91cfdf3
Chris Lalancette 91cfdf3
%build
9e063b0
pushd .%{gem_instdir}
Chris Lalancette 7f7c9c7
pushd ext
Michal Fojtik 6d6df2b
for lexer_dir in */ ; do
Chris Lalancette 7f7c9c7
    pushd $lexer_dir
Chris Lalancette 7f7c9c7
    CONFIGURE_ARGS="--with-cflags='%{optflags}'" ruby extconf.rb
Chris Lalancette 7f7c9c7
    make clean && make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
Chris Lalancette 7f7c9c7
    make install RUBYARCHDIR="../../lib"
Chris Lalancette 7f7c9c7
    popd
Michal Fojtik 6d6df2b
done
b2c246d
Chris Lalancette 7f7c9c7
popd
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
%install
9e063b0
mkdir -p %{buildroot}%{gem_dir}
9e063b0
cp -a .%{gem_dir}/* \
9e063b0
        %{buildroot}%{gem_dir}/
Chris Lalancette 7f7c9c7
504ba83
mkdir -p %{buildroot}%{gem_extdir_mri}/lib
549c497
# the .so files go in the extdir, so remove them from lib
504ba83
find %{buildroot}%{gem_instdir}/lib -iname '*.so' -exec mv {} %{buildroot}%{gem_extdir_mri}/lib \;
b2c246d
rm -rf %{buildroot}%{gem_instdir}/ext
Chris Lalancette 7f7c9c7
b2c246d
# remove hidden dirs
b2c246d
rm -rf %{buildroot}%{gem_instdir}/features/.cucumber
b2c246d
rm -rf %{buildroot}%{gem_instdir}/js/.npmignore
b2c246d
rm -rf %{buildroot}%{gem_instdir}/js/lib/gherkin/lexer/.npmignore
Chris Lalancette 621b2e9
find %{buildroot} -iname '.gitignore' -exec rm -f {} \;
b2c246d
# these files shouldn't be executable
b2c246d
chmod a-x %{buildroot}%{gem_instdir}/lib/gherkin/i18n.rb
b2c246d
chmod a-x %{buildroot}%{gem_instdir}/tasks/ragel_task.rb
b2c246d
chmod a-x %{buildroot}%{gem_instdir}/tasks/compile.rake
Michal Fojtik 6d6df2b
f0afc09
%if 0%{?need_bootstrap} < 1
3318c63
%check
3318c63
pushd .%{gem_instdir}
3318c63
# use this gherkin, not the system one
3318c63
export GEM_HOME="../../"
3318c63
# kill bundler for features and specs
3318c63
sed -i '7,8d' features/support/env.rb
3318c63
sed -i '7,8d' spec/spec_helper.rb
3318c63
# link the cucumber here for two features
3318c63
ln -s %{gem_dir}/gems/cucumber-`cucumber --version`/ ../cucumber
2e2c538
# There is some encoding error runnign test suite with Ruby 2.0 in both,
2e2c538
# Cucumber and RSpec test suites:
2e2c538
# https://github.com/cucumber/gherkin/issues/232
b2c246d
# run cucumber features - 16 failed because they test fallback ruby lexers
b2c246d
# but these are not installed by default (even if using normal gem install)
2e2c538
LANG=en_US.utf8 cucumber | grep '16 failed'
b2c246d
# run specs, 93 fail because of the reason mentioned above
2e2c538
LANG=en_US.utf8 rspec spec | grep '280 examples, 93 failures'
3318c63
popd
f0afc09
%endif
3318c63
Michal Fojtik 6d6df2b
%files
9e063b0
%dir %{gem_instdir}
9e063b0
%exclude %{gem_instdir}/.*
b2c246d
%exclude %{gem_instdir}/install_mingw_os_x.sh
504ba83
%{gem_extdir_mri}
9e063b0
%{gem_libdir}
9e063b0
%{gem_instdir}/js
9e063b0
%{gem_instdir}/ragel
9e063b0
%{gem_instdir}/build_native_gems.sh
9e063b0
%doc %{gem_instdir}/features
9e063b0
%doc %{gem_instdir}/spec
9e063b0
%doc %{gem_instdir}/LICENSE
9e063b0
%doc %{gem_instdir}/cucumber.yml
9e063b0
%doc %{gem_instdir}/Gemfile
9e063b0
%{gem_instdir}/%{gem_name}.gemspec
9e063b0
%{gem_cache}
9e063b0
%{gem_spec}
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
%files doc
b2c246d
%doc %{gem_instdir}/History.md
b2c246d
%doc %{gem_instdir}/README.md
b2c246d
%doc %{gem_docdir}
9e063b0
%{gem_instdir}/Rakefile
3318c63
%{gem_instdir}/examples
9e063b0
%{gem_instdir}/tasks
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
%changelog
f0afc09
* Wed Feb 20 2013 Vít Ondruch <vondruch@redhat.com> - 2.11.6-2
f0afc09
- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
f0afc09
- Add bootstrap code.
f0afc09
b2c246d
* Mon Feb 18 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 2.11.6-1
b2c246d
- Updated to version 2.11.6.
b2c246d
- Fixed wrong dates in changelog.
b2c246d
c364153
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9.3-3
c364153
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
c364153
c7c573c
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9.3-2
c7c573c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
c7c573c
3318c63
* Thu Mar 29 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 2.9.3-1
3318c63
- Update to 2.9.3
3318c63
- Introduced %%check section
3318c63
549c497
* Mon Jan 23 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 2.4.5-4
549c497
- Removed *.so files from %%{gem_libdir}.
549c497
9e063b0
* Mon Jan 23 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 2.4.5-3
9e063b0
- Rebuilt for Ruby 1.9.3.
9e063b0
- Significantly simplified build process.
9e063b0
f3e84d9
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.5-2
f3e84d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
f3e84d9
486d19a
* Tue Jul 12 2011 Mo Morsi <mmorsi@redhat.com> - 2.4.5-1
486d19a
- Update to latest upstream release
486d19a
b2c246d
* Wed Jun 08 2011 Chris Lalancette <clalance@redhat.com> - 2.3.3-3
Chris Lalancette 621b2e9
- Significantly revamped spec to conform more to fedora standards
Chris Lalancette 621b2e9
- Fix build on Rawhide
Chris Lalancette 621b2e9
a67c05c
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.3-2
a67c05c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
a67c05c
Michal Fojtik 57e3309
* Fri Feb 04 2011 Michal Fojtik <mfojtik@redhat.com> - 2.3.3-1
Michal Fojtik 57e3309
- Version bump
Michal Fojtik 57e3309
Michal Fojtik ee042b8
* Fri Sep 24 2010 Michal Fojtik <mfojtik@redhat.com> - 2.2.4-3
Michal Fojtik ee042b8
- Replaced ~> with >= in JSON version so now it can be used
Michal Fojtik ee042b8
  with latest json as well
Michal Fojtik ee042b8
Michal Fojtik ee042b8
* Fri Sep 24 2010 Michal Fojtik <mfojtik@redhat.com> - 2.2.4-2
Michal Fojtik ee042b8
- Fixed JSON dependency version
Michal Fojtik ee042b8
Michal Fojtik a1f3ae6
* Fri Sep 24 2010 Michal Fojtik <mfojtik@redhat.com> - 2.2.4-1
Michal Fojtik a1f3ae6
- Version bump
Michal Fojtik a1f3ae6
Michal Fojtik 6d6df2b
* Wed Sep 08 2010 Michal Fojtik <mfojtik@redhat.com> - 2.2.0-1
Michal Fojtik 6d6df2b
- Version bump
Michal Fojtik 6d6df2b
b2c246d
* Tue Jul 20 2010 Michal Fojtik <mfojtik@redhat.com> - 2.1.5-3
Michal Fojtik 6d6df2b
- Fixed rspec and trollop versions in gemspec files
Michal Fojtik 6d6df2b
b2c246d
* Tue Jul 20 2010 Michal Fojtik <mfojtik@redhat.com> - 2.1.5-2
Michal Fojtik 6d6df2b
- Added -doc subpackage
Michal Fojtik 6d6df2b
- Fixed debugging symbols issue (Thanks mtasaka)
Michal Fojtik 6d6df2b
- Fixed path for pushd in install section
Michal Fojtik 6d6df2b
- Fixed trollop version in gemspec
Michal Fojtik 6d6df2b
- Removed '#line foo' from C files
Michal Fojtik 6d6df2b
b2c246d
* Mon Jul 19 2010 Michal Fojtik <mfojtik@redhat.com> - 2.1.5-1
Michal Fojtik 6d6df2b
- Updated to latest version
Michal Fojtik 6d6df2b
- Fixed compiler flags
Michal Fojtik 6d6df2b
- Fixed directory ownership
Michal Fojtik 6d6df2b
- Removed unwanted versioning files
Michal Fojtik 6d6df2b
- Placed .so files on right place
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
* Wed Jul 14 2010 Michal Fojtik <mfojtik@redhat.com> - 2.1.3-1
Michal Fojtik 6d6df2b
- Initial package