%define rbindir  %(ruby -r rbconfig -e 'print Config::CONFIG["bindir"]')
%define rlibdir  %(ruby -r rbconfig -e 'print Config::CONFIG["rubylibdir"]')
%define rarchdir %(ruby -r rbconfig -e 'print Config::CONFIG["archdir"]')
%define rdatadir %(ruby -r rbconfig -e 'print Config::CONFIG["datadir"]')

Summary: Ruby reference manual referer
Summary(ja): Rubyのリファレンスマニュアルからメソッドを検索する
Name: refe
Version: 0.8.0
Release: 1%{?_dist_release}
License: distributable
Group: Development/Languages
Source: http://i.loveruby.net/archive/%{name}/%{name}-%{version}-withdocsrc.tar.gz
URL: http://www.loveruby.net/en/%{name}.html
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: ruby >= 1.8
Requires: ruby >= 1.8

%description
ReFe is a reference referer ('ri' clone). Difference is that ReFe extract
data from RD while ri uses XML. (Japanese reference manual is written in
RD.)

Currently ReFe supports only specific RD format e.g. canonical reference
manual.

%description -l ja
クラス名とメソッド名からRubyのリファレンスマニュアルのエントリを引くコマンド
ライン用のツールです。読み方は「りふぇ」です。

%prep
%setup -q

%build
ruby setup.rb config --rb-dir='$std-ruby'
ruby setup.rb setup

%install
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}%{rbindir}
mkdir -p ${RPM_BUILD_ROOT}%{rlibdir}
mkdir -p ${RPM_BUILD_ROOT}%{rdatadir}
ruby setup.rb install --prefix=${RPM_BUILD_ROOT}

%clean
rm -rf ${RPM_BUILD_ROOT}

%files
%defattr(-, root, root)
%{rbindir}/%{name}
%{rlibdir}/%{name}
%{rdatadir}/%{name}

%changelog
* Fri Oct 10 2008 Shu KONNO <owa@bg.wakwak.com> 0.8.0-1vl5
- applied new versioning policy, spec in utf-8

* Mon Dec 29 2003 akira yamada <akira@ruby-lang.org> 0.8.0-0vl1
- initial packaging.

