%global gitdate 20130225

Summary: rbenv plugin to compile and install ruby
SUmmary(ja): ruby をコンパイルしてインストールするrbenvプラグイン

Name: ruby-build
Version: 0.0.%{gitdate}
Release: 1%{?_dist_release}
License: MIT
Group: Development/Tools
URL: https://github.com/sstephenson/ruby-build
Source0: %{name}-%{version}.tar.xz
Source10: ree-1.8.7-build.patch
Source11: ruby-1.8.7-build.patch

Patch1: ruby-build-1.8.7-build-fix.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch: noarch
Requires: gcc
Requires: zlib-devel
Requires: readline-devel
Requires: openssl-devel

%description
ruby-build provides a simple way to compile and install 
different versions of Ruby on UNIX-like systems.
You can also use ruby-build without rbenv in environments 
where you need precise control over Ruby version installation.

%prep
%setup -q
%patch1 -p1

%build

%install
rm -rf %{buildroot}
PREFIX=%{buildroot}%{_prefix} ./install.sh
mkdir -p %{buildroot}%{_datadir}/rbenv/libexec
mv %{buildroot}%{_bindir}/rbenv-* %{buildroot}%{_datadir}/rbenv/libexec/

mkdir -p %{buildroot}%{_datadir}/%{name}/.patches
cp %{SOURCE10} %{buildroot}%{_datadir}/%{name}/.patches/
cp %{SOURCE11} %{buildroot}%{_datadir}/%{name}/.patches/

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc LICENSE README.md
%{_bindir}/ruby-build
%{_datadir}/rbenv/libexec/rbenv-install
%{_datadir}/rbenv/libexec/rbenv-uninstall
%{_datadir}/ruby-build

%changelog
* Mon Feb 25 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 0.0.20130225-1
- updae to upstream git master
  - add 1.9.3-p392, 2.0.0-p0, add 2.1.0-dev
- move rbenv-{install,uninstall} to %%_datadir/rbenv/libexec

* Mon Feb 11 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 0.0.20130208-1
- update to upstream git master
  - add 1.9.3-p385 and 2.0.0-rc2

* Mon Jan 21 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 0.0.20130118-1
- update to upstream git master
  - add 1.9.3-p374, 1.9.3-p362, 2.0.0-rc1, jruby-1.7.2

* Thu Dec 13 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.0.20121213-1
- update to upstream git master
  - add 2.0.0-preview2, 1.8.7-p371

* Wed Oct 24 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.0.20121111-1
- update to upstream git master
  - add 1.9.3-p327, 2.0.0-preview1, rbx-2.0.0-rc1

* Wed Oct 24 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.0.20121023-3
- move patches dir to .patches
- add source11 to fix build failure of ruby-1.8.7-*
- update patch1 to build all ruby/ree-1.8.7*

* Wed Oct 24 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.0.20121023-2
- add patch1, source10 to fix build failure of ree-1.8.7-2012.02

* Tue Oct 23 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.0.20121023-1
- update to upstream git master

* Fri Jun 29 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.0.20110914-1
- initial build for Vine Linux

