diff --git a/.gitignore b/.gitignore index 88903d4..bc97ac4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ plruby-0.5.3.tar.gz +/plruby-0.5.4.tar.bz2 diff --git a/postgresql-plruby-headers.patch b/postgresql-plruby-headers.patch deleted file mode 100644 index 599ba3d..0000000 --- a/postgresql-plruby-headers.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up plruby-0.5.3/src/plruby.h.debug plruby-0.5.3/src/plruby.h ---- plruby-0.5.3/src/plruby.h.debug 2007-12-26 16:58:02.000000000 +0100 -+++ plruby-0.5.3/src/plruby.h 2012-02-15 17:17:32.650551398 +0100 -@@ -2,6 +2,8 @@ - #include - #include - -+#include "postgres.h" -+ - #include "executor/spi.h" - #include "commands/trigger.h" - #include "utils/elog.h" diff --git a/postgresql-plruby-version.patch b/postgresql-plruby-version.patch new file mode 100644 index 0000000..178441f --- /dev/null +++ b/postgresql-plruby-version.patch @@ -0,0 +1,12 @@ +diff -up plruby-0.5.4/extconf.rb.version plruby-0.5.4/extconf.rb +--- plruby-0.5.4/extconf.rb.version 2014-04-28 10:32:23.290943486 +0200 ++++ plruby-0.5.4/extconf.rb 2014-04-28 10:32:59.968953807 +0200 +@@ -117,7 +117,7 @@ if have_func("rb_hash_delete", "ruby.h") + end + + case version_str = `#{pg_config} --version` +-when /^PostgreSQL ([7-9])\.([0-9])(\.[0-9])?$/ ++when /^PostgreSQL ([7-9])\.([0-9]{1,3})(\.[0-9]{1,3})?$/ + version = 10 * $1.to_i + $2.to_i + else + version = 0 diff --git a/postgresql-plruby.spec b/postgresql-plruby.spec index 9636647..e66e99c 100644 --- a/postgresql-plruby.spec +++ b/postgresql-plruby.spec @@ -1,21 +1,26 @@ -%define sname plruby +%if 0%{?rhel} <= 5 +%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"] ')} +%{!?ruby_vendorarchdir: %global ruby_vendorarchdir %ruby_sitearch} +%else +%{!?ruby_vendorarchdir: %global ruby_vendorarchdir %(ruby -rrbconfig -e 'puts Config::CONFIG["vendorarchdir"] ')} +%endif 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 +Name: postgresql-plruby +Version: 0.5.4 +Release: 1%{?dist} +Source0: https://github.com/knu/%{name}/archive/v0.5.4/%{name}-%{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/ +Url: https://github.com/knu/postgresql-plruby 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 +Patch4: postgresql-plruby-version.patch %description PL/Ruby is a loadable procedural language for the PostgreSQL database @@ -31,28 +36,18 @@ Requires: %{name} = %{version}-%{release} Documentation for plruby. %prep -%setup -q -n %{sname}-%{version} +%setup -q -n %{name}-%{version} + +%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 %patch0 -p1 -b .biopers -%patch1 -p1 -b .headers +%endif %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 +%patch4 -p1 -b .version %build -ruby extconf.rb --vendor --with-pgsql-include=%{_includedir}/pgsql/server -CC="%{__cc} -I%{_includedir}/pgsql -I%{_includedir}/pgsql/server" make +ruby extconf.rb --vendor +make %install rm -rf %{buildroot} @@ -74,6 +69,11 @@ rm -rf %{buildroot} %doc docs/plruby.rb %changelog +* Mon Apr 28 2014 Honza Horak - 0.5.4-1 +- Rebase to new upstream version 0.5.4 +- Change upstream URL + Resolves: #1091523 + * Thu Aug 08 2013 Pavel Raiskup - 0.5.3-13 - fix the build for armv7l (#992817) diff --git a/sources b/sources index 3889372..c5c07a1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9411bb29e1aa5521c5327e4d916de934 plruby-0.5.3.tar.gz +473891176b2cb24ca071955c7e0ff914 plruby-0.5.4.tar.bz2