9e063b0
%global gem_name gherkin
f0afc09
f0afc09
# %%check section needs cucumber, however cucumber depends on gherkin.
16720dc
%{!?need_bootstrap:	%global	need_bootstrap	0}
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
Summary: Fast Gherkin lexer/parser
9e063b0
Name: rubygem-%{gem_name}
4dbd07b
Version: 2.12.2
16720dc
Release: 4%{?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
9e063b0
BuildRequires: rubygems-devel
Michal Fojtik 6d6df2b
BuildRequires: ruby-devel
4dbd07b
BuildRequires: rubygem(multi_json)
f0afc09
%if 0%{?need_bootstrap} < 1
3318c63
BuildRequires: rubygem(cucumber)
f0afc09
%endif
3318c63
BuildRequires: rubygem(rspec)
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
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
5e43f8f
mkdir -p %{buildroot}%{gem_extdir_mri}
5e43f8f
cp -a .%{gem_extdir_mri}/* %{buildroot}%{gem_extdir_mri}/
5e43f8f
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
4dbd07b
sed -i '21,22d' spec/spec_helper.rb
3318c63
# link the cucumber here for two features
3318c63
ln -s %{gem_dir}/gems/cucumber-`cucumber --version`/ ../cucumber
87c604a
# 2 failed on arm because they test fallback ruby lexers
87c604a
# but these are not installed by default (even if using normal gem install)
87c604a
LANG=en_US.utf8 cucumber || LANG=en_US.utf8 cucumber | grep '2 failed' || exit 1
929bb38
# 4 failed (11 on arm) because they test fallback ruby lexers
87c604a
LANG=en_US.utf8 rspec spec | grep '286 examples, 4 failures' || \
929bb38
LANG=en_US.utf8 rspec spec | grep '286 examples, 11 failures' || LANG=en_US.utf8 rspec spec
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
16720dc
* Fri Jan 16 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.12.2-4
16720dc
- Enable test suite again
16720dc
ff0b569
* Thu Jan 15 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.12.2-3
ff0b569
- Rebuild for ruby 2.2
ff0b569
- Bootstrap, once disable test
ff0b569
dd83d53
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.12.2-2
dd83d53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
dd83d53
4dbd07b
* Thu Jun 19 2014 Josef Stribny <jstribny@redhat.com> - 2.12.2-1
4dbd07b
- Update to gherkin 2.12.2
4dbd07b
3e1c395
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.11.6-7
3e1c395
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
3e1c395
5e43f8f
* Mon Apr 14 2014 Vít Ondruch <vondruch@redhat.com> - 2.11.6-5
5e43f8f
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.1
5e43f8f
271e1aa
* Tue Aug  6 2013 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.11.6-5
271e1aa
- Again enable test suite
271e1aa
57e47bb
* Tue Aug  6 2013 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.11.6-4
57e47bb
- Bootstrap
57e47bb
48397e0
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.11.6-3
48397e0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
48397e0
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