changeset 10:2047fa5d7dd7

Updated to Dec2016 and later releases; Ported RPM building to Fedora 27. BATnew + BATseqbase was replaced by COLnew. On Fedora 27, we need to add the -g option in order to get debug information, we also add the -O option.
author Sjoerd Mullender <sjoerd@acm.org>
date Thu, 07 Dec 2017 16:33:00 +0100 (2017-12-07)
parents dd4bb8b2a49d
children bbc6dff47679
files reverse/Makefile reverse/MonetDB-reverse.spec reverse/reverse.c
diffstat 3 files changed, 18 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/reverse/Makefile	Thu Sep 01 15:16:48 2016 +0200
+++ b/reverse/Makefile	Thu Dec 07 16:33:00 2017 +0100
@@ -4,12 +4,10 @@
 #
 # Copyright 2008-2016 MonetDB B.V.
 
-LIBDIR = `pkg-config --variable=libdir monetdb5`
+LIBDIR = $(shell pkg-config --variable=libdir monetdb5)
 
-CC = cc
-
-CFLAGS = `pkg-config --cflags monetdb5`
-LDFLAGS = `pkg-config --libs monetdb5`
+CFLAGS += $(shell pkg-config --cflags monetdb5)
+LDFLAGS += $(shell pkg-config --libs monetdb5)
 
 all: lib_reverse.so
 
@@ -35,6 +33,6 @@
 	cp 80_reverse.sql $(DESTDIR)$(LIBDIR)/monetdb5/createdb
 	cp 80_reverse.mal $(DESTDIR)$(LIBDIR)/monetdb5/autoload
 
-tar: MonetDB-reverse-1.0.tar.bz2
-MonetDB-reverse-1.0.tar.bz2: README.rst Makefile 80_reverse.mal reverse.mal 80_reverse.sql reverse.c
-	tar -cjf MonetDB-reverse-1.0.tar.bz2 --transform='s|^|MonetDB-reverse-1.0/|' README.rst Makefile 80_reverse.mal reverse.mal 80_reverse.sql reverse.c
+tar: MonetDB-reverse-1.1.tar.bz2
+MonetDB-reverse-1.1.tar.bz2: README.rst Makefile 80_reverse.mal reverse.mal 80_reverse.sql reverse.c
+	tar -cjf MonetDB-reverse-1.1.tar.bz2 --transform='s|^|MonetDB-reverse-1.1/|' README.rst Makefile 80_reverse.mal reverse.mal 80_reverse.sql reverse.c
--- a/reverse/MonetDB-reverse.spec	Thu Sep 01 15:16:48 2016 +0200
+++ b/reverse/MonetDB-reverse.spec	Thu Dec 07 16:33:00 2017 +0100
@@ -1,5 +1,5 @@
 Name:		MonetDB-reverse
-Version:	1.0
+Version:	1.1
 Release:	1%{?dist}
 Summary:	reverse UDF for MonetDB
 
@@ -7,8 +7,10 @@
 URL:		http://www.monetdb.org/
 Source0:	%{name}-%{version}.tar.bz2
 
-BuildRequires:	MonetDB5-server-devel
-Requires:	MonetDB-SQL-server5%{?_isa}
+BuildRequires:	MonetDB5-server-devel >= 11.25.1
+BuildRequires:	/usr/bin/rst2html
+BuildRequires:	/usr/bin/rst2pdf
+Requires:	MonetDB-SQL-server5%{?_isa} >= 11.25.1
 
 %description
 Simple example User-Defined Function (UDF) for MonetDB.
@@ -19,7 +21,8 @@
 
 
 %build
-make %{?_smp_mflags}
+export CFLAGS='-O -g'
+make %{?_smp_mflags} all doc
 
 
 %install
@@ -32,11 +35,14 @@
 
 
 %files
-%doc
+%doc README.*
 # do not include the directories, they are owned by MonetDB
 %{_libdir}/monetdb5/*.*
 %{_libdir}/monetdb5/*/*
 
 %changelog
+* Thu Dec  7 2017 Sjoerd Mullender <sjoerd@acm.org> - 1.1-1
+- Updated for the Dec2016 and later releases of MonetDB.
+
 * Tue Jun  7 2016 Sjoerd Mullender <sjoerd@acm.org>
 - Initial version.
--- a/reverse/reverse.c	Thu Sep 01 15:16:48 2016 +0200
+++ b/reverse/reverse.c	Thu Dec 07 16:33:00 2017 +0100
@@ -121,16 +121,13 @@
 	assert(b->ttype == TYPE_str);
 
 	/* allocate result BAT */
-	bn = BATnew(TYPE_void, TYPE_str, BATcount(b), TRANSIENT);
+	bn = COLnew(b->hseqbase, TYPE_str, BATcount(b), TRANSIENT);
 	if (bn == NULL) {
 		BBPunfix(b->batCacheid);
 		GDKfree(dst);
 		throw(MAL, "batreverse.reverse", MAL_MALLOC_FAIL);
 	}
 
-	/* copy seqbase from old to new */
-	BATseqbase(bn, b->hseqbase);
-
 	/* loop through BAT b; p is index of the entry we're working
 	 * on, q is used internally by BATloop to do the iterating */
 	bi = bat_iterator(b);