From 3e1f281a821770022b5c16be4e5717c4171b3e77 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Oct 22 2018 11:16:02 +0000 Subject: new upstream and version Version: 0.5.7-1 --- diff --git a/.gitignore b/.gitignore index af508c5..33e948a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ -plruby-0.5.3.tar.gz -/plruby-0.5.4.tar.bz2 -/postgresql-plruby-0.5.4.tar.gz +/postgresql-plruby-*.tar.gz diff --git a/postgresql-plruby-0.5.4-ruby-2.4.patch b/postgresql-plruby-0.5.4-ruby-2.4.patch deleted file mode 100644 index 7541abe..0000000 --- a/postgresql-plruby-0.5.4-ruby-2.4.patch +++ /dev/null @@ -1,44 +0,0 @@ -fix for ruby 2.4 - ---- - src/conversions/basic/conversions.h | 8 ++++---- - src/conversions/basic/plruby_basic.c | 4 ++-- - 2 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/src/conversions/basic/conversions.h b/src/conversions/basic/conversions.h -index 4d6b58d..d8e4378 100644 ---- a/src/conversions/basic/conversions.h -+++ b/src/conversions/basic/conversions.h -@@ -2,10 +2,10 @@ - extern void plruby_require(char *); - - plruby_require("plruby/plruby_basic"); -- rb_hash_aset(plruby_classes, INT2NUM(OIDOID), rb_cFixnum); -- rb_hash_aset(plruby_classes, INT2NUM(INT2OID), rb_cFixnum); -- rb_hash_aset(plruby_classes, INT2NUM(INT4OID), rb_cFixnum); -- rb_hash_aset(plruby_classes, INT2NUM(INT8OID), rb_cFixnum); -+ rb_hash_aset(plruby_classes, INT2NUM(OIDOID), rb_cInteger); -+ rb_hash_aset(plruby_classes, INT2NUM(INT2OID), rb_cInteger); -+ rb_hash_aset(plruby_classes, INT2NUM(INT4OID), rb_cInteger); -+ rb_hash_aset(plruby_classes, INT2NUM(INT8OID), rb_cInteger); - - rb_hash_aset(plruby_classes, INT2NUM(FLOAT4OID), rb_cFloat); - rb_hash_aset(plruby_classes, INT2NUM(FLOAT8OID), rb_cFloat); -diff --git a/src/conversions/basic/plruby_basic.c b/src/conversions/basic/plruby_basic.c -index 2697224..2548be6 100644 ---- a/src/conversions/basic/plruby_basic.c -+++ b/src/conversions/basic/plruby_basic.c -@@ -346,8 +346,8 @@ void Init_plruby_basic() - id_to_i = rb_intern("to_i"); - id_usec = rb_intern("usec"); - -- rb_define_singleton_method(rb_cFixnum, "from_datum", pl_fixnum_s_datum, 1); -- rb_define_method(rb_cFixnum, "to_datum", pl_fixnum_to_datum, 1); -+ rb_define_singleton_method(rb_cInteger, "from_datum", pl_fixnum_s_datum, 1); -+ rb_define_method(rb_cInteger, "to_datum", pl_fixnum_to_datum, 1); - rb_define_singleton_method(rb_cFloat, "from_datum", pl_float_s_datum, 1); - rb_define_method(rb_cFloat, "to_datum", pl_float_to_datum, 1); - rb_define_singleton_method(rb_cString, "from_datum", pl_str_s_datum, 1); --- -2.9.3 - diff --git a/postgresql-plruby-0.5.7-pg11.patch b/postgresql-plruby-0.5.7-pg11.patch new file mode 100644 index 0000000..67623a2 --- /dev/null +++ b/postgresql-plruby-0.5.7-pg11.patch @@ -0,0 +1,194 @@ +From 590c92eeb80ad63c34525a3d89f9593beec4fdaf Mon Sep 17 00:00:00 2001 +From: Pavel Raiskup +Date: Mon, 22 Oct 2018 13:02:17 +0200 +Subject: [PATCH] Compat with PGv11 after upstream commit 726117243022178 + +--- + src/plpl.c | 42 +++++++++++++++++++++++------------------- + src/plruby.c | 25 ++++++++++++++----------- + 2 files changed, 37 insertions(+), 30 deletions(-) + +diff --git a/src/plpl.c b/src/plpl.c +index 5edabfd..6a1bda8 100644 +--- a/src/plpl.c ++++ b/src/plpl.c +@@ -137,11 +137,12 @@ pl_query_name(VALUE obj) + } + res = rb_ary_new2(tpl->dsc->natts); + for (i = 0; i < tpl->dsc->natts; i++) { +- if (tpl->dsc->attrs[i]->attisdropped) { ++ Form_pg_attribute attr = TupleDescAttr(tpl->dsc, i); ++ if (attr->attisdropped) { + attname = ""; + } + else { +- attname = NameStr(tpl->dsc->attrs[i]->attname); ++ attname = NameStr(attr->attname); + } + rb_ary_push(res, rb_tainted_str_new2(attname)); + } +@@ -178,16 +179,17 @@ pl_query_type(VALUE obj) + } + res = rb_ary_new2(tpl->dsc->natts); + for (i = 0; i < tpl->dsc->natts; i++) { +- if (tpl->dsc->attrs[i]->attisdropped) ++ Form_pg_attribute attr = TupleDescAttr(tpl->dsc, i); ++ if (attr->attisdropped) + continue; + PLRUBY_BEGIN(1); +- attname = NameStr(tpl->dsc->attrs[i]->attname); +- typeTup = SearchSysCache(TYPEOID, OidGD(tpl->dsc->attrs[i]->atttypid), ++ attname = NameStr(attr->attname); ++ typeTup = SearchSysCache(TYPEOID, OidGD(attr->atttypid), + 0, 0, 0); + PLRUBY_END; + if (!HeapTupleIsValid(typeTup)) { + rb_raise(pl_ePLruby, "Cache lookup for attribute '%s' type %ld failed", +- attname, OidGD(tpl->dsc->attrs[i]->atttypid)); ++ attname, OidGD(attr->atttypid)); + } + fpgt = (Form_pg_type) GETSTRUCT(typeTup); + rb_ary_push(res, rb_tainted_str_new2(NameStr(fpgt->typname))); +@@ -587,15 +589,16 @@ pl_tuple_heap(VALUE c, VALUE tuple) + nulls = ALLOCA_N(char, RARRAY_LEN(c)); + MEMZERO(nulls, char, RARRAY_LEN(c)); + for (i = 0; i < RARRAY_LEN(c); i++) { ++ Form_pg_attribute attr = TupleDescAttr(tupdesc, i); + if (NIL_P(RARRAY_PTR(c)[i]) || +- tupdesc->attrs[i]->attisdropped) { ++ attr->attisdropped) { + dvalues[i] = (Datum)0; + nulls[i] = 'n'; + } + else { + nulls[i] = ' '; +- typid = tupdesc->attrs[i]->atttypid; +- if (tupdesc->attrs[i]->attndims != 0 || ++ typid = attr->atttypid; ++ if (attr->attndims != 0 || + tpl->att->attinfuncs[i].fn_addr == (PGFunction)array_in) { + pl_proc_desc prodesc; + FmgrInfo func; +@@ -1088,18 +1091,19 @@ plruby_build_tuple(HeapTuple tuple, TupleDesc tupdesc, int type_ret) + } + + for (i = 0; i < tupdesc->natts; i++) { +- if (tupdesc->attrs[i]->attisdropped) ++ Form_pg_attribute pgattr = TupleDescAttr(tupdesc, i); ++ if (pgattr->attisdropped) + continue; + PLRUBY_BEGIN(1); +- attname = NameStr(tupdesc->attrs[i]->attname); ++ attname = NameStr(pgattr->attname); + attr = heap_getattr(tuple, i + 1, tupdesc, &isnull); +- typeTup = SearchSysCache(TYPEOID, OidGD(tupdesc->attrs[i]->atttypid), ++ typeTup = SearchSysCache(TYPEOID, OidGD(pgattr->atttypid), + 0, 0, 0); + PLRUBY_END; + + if (!HeapTupleIsValid(typeTup)) { + rb_raise(pl_ePLruby, "Cache lookup for attribute '%s' type %ld failed", +- attname, OidGD(tupdesc->attrs[i]->atttypid)); ++ attname, OidGD(pgattr->atttypid)); + } + + fpgt = (Form_pg_type) GETSTRUCT(typeTup); +@@ -1115,18 +1119,18 @@ plruby_build_tuple(HeapTuple tuple, TupleDesc tupdesc, int type_ret) + int alen; + + typname = NameStr(fpgt->typname); +- alen = tupdesc->attrs[i]->attlen; +- typeid = tupdesc->attrs[i]->atttypid; ++ alen = pgattr->attlen; ++ typeid = pgattr->atttypid; + if (strcmp(typname, "text") == 0) { + alen = -1; + } + else if (strcmp(typname, "bpchar") == 0 || + strcmp(typname, "varchar") == 0) { +- if (tupdesc->attrs[i]->atttypmod == -1) { ++ if (pgattr->atttypmod == -1) { + alen = 0; + } + else { +- alen = tupdesc->attrs[i]->atttypmod - 4; ++ alen = pgattr->atttypmod - 4; + } + } + if ((type_ret & RET_DESC_ARR) == RET_DESC_ARR) { +@@ -1190,8 +1194,8 @@ plruby_build_tuple(HeapTuple tuple, TupleDesc tupdesc, int type_ret) + + fmgr_info(typoutput, &finfo); + +- s = pl_convert_arg(attr, tupdesc->attrs[i]->atttypid, +- &finfo, typelem,tupdesc->attrs[i]->attlen); ++ s = pl_convert_arg(attr, pgattr->atttypid, ++ &finfo, typelem, pgattr->attlen); + } + PLRUBY_END_PROTECT; + +diff --git a/src/plruby.c b/src/plruby.c +index 91b83cd..337c025 100644 +--- a/src/plruby.c ++++ b/src/plruby.c +@@ -1184,17 +1184,19 @@ for_numvals(obj, argobj) + rb_raise(pl_ePLruby, "invalid attribute '%s'", RSTRING_PTR(key)); + } + attnum -= 1; +- if (arg->tupdesc->attrs[attnum]->attisdropped) { ++ ++ Form_pg_attribute attr = TupleDescAttr(arg->tupdesc, attnum); ++ if (attr->attisdropped) { + return Qnil; + } + + PLRUBY_BEGIN(1); + typeTup = SearchSysCache(TYPEOID, +- OidGD(arg->tupdesc->attrs[attnum]->atttypid), ++ OidGD(attr->atttypid), + 0, 0, 0); + if (!HeapTupleIsValid(typeTup)) { + rb_raise(pl_ePLruby, "Cache lookup for attribute '%s' type %ld failed", +- RSTRING_PTR(key), OidGD(arg->tupdesc->attrs[attnum]->atttypid)); ++ RSTRING_PTR(key), OidGD(attr->atttypid)); + } + fpg = (Form_pg_type) GETSTRUCT(typeTup); + ReleaseSysCache(typeTup); +@@ -1224,13 +1226,13 @@ for_numvals(obj, argobj) + arg->modvalues[attnum] = plruby_return_array(value, &prodesc); + } + else { +- arg->modvalues[attnum] = +- plruby_to_datum(value, &finfo, +- arg->tupdesc->attrs[attnum]->atttypid, ++ arg->modvalues[attnum] = ++ plruby_to_datum(value, &finfo, ++ attr->atttypid, + fpg->typelem, +- (!VARLENA_FIXED_SIZE(arg->tupdesc->attrs[attnum])) +- ? arg->tupdesc->attrs[attnum]->attlen +- : arg->tupdesc->attrs[attnum]->atttypmod); ++ (!VARLENA_FIXED_SIZE(attr)) ++ ? attr->attlen ++ : attr->atttypmod); + } + return Qnil; + } +@@ -1284,11 +1286,12 @@ pl_trigger_handler(struct pl_thread_st *plth) + + tmp = rb_ary_new2(tupdesc->natts); + for (i = 0; i < tupdesc->natts; i++) { +- if (tupdesc->attrs[i]->attisdropped) { ++ Form_pg_attribute attr = TupleDescAttr(tupdesc, i); ++ if (attr->attisdropped) { + rb_ary_push(tmp, rb_str_freeze_new2("")); + } + else { +- rb_ary_push(tmp, rb_str_freeze_new2(NameStr(tupdesc->attrs[i]->attname))); ++ rb_ary_push(tmp, rb_str_freeze_new2(NameStr(attr->attname))); + } + } + rb_hash_aset(TG, rb_str_freeze_new2("relatts"), rb_ary_freeze(tmp)); +-- +2.17.2 + diff --git a/postgresql-plruby-bitopers.patch b/postgresql-plruby-bitopers.patch deleted file mode 100644 index 095a369..0000000 --- a/postgresql-plruby-bitopers.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -up plruby-0.5.3/src/conversions/bitstring/plruby_bitstring.c.debug plruby-0.5.3/src/conversions/bitstring/plruby_bitstring.c ---- plruby-0.5.3/src/conversions/bitstring/plruby_bitstring.c.debug 2007-12-26 11:26:13.000000000 +0100 -+++ plruby-0.5.3/src/conversions/bitstring/plruby_bitstring.c 2012-02-15 17:16:50.098551806 +0100 -@@ -195,8 +195,8 @@ name_(VALUE obj, VALUE a) - } - - BIT_OPERATOR(pl_bit_add, bitcat); --BIT_OPERATOR(pl_bit_and, bitand); --BIT_OPERATOR(pl_bit_or, bitor); -+BIT_OPERATOR(pl_bit_and, bit_and); -+BIT_OPERATOR(pl_bit_or, bit_or); - BIT_OPERATOR(pl_bit_xor, bitxor); - - static VALUE -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 -@@ -316,4 +318,15 @@ extern VALUE plruby_define_void_class _( - #define CStringGD(a_) CStringGetDatum(a_) - #define TupleGD(a_,b_) TupleGetDatum((a_),(b_)) - -+// PostgreSQL 9.1.1 has renamed C functions bitor and bitand to bit_or -+// and bit_and, because the former names conflicted with C++ keywords. -+// The following aliases will fix this if needed. -+ -+#if !defined(bit_and) && defined(bitand) -+#define bit_and(a_) bitand(a_) -+#endif -+ -+#if !defined(bit_or) && defined(bitor) -+#define bit_or(a_) bitor(a_) -+#endif - diff --git a/postgresql-plruby-includes.patch b/postgresql-plruby-includes.patch deleted file mode 100644 index f2e9e6b..0000000 --- a/postgresql-plruby-includes.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 2013-03-05 12:43:39.107105360 +0100 -+++ plruby-0.5.3/src/plruby.h 2013-03-05 12:46:11.769101158 +0100 -@@ -8,6 +8,8 @@ - #include "commands/trigger.h" - #include "utils/elog.h" - #include "utils/builtins.h" -+#include "utils/rel.h" -+#include "utils/relcache.h" - #include "fmgr.h" - #include "access/heapam.h" - diff --git a/postgresql-plruby-retval.patch b/postgresql-plruby-retval.patch deleted file mode 100644 index 27fb431..0000000 --- a/postgresql-plruby-retval.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up plruby-0.5.3/src/plruby.h.retval plruby-0.5.3/src/plruby.h ---- plruby-0.5.3/src/plruby.h.retval 2012-02-15 17:35:06.035541372 +0100 -+++ plruby-0.5.3/src/plruby.h 2012-02-15 17:35:15.346541265 +0100 -@@ -304,7 +304,7 @@ extern Datum plruby_dfc3 _((PGFunction, - extern VALUE plruby_classes, plruby_conversions; - extern Oid plruby_datum_oid _((VALUE, int *)); - extern VALUE plruby_datum_set _((VALUE, Datum)); --extern VALUE plruby_datum_get _((VALUE, Oid *)); -+extern Datum plruby_datum_get _((VALUE, Oid *)); - extern VALUE plruby_define_void_class _((char *, char *)); - #endif - diff --git a/postgresql-plruby-ruby22-rbconfig.patch b/postgresql-plruby-ruby22-rbconfig.patch deleted file mode 100644 index c4f596b..0000000 --- a/postgresql-plruby-ruby22-rbconfig.patch +++ /dev/null @@ -1,139 +0,0 @@ ---- postgresql-plruby-0.5.4/extconf.rb.rbconfig 2015-01-17 02:16:39.379409665 +0900 -+++ postgresql-plruby-0.5.4/extconf.rb 2015-01-17 02:21:42.793184523 +0900 -@@ -52,7 +52,7 @@ - - - create function plruby#{suffix}_call_handler() returns #{opaque} -- as '#{Config::CONFIG["sitearchdir"]}/plruby#{suffix}.#{CONFIG["DLEXT"]}' -+ as '#{RbConfig::CONFIG["sitearchdir"]}/plruby#{suffix}.#{RbConfig::CONFIG["DLEXT"]}' - language '#{language}'; - - create #{trusted} language 'plruby#{suffix}' -@@ -190,7 +190,7 @@ - orig_argv << "--with-cflags='#$CFLAGS -I.. -I ../..'" - orig_argv << "--with-ldflags='#$LDFLAGS'" - orig_argv << "--with-cppflags='#$CPPFLAGS'" -- cmd = "#{CONFIG['RUBY_INSTALL_NAME']} extconf.rb #{orig_argv.join(' ')}" -+ cmd = "#{RbConfig::CONFIG['RUBY_INSTALL_NAME']} extconf.rb #{orig_argv.join(' ')}" - system("cd #{key}; #{cmd}") - end - -@@ -198,13 +198,13 @@ - - begin - Dir.chdir("src") -- if CONFIG["ENABLE_SHARED"] == "no" -- libs = if CONFIG.key?("LIBRUBYARG_STATIC") -- Config::expand(CONFIG["LIBRUBYARG_STATIC"].dup).sub(/^-l/, '') -+ if RbConfig::CONFIG["ENABLE_SHARED"] == "no" -+ libs = if RbConfig::CONFIG.key?("LIBRUBYARG_STATIC") -+ RbConfig::expand(RbConfig::CONFIG["LIBRUBYARG_STATIC"].dup).sub(/^-l/, '') - else -- Config::expand(CONFIG["LIBRUBYARG"].dup).sub(/lib([^.]*).*/, '\\1') -+ RbConfig::expand(RbConfig::CONFIG["LIBRUBYARG"].dup).sub(/lib([^.]*).*/, '\\1') - end -- find_library(libs, "ruby_init", Config::expand(CONFIG["archdir"].dup)) -+ find_library(libs, "ruby_init", RbConfig::expand(RbConfig::CONFIG["archdir"].dup)) - end - $objs = ["plruby.o", "plplan.o", "plpl.o", "pltrans.o"] unless $objs - create_makefile("plruby#{suffix}") ---- postgresql-plruby-0.5.4/src/conversions/basic/extconf.rb.rbconfig 2010-01-02 04:08:20.000000000 +0900 -+++ postgresql-plruby-0.5.4/src/conversions/basic/extconf.rb 2015-01-17 02:23:20.917758514 +0900 -@@ -1,4 +1,5 @@ - require 'mkmf' -+include RbConfig - - if CONFIG["LIBRUBYARG"] == "$(LIBRUBYARG_SHARED)" && - !enable_config("plruby-shared") ---- postgresql-plruby-0.5.4/src/conversions/bitstring/extconf.rb.rbconfig 2010-01-02 04:08:20.000000000 +0900 -+++ postgresql-plruby-0.5.4/src/conversions/bitstring/extconf.rb 2015-01-17 02:22:31.577469892 +0900 -@@ -1,4 +1,5 @@ - require 'mkmf' -+include RbConfig - - if CONFIG["LIBRUBYARG"] == "$(LIBRUBYARG_SHARED)" && - !enable_config("plruby-shared") ---- postgresql-plruby-0.5.4/src/conversions/datetime/extconf.rb.rbconfig 2010-01-02 04:08:20.000000000 +0900 -+++ postgresql-plruby-0.5.4/src/conversions/datetime/extconf.rb 2015-01-17 02:17:36.850745851 +0900 -@@ -1,4 +1,5 @@ - require 'mkmf' -+include RbConfig - - if CONFIG["LIBRUBYARG"] == "$(LIBRUBYARG_SHARED)" && - !enable_config("plruby-shared") ---- postgresql-plruby-0.5.4/src/conversions/geometry/extconf.rb.rbconfig 2010-01-02 04:08:20.000000000 +0900 -+++ postgresql-plruby-0.5.4/src/conversions/geometry/extconf.rb 2015-01-17 02:23:24.909781866 +0900 -@@ -1,4 +1,5 @@ - require 'mkmf' -+include RbConfig - - if CONFIG["LIBRUBYARG"] == "$(LIBRUBYARG_SHARED)" && - !enable_config("plruby-shared") ---- postgresql-plruby-0.5.4/src/conversions/network/extconf.rb.rbconfig 2010-01-02 04:08:20.000000000 +0900 -+++ postgresql-plruby-0.5.4/src/conversions/network/extconf.rb 2015-01-17 02:22:27.388445388 +0900 -@@ -1,4 +1,5 @@ - require 'mkmf' -+include RbConfig - - if CONFIG["LIBRUBYARG"] == "$(LIBRUBYARG_SHARED)" && - !enable_config("plruby-shared") ---- postgresql-plruby-0.5.4/test/conv_bitstring/b.rb.rbconfig 2010-01-02 04:08:20.000000000 +0900 -+++ postgresql-plruby-0.5.4/test/conv_bitstring/b.rb 2015-01-17 02:23:30.873816754 +0900 -@@ -1,6 +1,6 @@ - #!/usr/bin/ruby - require 'rbconfig' --include Config -+include RbConfig - pwd = Dir.pwd - pwd.sub!(%r{[^/]+/[^/]+$}, "") - ---- postgresql-plruby-0.5.4/test/conv_geometry/b.rb.rbconfig 2010-01-02 04:08:20.000000000 +0900 -+++ postgresql-plruby-0.5.4/test/conv_geometry/b.rb 2015-01-17 02:24:13.731067453 +0900 -@@ -1,6 +1,6 @@ - #!/usr/bin/ruby - require 'rbconfig' --include Config -+include RbConfig - pwd = Dir.pwd - pwd.sub!(%r{[^/]+/[^/]+$}, "") - ---- postgresql-plruby-0.5.4/test/conv_network/b.rb.rbconfig 2010-01-02 04:08:20.000000000 +0900 -+++ postgresql-plruby-0.5.4/test/conv_network/b.rb 2015-01-17 02:24:09.054040094 +0900 -@@ -1,6 +1,6 @@ - #!/usr/bin/ruby - require 'rbconfig' --include Config -+include RbConfig - pwd = Dir.pwd - pwd.sub!(%r{[^/]+/[^/]+$}, "") - ---- postgresql-plruby-0.5.4/test/plp/b.rb.rbconfig 2010-01-02 04:08:20.000000000 +0900 -+++ postgresql-plruby-0.5.4/test/plp/b.rb 2015-01-17 02:23:52.894945569 +0900 -@@ -1,6 +1,6 @@ - #!/usr/bin/ruby - require 'rbconfig' --include Config -+include RbConfig - pwd = Dir.pwd - pwd.sub!(%r{[^/]+/[^/]+$}, "") - ---- postgresql-plruby-0.5.4/test/plt/b.rb.rbconfig 2010-01-02 04:08:20.000000000 +0900 -+++ postgresql-plruby-0.5.4/test/plt/b.rb 2015-01-17 02:24:03.033004873 +0900 -@@ -1,6 +1,6 @@ - #!/usr/bin/ruby - require 'rbconfig' --include Config -+include RbConfig - pwd = Dir.pwd - pwd.sub!(%r{[^/]+/[^/]+$}, "") - ---- postgresql-plruby-0.5.4/test/range/b.rb.rbconfig 2010-01-02 04:08:20.000000000 +0900 -+++ postgresql-plruby-0.5.4/test/range/b.rb 2015-01-17 02:24:20.178105166 +0900 -@@ -1,6 +1,6 @@ - #!/usr/bin/ruby - require 'rbconfig' --include Config -+include RbConfig - pwd = Dir.pwd - pwd.sub!(%r{[^/]+/[^/]+$}, "") - diff --git a/postgresql-plruby-version.patch b/postgresql-plruby-version.patch deleted file mode 100644 index 178441f..0000000 --- a/postgresql-plruby-version.patch +++ /dev/null @@ -1,12 +0,0 @@ -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 c754d6a..9ab9107 100644 --- a/postgresql-plruby.spec +++ b/postgresql-plruby.spec @@ -7,25 +7,19 @@ Summary: PostgreSQL Ruby Procedural Language Name: postgresql-plruby -Version: 0.5.4 -Release: 22%{?dist} -Source0: https://github.com/knu/%{name}/archive/v0.5.4/%{name}-%{version}.tar.gz +Version: 0.5.7 +Release: 1%{?dist} +Source0: https://github.com/devrimgunduz/%name/archive/%version/%name-%version.tar.gz License: Ruby or GPL+ Group: Applications/Databases -Url: https://github.com/knu/postgresql-plruby +Url: https://github.com/devrimgunduz/postgresql-plruby Requires: ruby(release) %{?postgresql_module_requires} BuildRequires: gcc BuildRequires: ruby >= 1.8 ruby-devel >= 1.8 postgresql-server-devel -Patch0: postgresql-plruby-bitopers.patch -Patch2: postgresql-plruby-retval.patch -Patch3: postgresql-plruby-includes.patch -Patch4: postgresql-plruby-version.patch -Patch5: postgresql-plruby-ruby22-rbconfig.patch -# See ruby commit 5bddb944926aadea6f4a7cda25a0053593153652 -Patch6: postgresql-plruby-0.5.4-ruby-2.4.patch +Patch1: postgresql-plruby-0.5.7-pg11.patch Patch7: postgresql-plruby-0.5.4-pg-10-version-check.patch %description @@ -42,19 +36,14 @@ Requires: %{name} = %{version}-%{release} Documentation for plruby. %prep -%setup -q -n %{name}-%{version} - -%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 -%patch0 -p1 -b .biopers -%endif -%patch2 -p1 -b .retval -%patch3 -p1 -b .debug -%patch4 -p1 -b .version -%patch5 -p1 -b .rbconfig -%patch6 -p1 -b .ruby-2.4-constants -%patch7 -p1 -b .pg-10-versioncheck +%autosetup -n %{name}-%{version} -p1 %build +%if 0%{?fedora} > 29 || 0%{?rhel} > 7 +%global pg_config %_bindir/pg_server_config +%else +%global pg_config %_bindir/pg_config +%endif ## Using safe-level=3, since Ruby 2.1+ and later does not support safe level ## bigger than 3. ## https://bugs.ruby-lang.org/issues/8468 @@ -65,7 +54,7 @@ Documentation for plruby. # bigger than 1. # https://github.com/ruby/ruby/blob/v2_3_0/NEWS#L323 ruby extconf.rb --vendor --with-safe-level=1 \ - --with-pg-config=%_bindir/pg_server_config + --with-pg-config=%pg_config make %install @@ -74,7 +63,7 @@ rm -rf %{buildroot} make DESTDIR=%{buildroot} %{?_smp_mflags} ruby_headers= install %files -%doc Changes README.en plruby.html +%doc Changes README.markdown plruby.html %dir %{ruby_vendorarchdir}/plruby %{ruby_vendorarchdir}/plruby/plruby_*.so %{ruby_vendorarchdir}/plruby.so @@ -83,6 +72,9 @@ make DESTDIR=%{buildroot} %{?_smp_mflags} ruby_headers= install %doc docs/plruby.rb %changelog +* Mon Oct 22 2018 Pavel Raiskup - 0.5.7-1 +- switch to new upstream and rebase + * Wed Sep 05 2018 Pavel Raiskup - 0.5.4-22 - rebuild against postgresql-server-devel (rhbz#1618698) diff --git a/sources b/sources index f3a2fdc..e4aec21 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d9c64b30065d38a074f92d28ac421a50 postgresql-plruby-0.5.4.tar.gz +SHA512 (postgresql-plruby-0.5.7.tar.gz) = bde250aa3858d1e6ad9997fedbdfeac6e894f5336c7bfdebf48adf66b614bfb33b500e88a3e2c520538ec67fcbd139cf2cc159585e4a6039e759f4c9217e534b