17
0
Files
rubygem-ruby_parser/rubygem-ruby_parser.spec
Stephan Kulow de04371c0e - updated to version 3.1.3
* 2 bug fixes:
  * Fixed begin w/ else but no rescue. (whitequark)
  * Removed literal stripping from block_append. Not its job.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby:extensions/rubygem-ruby_parser?expand=0&rev=26
2013-04-20 15:48:13 +00:00

120 lines
3.8 KiB
RPMSpec

#
# spec file for package rubygem-ruby_parser
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: rubygem-ruby_parser
Version: 3.1.3
Release: 0
%define mod_name ruby_parser
%define mod_full_name %{mod_name}-%{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: ruby-macros >= 1
BuildRequires: rubygem(rdoc) > 3.10
Url: https://github.com/seattlerb/ruby_parser
Source: http://rubygems.org/gems/%{mod_full_name}.gem
Summary: ruby_parser (RP) is a ruby parser written in pure ruby (utilizing
License: MIT
Group: Development/Languages/Ruby
%define mod_branch -3.1.3
%define mod_weight 3
PreReq: update-alternatives
%description
ruby_parser (RP) is a ruby parser written in pure ruby (utilizing
racc--which does by default use a C extension). RP's output is
the same as ParseTree's output: s-expressions using ruby's arrays and
base types.
As an example:
def conditional1 arg1
return 1 if arg1 == 0
return 0
end
becomes:
s(:defn, :conditional1, s(:args, :arg1),
s(:if,
s(:call, s(:lvar, :arg1), :==, s(:lit, 0)),
s(:return, s(:lit, 1)),
nil),
s(:return, s(:lit, 0)))
%package doc
Summary: RDoc documentation for %{mod_name}
Group: Development/Languages/Ruby
Requires: %{name} = %{version}
%description doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.
%package testsuite
Summary: Test suite for %{mod_name}
Group: Development/Languages/Ruby
Requires: %{name} = %{version}
%description testsuite
Test::Unit or RSpec files, useful for developers.
%prep
#gem_unpack
#if you need patches, apply them here and replace the # with a % sign in the surrounding lines
#gem_build
%build
%install
%gem_install -f
mv %{buildroot}%{_bindir}/ruby_parse{,%{mod_branch}}
ln -s ruby_parse%{mod_branch} %{buildroot}%{_bindir}/ruby_parse
mv %{buildroot}%{_bindir}/ruby_parse_extract_error{,%{mod_branch}}
ln -s ruby_parse_extract_error%{mod_branch} %{buildroot}%{_bindir}/ruby_parse_extract_error
%post
/usr/sbin/update-alternatives --install \
%{_bindir}/ruby_parse ruby_parse %{_bindir}/ruby_parse%{mod_branch} %{mod_weight}
/usr/sbin/update-alternatives --install \
%{_bindir}/ruby_parse_extract_error ruby_parse_extract_error %{_bindir}/ruby_parse_extract_error%{mod_branch} %{mod_weight}
%preun
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove ruby_parse %{_bindir}/ruby_parse%{mod_branch}
fi
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove ruby_parse_extract_error %{_bindir}/ruby_parse_extract_error%{mod_branch}
fi
%files
%defattr(-,root,root,-)
%{_bindir}/ruby_parse%{mod_branch}
%ghost %{_bindir}/ruby_parse
%{_bindir}/ruby_parse_extract_error%{mod_branch}
%ghost %{_bindir}/ruby_parse_extract_error
%{_libdir}/ruby/gems/%{rb_ver}/cache/%{mod_full_name}.gem
%{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_full_name}/
%exclude %{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_full_name}/test
%{_libdir}/ruby/gems/%{rb_ver}/specifications/%{mod_full_name}.gemspec
%files doc
%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/%{rb_ver}/doc/%{mod_full_name}/
%files testsuite
%defattr(-,root,root,-)
%{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_full_name}/test
%changelog