9e063b0
%global gem_name gherkin
f0afc09
9e063b0
Name: rubygem-%{gem_name}
0d01952
Version: 5.1.0
3da0fbc
Release: 2%{?dist}
5c70b3d
Summary: Fast Gherkin lexer/parser
Michal Fojtik 6d6df2b
License: MIT
6abbea4
URL: https://github.com/cucumber/gherkin-ruby
5c70b3d
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
0d01952
# git clone https://github.com/cucumber/gherkin-ruby && cd gherkin-ruby
0d01952
# git checkout v5.1.0 && tar czvf rubygem-gherkin-5.1.0-make.tar.gz Makefile testdata/ bin/gherkin-generate-tokens
0d01952
Source1: %{name}-%{version}-make.tar.gz
5c70b3d
BuildRequires: ruby(release)
9e063b0
BuildRequires: rubygems-devel
5c70b3d
BuildRequires: ruby
3da0fbc
BuildRequires: %{_bindir}/help2man
3318c63
BuildRequires: rubygem(rspec)
5c70b3d
BuildRequires: %{_bindir}/jq
5c70b3d
BuildArch: noarch
5c70b3d
5c70b3d
%description
5c70b3d
A fast Gherkin lexer/parser based on the Ragel State Machine Compiler.
5c70b3d
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
%package doc
Michal Fojtik 6d6df2b
Summary: Documentation for %{name}
5c70b3d
Requires: %{name} = %{version}-%{release}
5c70b3d
BuildArch: noarch
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
%description doc
5c70b3d
Documentation for %{name}.
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
%prep
0d01952
%setup -q -n %{gem_name}-%{version} -b 1
9e063b0
Chris Lalancette 91cfdf3
%build
0d01952
# Create the gem as gem install only works -on a gem file
0d01952
gem build ../%{gem_name}-%{version}.gemspec
0d01952
0d01952
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
0d01952
# by default, so that we can move it into the buildroot in %%install
0d01952
%gem_install
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
6abbea4
mkdir -p %{buildroot}%{_bindir}
0d01952
cp -a .%{_bindir}/* \
6abbea4
        %{buildroot}%{_bindir}/
6abbea4
6abbea4
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
6abbea4
find %{buildroot}%{gem_instdir}/bin -type f | \
6abbea4
  xargs sed -i 's|^#!/usr/bin/env ruby$|#!/usr/bin/ruby|'
6abbea4
3da0fbc
# Build man page from `gherkin --help" output
3da0fbc
export GEM_PATH="%{buildroot}/%{gem_dir}:%{gem_dir}"
3da0fbc
mkdir -p %{buildroot}%{_mandir}/man1
3da0fbc
# Pass version manually to help2man, gherkin does not support "--version" option
3da0fbc
help2man -N -s1 --version-string=%{version} -o %{buildroot}%{_mandir}/man1/%{gem_name}.1 \
3da0fbc
    %{buildroot}/usr/share/gems/gems/%{gem_name}-%{version}/bin/%{gem_name}
3da0fbc
ln -s %{_mandir}/man1/%{gem_name}.1 %{buildroot}%{_mandir}/man1/%{gem_name}-ruby.1
3da0fbc
3318c63
%check
3318c63
pushd .%{gem_instdir}
5c70b3d
0d01952
rspec spec
0d01952
0d01952
# Files needed for make to pass.
0d01952
ln -s %{_builddir}/Makefile ./Makefile
0d01952
ln -s %{_builddir}/testdata ./testdata
0d01952
ln -s %{_builddir}/bin/gherkin-generate-tokens ./bin/gherkin-generate-tokens
5c70b3d
5c70b3d
sed -i '/.built:/ i .built:\n' Makefile
5c70b3d
sed -i '/.built: /,/^$/ s/^/#/' Makefile
5c70b3d
0d01952
make .compared
3318c63
popd
3318c63
Michal Fojtik 6d6df2b
%files
9e063b0
%dir %{gem_instdir}
6abbea4
%{_bindir}/gherkin-ruby
0d01952
%{_bindir}/gherkin
3da0fbc
%{_mandir}/man1/gherkin-ruby.1*
3da0fbc
%{_mandir}/man1/gherkin.1*
5c70b3d
%license %{gem_instdir}/LICENSE
5c70b3d
%{gem_instdir}/bin
9e063b0
%{gem_libdir}
e131636
%exclude %{gem_cache}
9e063b0
%{gem_spec}
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
%files doc
b2c246d
%doc %{gem_docdir}
5c70b3d
%doc %{gem_instdir}/README.md
5c70b3d
%{gem_instdir}/spec
Michal Fojtik 6d6df2b
Michal Fojtik 6d6df2b
%changelog
3da0fbc
* Wed Sep 19 2018 Jaroslav Prokop <jar.prokop@volny.cz> - 5.1.0-2
3da0fbc
- Add man pages for executables.
3da0fbc
0d01952
* Mon Sep 03 2018 Jaroslav Prokop <jar.prokop@volny.cz> - 5.1.0-1
0d01952
- Update to Gherkin 5.1.0.
0d01952
29c59c5
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.3-4
29c59c5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
29c59c5
18de2c3
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.3-3
18de2c3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
18de2c3
cf3a2d2
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.3-2
cf3a2d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
cf3a2d2
6abbea4
* Mon Jun 05 2017 Jun Aruga <jaruga@redhat.com> - 4.1.3-1
6abbea4
- Update to Gherkin 4.1.3.
6abbea4
9032be0
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-2
9032be0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
9032be0
7725ef7
* Tue Jan 10 2017 Jun Aruga <jaruga@redhat.com> - 4.0.0-1
7725ef7
- Update to Gherkin 4.0.0.
7725ef7
5c70b3d
* Tue Mar 01 2016 Vít Ondruch <vondruch@redhat.com> - 3.2.0-1
5c70b3d
- Update to Gherkin 3.2.0.
5c70b3d
e131636
* Tue Mar 01 2016 Vít Ondruch <vondruch@redhat.com> - 2.12.2-8
e131636
- Cleanup the .spec and enable the test suite.
e131636
713457d
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.12.2-7
713457d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
713457d
3ebcdef
* Wed Jan 13 2016 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.12.2-6
3ebcdef
- F-24: rebuild against ruby23
3ebcdef
- Bootstrap, once disable test
3ebcdef
50e0717
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.12.2-5
50e0717
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
50e0717
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