%define sname plruby
Summary: PostgreSQL Ruby Procedural Language
Name: postgresql-%{sname}
Version: 0.5.3
Release: 13%{?dist}
Source0: ftp://moulon.inra.fr/pub/ruby/%{sname}-%{version}.tar.gz
License: Ruby or GPL+
Group: Applications/Databases
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Url: http://raa.ruby-lang.org/project/pl-ruby/
BuildRequires: ruby >= 1.8 ruby-devel >= 1.8 postgresql-devel >= 8.1
Requires: postgresql-libs, ruby(release)
Patch0: postgresql-plruby-bitopers.patch
Patch1: postgresql-plruby-headers.patch
Patch2: postgresql-plruby-retval.patch
Patch3: postgresql-plruby-includes.patch
%description
PL/Ruby is a loadable procedural language for the PostgreSQL database
system that enable the Ruby language to create functions and trigger
procedures.
%package doc
Summary: Documentation for plruby
Group: Documentation
Requires: %{name} = %{version}-%{release}
%description doc
Documentation for plruby.
%prep
%setup -q -n %{sname}-%{version}
%patch0 -p1 -b .biopers
%patch1 -p1 -b .headers
%patch2 -p1 -b .retval
%patch3 -p1 -b .debug
unset FILE
for f in %{_includedir}/pg_config*.h
do
if grep -q PG_VERSION $f
then
FILE=`basename $f`
fi
done
if [ -n $FILE ]
then
%{__sed} -i.pgver -e "s|pg_config.h|${FILE}|" extconf.rb
fi
%build
ruby extconf.rb --vendor --with-pgsql-include=%{_includedir}/pgsql/server
CC="%{__cc} -I%{_includedir}/pgsql -I%{_includedir}/pgsql/server" make
%install
rm -rf %{buildroot}
# ruby_headers= applied as workaround for rhbz#921650.
make DESTDIR=%{buildroot} %{?_smp_mflags} ruby_headers= install
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc Changes README.en plruby.html
%dir %{ruby_vendorarchdir}/plruby
%{ruby_vendorarchdir}/plruby/plruby_*.so
%{ruby_vendorarchdir}/plruby.so
%files doc
%defattr(-,root,root,-)
%doc docs/plruby.rb
%changelog
* Thu Aug 08 2013 Pavel Raiskup <praiskup@redhat.com> - 0.5.3-13
- fix the build for armv7l (#992817)
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Mon Mar 25 2013 Vít Ondruch <vondruch@redhat.com> - 0.5.3-11
- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
* Tue Mar 5 2013 Honza Horak <hhorak@redhat.com> - 0.5.3-10
- Rebuild for ruby-2.0.0
* Tue Mar 5 2013 Honza Horak <hhorak@redhat.com> - 0.5.3-9
- Fix includes to avoid incomplete type errors
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Wed Mar 21 2012 Honza Horak <hhorak@redhat.com> - 0.5.3-6
- Packaging changes for new ruby-1.9
- Reflected a name change of and/or bit operand functions in Postgresql
- Included postgres.h
- Fixed return value of plruby_datum_get
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Mon Mar 3 2008 Devrim GUNDUZ <devrim@commandprompt.com> - 0.5.3-1
- Update to 0.5.3 to fix PostgreSQL 8.3 + GCC 4.3 problems. 0.5.2 had
a problem with PostgreSQL version detection, so author kindly released
0.5.3 for this issue.
* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.5.1-6.1
- Autorebuild for GCC 4.3
* Mon Jan 21 2008 - Devrim GUNDUZ <devrim@commandprompt.com> 0.5.1-5.1
- Rebuilt against PostgreSQL 8.3
* Mon Jan 14 2008 - Devrim GUNDUZ <devrim@commandprompt.com> 0.5.1-5
- Use a better BR line for postgresql-devel
* Sat Nov 30 2007 - Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> 0.5.1-4
- Make spec file actually compile
- Fix license tag
* Sat Oct 15 2007 - Devrim GUNDUZ <devrim@commandprompt.com> 0.5.1-3
- More fixes to spec file per bz review #246793
* Sat Oct 6 2007 - Devrim GUNDUZ <devrim@commandprompt.com> 0.5.1-2
- Updates to spec file per bz review #246793
* Fri Oct 5 2007 - Devrim GUNDUZ <devrim@commandprompt.com> 0.5.1-1
- Update to 0.5.1
* Tue Jul 17 2007 - Devrim GUNDUZ <devrim@commandprompt.com> 0.5.0-2
- Minor fixes to spec file.
* Wed Jul 4 2007 - Devrim GUNDUZ <devrim@commandprompt.com> 0.5.0-1
- Update to 0.5.0
* Sat Jun 16 2007 - Devrim GUNDUZ <devrim@commandprompt.com> 0.4.8-1
- Initial packaging for Fedora