diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4d9f962 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/treetop-1.4.14.gem diff --git a/.rh-ror41-rubygem-treetop.metadata b/.rh-ror41-rubygem-treetop.metadata new file mode 100644 index 0000000..9b5f53d --- /dev/null +++ b/.rh-ror41-rubygem-treetop.metadata @@ -0,0 +1 @@ +f6dc887e4ec12527666dd2519b6295c38b2c826b SOURCES/treetop-1.4.14.gem diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/rubygem-treetop-1.4.14-Avoid-collision-with-ActiveSupport-4.0.patch b/SOURCES/rubygem-treetop-1.4.14-Avoid-collision-with-ActiveSupport-4.0.patch new file mode 100644 index 0000000..c72851b --- /dev/null +++ b/SOURCES/rubygem-treetop-1.4.14-Avoid-collision-with-ActiveSupport-4.0.patch @@ -0,0 +1,49 @@ +From 4ebd34c62342e04fb8c4452b20f48d6f8cb66c40 Mon Sep 17 00:00:00 2001 +From: Clifford Heath +Date: Fri, 14 Jun 2013 11:45:53 +1000 +Subject: [PATCH] Inlined the String#indent method to avoid collision with + ActiveSupport 4.0 + +--- + lib/treetop/ruby_extensions/string.rb | 20 ++++++++------------ + 1 file changed, 8 insertions(+), 12 deletions(-) + +diff --git a/lib/treetop/ruby_extensions/string.rb b/lib/treetop/ruby_extensions/string.rb +index 9ea5dbf..15c1a41 100644 +--- a/lib/treetop/ruby_extensions/string.rb ++++ b/lib/treetop/ruby_extensions/string.rb +@@ -22,23 +22,19 @@ def blank? + # The following methods are lifted from Facets 2.0.2 + def tabto(n) + if self =~ /^( *)\S/ +- indent(n - $1.length) +- else +- self +- end +- end +- +- unless method_defined?(:indent) +- def indent(n) +- if n >= 0 +- gsub(/^/, ' ' * n) ++ # Inlined due to collision with ActiveSupport 4.0: indent(n - $1.length) ++ m = n - $1.length ++ if m >= 0 ++ gsub(/^/, ' ' * m) + else +- gsub(/^ {0,#{-n}}/, "") ++ gsub(/^ {0,#{-m}}/, "") + end ++ else ++ self + end + end + + def treetop_camelize + to_s.gsub(/\/(.?)/){ "::" + $1.upcase }.gsub(/(^|_)(.)/){ $2.upcase } + end +-end +\ No newline at end of file ++end +-- +1.8.1.6 diff --git a/SPECS/rubygem-treetop.spec b/SPECS/rubygem-treetop.spec new file mode 100644 index 0000000..6565fee --- /dev/null +++ b/SPECS/rubygem-treetop.spec @@ -0,0 +1,133 @@ +%{!?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 - 1.4.14-1 +- Update to 1.4.14 + +* Thu Jun 20 2013 Josef Stribny - 1.4.10-7 +- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0 + +* Wed Feb 27 2013 Vít Ondruch - 1.4.10-6 +- Rebuild to fix documentation vulnerability due to CVE-2013-0256. + +* Tue Jul 31 2012 Bohuslav Kabrda - 1.4.10-5 +- Exclude the cached gem. + +* Thu Jul 26 2012 Bohuslav Kabrda - 1.4.10-4 +- Specfile cleanup + +* Tue Apr 03 2012 Bohuslav Kabrda - 1.4.10-3 +- Rebuilt for scl. + +* Mon Jan 30 2012 Bohuslav Kabrda - 1.4.10-2 +- Rebuilt for Ruby 1.9.3. + +* Sun Jan 08 2012 - 1.4.10-1 +- Rebuilt and fix bz#716045 + +* Wed Feb 09 2011 Fedora Release Engineering - 1.4.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Jan 10 2011 Mohammed Morsi - 1.4.9-1 +- Updated to latest upstream release + +* Fri Jul 31 2009 Lubomir Rintel (Good Data) - 1.3.0-1 +- Update to new upstream version +- Mark more documentation files as such + +* Fri Jun 26 2009 Lubomir Rintel (Good Data) - 1.2.5-3 +- Get rid of duplicate files (thanks to Mamoru Tasaka) + +* Mon Jun 08 2009 Lubomir Rintel (Good Data) - 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) - 1.2.5-1 +- Package generated by gem2rpm +- Move examples into documentation +- Remove empty files +- Fix file permissions +- Fix up License