%global gem_name ruby-debug-base19
%global rubyabi 1.9.1
%global repoid 75415
%global ruby_majorver 2.0
%global ruby_fullver 2.0.0-p0
Summary: Fast Ruby debugger - core component
Name: rubygem-%{gem_name}
Version: 0.11.26
Release: 7%{?dist}
Group: Development/Languages
# LICENSE
License: BSD
URL: http://rubyforge.org/projects/ruby-debug19/
# 0.11.25 on rubygems site doesn't work with ruby 1.9
#Source0: http://rubygems.org/gems/%%{gem_name}-%%{version}.gem
Source0: http://rubyforge.org/frs/download.php/%{repoid}/%{gem_name}-%{version}.gem
# ruby-debug-base uses headers in ruby tarball which are not installed
# by default...
Source1: ftp://ftp.ruby-lang.org/pub/ruby/%{ruby_majorver}/ruby-%{ruby_fullver}.tar.gz
Patch0: rubygem-ruby-debug-base19-0.11.26-dont_use_ruby_core_source.patch
# Kill gcc warning for -Wsequence-point
Patch1: rubygem-ruby-debug-base19-0.11.26-gcc47-undefined-behavior.patch
# ruby 2.0 patch
# From debugger 1.5.0 and https://github.com/cldwalker/debugger/pull/68
# and bit modified
# debugger 1.5.0 is under BSD
Patch2: rubygem-ruby-debug-base19-0.11.26-ruby20-from-debugger.patch
Requires: ruby(release)
Requires: ruby(rubygems)
Requires: rubygem(linecache19) >= 0.5.13
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby-devel
# %%check
BuildRequires: rubygem(linecache19)
BuildRequires: rubygem(minitest)
Provides: rubygem(%{gem_name}) = %{version}-%{release}
# Obsolete this, not providing
Obsoletes: rubygem-ruby-debug-base <= 0.10.5
%description
ruby-debug is a fast implementation of the standard Ruby debugger debug.rb.
It is implemented by utilizing a new Ruby C API hook. The core component
provides support that front-ends can build on. It provides breakpoint
handling, bindings for stack frames among other things.
%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
# Obsolete this, not providing
Obsoletes: rubygem-ruby-debug-base-doc <= 0.10.5
%description doc
Documentation for %{name}
%prep
%setup -q -c -T -a 1
# Gem repack
TOPDIR=$(pwd)
mkdir tmpunpackdir
pushd tmpunpackdir
gem unpack %{SOURCE0}
cd %{gem_name}-%{version}
# permission
find . -type f -print0 | xargs --null chmod 0644
# shebang
find ./lib -name \*.rb -print0 | \
xargs --null sed -i -e '\@^#!%{_bindir}@d'
# Kill ruby_core_source dependency - this is
# just to download ruby tarball
gem specification -l --ruby %{SOURCE0} | \
sed -e '\@columnize@d' -e '\@ruby_core_source@d' \
> %{gem_name}.gemspec
# Patch
%patch0 -p1
%patch1 -p1
%patch2 -p1
gem build %{gem_name}.gemspec
mv %{gem_name}-%{version}.gem $TOPDIR
popd
rm -rf tmpunpackdir
# Kill unneeeded ruby files
mkdir ruby_headers
# So the actual files needed are header files and
# inc file under
# ruby-%%ruby_fullver directory only
cp -p ruby-%{ruby_fullver}/{*.h,*.inc} ruby_headers/
rm -rf ruby-%{ruby_fullver}/
%build
export CONFIGURE_ARGS="--with-cflags=\"%{optflags} -I$(pwd)/ruby_headers\""
%gem_install
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
mkdir -p %{buildroot}%{gem_extdir_mri}/lib
mv \
%{buildroot}%{gem_instdir}/lib/ruby_debug.so \
%{buildroot}%{gem_extdir_mri}/lib/
# Remove the binary extension sources and build leftovers.
rm -rf %{buildroot}%{gem_instdir}/ext
%check
pushd .%{gem_instdir}
testrb -Ilib test/base/*.rb || echo "Please investigate this"
popd
%files
%dir %{gem_instdir}
%doc %{gem_instdir}/[A-Z]*
%exclude %{gem_instdir}/Rakefile
%{gem_libdir}
%dir %{gem_extdir_mri}
%dir %{gem_extdir_mri}/lib
%{gem_extdir_mri}/lib/ruby_debug.so
%exclude %{gem_cache}
%{gem_spec}
%files doc
%{gem_docdir}/
%exclude %{gem_instdir}/test/
%changelog
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.26-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.26-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Mar 28 2013 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.11.26-5
- F-19: rebuild for ruby 2.0.0
- Patch for ruby 2.0.0 from debugger 1.5.0
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.26-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Thu Oct 25 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 0.11.26-3
- Use latest ruby source
* Fri Sep 14 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 0.11.26-2
- A bit clean up
* Thu May 3 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 0.11.26-1
- Initial package