Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 682ccbca9bf0a01c1e55fee863f505a3 > files > 2

ruby-ruby-debug19-0.11.6-5.mga3.src.rpm

%global	gem_name	ruby-debug19
%global	rubyabi		1.9.1

Summary:	Command line interface (CLI) for ruby-debug-base
Name:		ruby-%{gem_name}
Version:	0.11.6
Release:	%mkrel 5

Group:		Development/Ruby
# LICENSE
License:	BSD
URL:		http://rubyforge.org/projects/ruby-debug19/
Source0:	http://rubygems.org/gems/%{gem_name}-%{version}.gem
BuildRequires:	rubygems
# %% check
BuildRequires:	rubygem(columnize) >= 0.3.1
BuildRequires:	rubygem(linecache19) >= 0.5.13
BuildRequires:	rubygem(ruby-debug-base19) >= 0.11.26

BuildArch:	noarch
Provides:       rubygem(ruby-debug) = %{version}-%{release}
# Obsolete this, not providing
Obsoletes:	rubygem-ruby-debug <= 0.10.5
Obsoletes:	ruby-ruby-debug < %{version}

%description
A generic command line interface for ruby-debug.

%package	doc
Summary:	Documentation for %{name}
Group:		Documentation
Requires:	%{name} = %{version}-%{release}
BuildArch:	noarch
# Obsolete this, not providing
Obsoletes:	rubygem-ruby-debug-doc <= 0.10.5
Obsoletes:	ruby-ruby-debug-doc < %{version}

%description doc
Documentation for %{name}

%prep
%setup -q -c -T

# Gem repack
TOPDIR=$(pwd)
mkdir tmpunpackdir
pushd tmpunpackdir

gem unpack %{SOURCE0}
cd %{gem_name}-%{version}
gem specification -l --ruby %{SOURCE0} > %{gem_name}.gemspec
gem build %{gem_name}.gemspec
mv %{gem_name}-%{version}.gem $TOPDIR

popd
rm -rf tmpunpackdir

%build
mkdir -p .%{gem_dir}
gem install \
	--local \
	--install-dir .%{gem_dir} \
	-V \
	--force \
	%{gem_name}-%{version}.gem

# Permission
find . -type f -print0 | xargs --null chmod go-w

%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
	%{buildroot}%{gem_dir}/


mkdir -p %{buildroot}%{_bindir}
pushd %{buildroot}
mv .%{gem_dir}/bin/* \
	./%{_bindir}/
rmdir .%{gem_dir}/bin
popd

find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x

%check
pushd .%{gem_instdir}

# Just see how it works for now
cat > debugger-gcd-test.rb <<EOF
#!/usr/bin/ruby

def gcd(a, b)
  if a > b
    a, b = [b, a]
  end

  if a == b or a == 1
    return a
  end

  return gcd(a, b-a)
end

a, b = ARGV[0..1].map{|arg| arg.to_i}
puts "The gcd of %i and %i is %i\n" % [a, b, gcd(a,b)]
EOF

cat -n debugger-gcd-test.rb
yes "p a ; p b ; s" | env PATH=$(pwd)/bin:$PATH \
	ruby -Icli -S rdebug ./debugger-gcd-test.rb 120 84

popd

%files
%dir	%{gem_instdir}
%doc	%{gem_instdir}/[A-Z]*

%{_bindir}/rdebug
%{gem_instdir}/bin/
%{gem_instdir}/cli/
%{gem_instdir}/rdbg.rb

%exclude	%{gem_cache}
%{gem_spec}

%files doc
%{gem_docdir}



%changelog

* Fri Feb 08 2013 fwang <fwang> 0.11.6-5.mga3
+ Revision: 396893
- rebuild for new rdoc

* Mon Jan 21 2013 fwang <fwang> 0.11.6-4.mga3
+ Revision: 390400
- cleanup spec

* Mon Jan 21 2013 dmorgan <dmorgan> 0.11.6-3.mga3
+ Revision: 390375
- imported package ruby-ruby-debug19