%define	oname	ruby-postgres
%define	over	0.7.1

Summary: PostgreSQL extension module for programming language Ruby
Name: postgresql-ruby
Version: %{over}
Release: 1%{?_dist_release}
License: distributable
Group: Development/Languages
Source: http://www.postgresql.jp/interfaces/ruby/%{oname}-%{over}.tar.gz
URL: http://www.jp.postgresql.org/interfaces/ruby/
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildPreReq: postgresql-devel, ruby, ruby-devel >= 1.8.1-0vl12
Summary(ja): Ruby用のPostgreSQL拡張モジュール

%description
This is the extension library to access a PostgreSQL database from Ruby.

%description -l ja
本ライブラリは、RubyからPostgreSQLへアクセスするための拡張ライブラリです。

%prep

%setup -q -c

%build
cd %{oname}-%{over}
ruby extconf.rb --with-pgsql-include-dir=%{_includedir}/pgsql
make
cd ..

%install
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}

# installing binaries ...
cd %{oname}-%{over}
make install DESTDIR=${RPM_BUILD_ROOT} sitedir=${RPM_BUILD_ROOT}%{_libdir}/ruby
cd ..

(find \
  $RPM_BUILD_ROOT%{_libdir} \
      -type f -o -type l) | 
 sort | sed -e "s,^$RPM_BUILD_ROOT,," > postgresql-ruby.files

%clean
rm -rf ${RPM_BUILD_ROOT}

%pre

%post

%files -f postgresql-ruby.files
%defattr(-, root, root)
%doc %{oname}-%{over}/ChangeLog
%doc %{oname}-%{over}/README
%doc %{oname}-%{over}/README.ja
%doc %{oname}-%{over}/doc/*.html
%doc %{oname}-%{over}/sample

%changelog
* Thu Sep 25 2008 Shu KONNO <owa@bg.wakwak.com> 0.7.1-1vl5
- applied new versioning policy, spec in utf-8

* Wed Dec 19 2007 Shu KONNO <owa@bg.wakwak.com> 0.7.1-0vl3
- s/Copyright/License/

* Tue Oct 05 2004 Satoshi MACHINO <machino@vinelinux.org> 0.7.1-0vl2
- fixed postgres.so's path

* Tue Oct 05 2004 Satoshi MACHINO <machino@vinelinux.org> 0.7.1-0vl1
- new upstream version (ruby-postgres-0.7.1)
- fixed search path for postgres.so in spec
- changed file name to README.ja
 
* Wed Jan 09 2002 Satoshi MACHINO <machino@vinelinux.org> 0.6.5-0vl1
- update ruby-postgres-0.6.5
- changed BuildPreReq from BuildRequire, and updated ruby version

* Thu Jul 26 2001 akira yamada <akira@vinelinux.org>
- rebuild with ruby-devel-1.6.4-0vl3.

* Mon Apr 23 2001 akira yamada <akira@vinelinux.org>
- new upstream version, 0.6.3.

* Mon Apr 23 2001 akira yamada <akira@vinelinux.org>
- Initial packaging.