%{!?scl:%global pkg_name %{name}}
%{?scl:%scl_package rubygem-%{gem_name}}
%global gem_name treetop
Summary: A Ruby-based text parsing and interpretation DSL
Name: %{?scl_prefix}rubygem-%{gem_name}
Version: 1.4.14
Release: 1%{?dist}
Group: Development/Languages
License: MIT
URL: http://treetop.rubyforge.org/
Source0: http://rubygems.org/downloads/%{gem_name}-%{version}.gem
# Avoid collision with ActiveSupport 4.0.
# https://github.com/cjheath/treetop/commit/4ebd34c62342e04fb8c4452b20f48d6f8cb66c40
Patch0: rubygem-treetop-1.4.14-Avoid-collision-with-ActiveSupport-4.0.patch
Requires: %{?scl_prefix_ruby}ruby(release)
Requires: %{?scl_prefix_ruby}ruby(rubygems)
Requires: %{?scl_prefix}rubygem(polyglot) >= 0.3.1
BuildRequires: %{?scl_prefix_ruby}rubygems-devel
# rr not in scl
#BuildRequires: rubygem(activesupport)
#BuildRequires: rubygem(polyglot)
#BuildRequires: rubygem(rr)
#BuildRequires: rubygem(rspec)
BuildArch: noarch
Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version}
%description
Treetop is a language for describing languages. It helps you analyze syntax.
%prep
%setup -q -c -T
%{?scl:scl enable %scl - << \EOF}
%gem_install -n %{SOURCE0}
%{?scl:EOF}
pushd .%{gem_instdir}
%patch0 -p1
popd
%build
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/
mkdir -p %{buildroot}%{_bindir}
cp -a ./%{_bindir}/* %{buildroot}%{_bindir}
# Fix the permissions and shebangs.
# https://groups.google.com/forum/?fromgroups=#!topic/treetop-dev/mfyCGee_dv4
find %{buildroot}%{gem_instdir}/{doc,examples,lib,spec} -executable -type f | xargs chmod a-x
sed -i '/^#!/d' %{buildroot}%{gem_instdir}/spec/compiler/multibyte_chars_spec.rb
# Remove zero-length documentation files
find %{buildroot}%{gem_docdir} -empty -delete
# Uncomment as soon as we have rubygem-rr in scl
#%check
#pushd %{buildroot}%{gem_instdir}
#rspec spec
%files
%{_bindir}/tt
%dir %{gem_instdir}
%{gem_instdir}/bin
%{gem_libdir}
%{gem_instdir}/Rakefile
%doc %{gem_instdir}/doc
%doc %{gem_instdir}/examples
%doc %{gem_instdir}/README.md
%doc %{gem_instdir}/LICENSE
%doc %{gem_instdir}/spec
%doc %{gem_instdir}/%{gem_name}.gemspec
%doc %{gem_docdir}
%exclude %{gem_cache}
%{gem_spec}
%changelog
* Mon Jan 19 2015 Josef Stribny <jstribny@redhat.com> - 1.4.14-1
- Update to 1.4.14
* Thu Jun 20 2013 Josef Stribny <jstribny@redhat.com> - 1.4.10-7
- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
* Wed Feb 27 2013 Vít Ondruch <vondruch@redhat.com> - 1.4.10-6
- Rebuild to fix documentation vulnerability due to CVE-2013-0256.
* Tue Jul 31 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1.4.10-5
- Exclude the cached gem.
* Thu Jul 26 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1.4.10-4
- Specfile cleanup
* Tue Apr 03 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1.4.10-3
- Rebuilt for scl.
* Mon Jan 30 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1.4.10-2
- Rebuilt for Ruby 1.9.3.
* Sun Jan 08 2012 <stahnma@fedoraproject.org> - 1.4.10-1
- Rebuilt and fix bz#716045
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Mon Jan 10 2011 Mohammed Morsi <mmorsi@redhat.com> - 1.4.9-1
- Updated to latest upstream release
* Fri Jul 31 2009 Lubomir Rintel (Good Data) <lubo.rintel@gooddata.com> - 1.3.0-1
- Update to new upstream version
- Mark more documentation files as such
* Fri Jun 26 2009 Lubomir Rintel (Good Data) <lubo.rintel@gooddata.com> - 1.2.5-3
- Get rid of duplicate files (thanks to Mamoru Tasaka)
* Mon Jun 08 2009 Lubomir Rintel (Good Data) <lubo.rintel@gooddata.com> - 1.2.5-2
- Fix up documentation list
- Use gem_instdir macro where appropriate
- Do not move examples around
- Depend on ruby(abi)
- Replace defines with globals
* Fri Jun 05 2009 Lubomir Rintel (Good Data) <lubo.rintel@gooddata.com> - 1.2.5-1
- Package generated by gem2rpm
- Move examples into documentation
- Remove empty files
- Fix file permissions
- Fix up License