File rubyspec.spec of Package rubyspec

#
# spec file for package rubyspec (Version 0.5.0)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define gitcommit 4cfa728065939af5cb5757267bc5d8a9fa9ec564
%if 0%{suse_version} >= 1030
%define use_fdupes 1
%endif

Name:           rubyspec
Version:        0.6.0
Release:        0
Group:          Development/Languages/Ruby
License:        X11/MIT
#
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  rubygem-mspec >= 1.5.0
BuildRequires:  ruby-test-suite
BuildRequires:  ruby-examples
%if 0%{?use_fdupes}
BuildRequires:   fdupes
%endif
# OBS builds on all arches even if noarch is specified
# so we get full test coverage
BuildArch:	noarch
Requires:       rubygem-mspec >= 1.5.0
Requires:	ruby(abi) = %{rb_ver}
Requires:	ruby-test-suite ruby-examples
Url:            http://rubyspec.org/
Source0:        http://github.com/rubyspec/rubyspec/tarball/master/rubyspec-%{name}-%{gitcommit}.tar.gz
Source1:	testruby.sh.in
#
Summary:        A complete, executable specification for the Ruby programming language

%description
RubySpec is a community-driven project to create an executable specification (RSpec compatible) for the Ruby programming language, core libraries and standard libraries.

Authors:
--------
    Brian Ford

%prep
%setup -q -n rubyspec-%{name}-%{gitcommit}
find -name .gitignore -print0 | xargs -0 rm
find -type f -perm /111 -print0 | xargs -0 chmod -v a-x

%build
# Check for correct test version
[ -d %{rb_ver} ]

%install
%{__mkdir} -p %{buildroot}%{_datadir}/rubyspec
cp -a *.rb %{rb_ver} %{buildroot}%{_datadir}/rubyspec
%{__mkdir} -p %{buildroot}%{_bindir}
sed -e 's|@DOCDIR@|%{_docdir}|g;s|@DATADIR@|%{_datadir}|g' <%{SOURCE1} >%{buildroot}%{_bindir}/testruby
chmod a+x %{buildroot}%{_bindir}/*

%if 0%{?use_fdupes}
%fdupes %{buildroot}
%endif

%clean
%{__rm} -rf %{buildroot}

%check
# Basic ruby tests
sed -e 's@\./miniruby@ruby@g' %{_docdir}/ruby/examples/test.rb > test.rb
chmod a+x test.rb
./test.rb
rm test.rb
# Does the test unit framework function?
ruby -C %{_docdir}/ruby/examples/testunit ts_examples.rb
# Ruby internal test suite
# Internal suite assumes it can write to the tests, or at least the directory
# Internal readline suite needs a plain (e.g. vt100) terminal to pass
%{__cp} -a %{_docdir}/ruby-test-suite/test . 
# Keep this one with || : until the collision on 64-bit is fixed
TERM=vt100 ruby ./test/runner.rb --basedir=./test --runner=console || :
%{__rm} -rf ./test
# rubyspec tests
# The process kill test will send a hangup unless we pipe it to 
# something else (hangup ends the rpmbuild process)
mspec -t r -V %{rb_ver}/core | cat
mspec -t r -V %{rb_ver}/language
mspec -t r -V %{rb_ver}/library || :

%files
%defattr(-,root,root,-)
%doc LICENSE
%{_bindir}/*
%{_datadir}/rubyspec

%changelog
* Sun Aug 10 2008 pzb@novell.com
- New snapshot
- Fix testruby script
- Fix hangup during %check
* Fri Aug 8 2008 pzb@novell.com
- New snapshot
- Add testruby command
* Fri Aug 1 2008 pzb@novell.com
- New package
openSUSE Build Service is sponsored by