[packages/lua-dbi] Initial commit

aredridel aredridel at pld-linux.org
Sat Feb 8 04:51:32 CET 2014


commit d25e69cced2319e26c8275ed8452b764a33df2bf
Author: Aria Stewart <aredridel at nbtsc.org>
Date:   Fri Feb 7 20:47:42 2014 -0700

    Initial commit

 lua-dbi-0.5-pgsql_transaction.patch | 27 +++++++++++++++++++
 lua-dbi.spec                        | 54 +++++++++++++++++++++++++++++++++++++
 2 files changed, 81 insertions(+)
---
diff --git a/lua-dbi.spec b/lua-dbi.spec
new file mode 100644
index 0000000..b93e6f2
--- /dev/null
+++ b/lua-dbi.spec
@@ -0,0 +1,54 @@
+%define luaver 5.1
+%define lualibdir %{_libdir}/lua/%{luaver}
+%define luapkgdir %{_datadir}/lua/%{luaver}
+
+Summary:	Database interface library for Lua
+Name:		lua-dbi
+Version:	0.5
+Release:	1
+License:	MIT
+Group:		Development/Libraries
+URL:		http://code.google.com/p/luadbi
+Source0:	http://luadbi.googlecode.com/files/luadbi.%{version}.tar.gz
+Patch1:		%{name}-0.5-pgsql_transaction.patch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+BuildRequires:	lua51-devel
+BuildRequires:	mysql-devel
+BuildRequires:	postgresql-devel
+BuildRequires:  postgresql-backend-devel
+BuildRequires:	sqlite3-devel
+
+%description
+LuaDBI is a database interface library for Lua. It is designed to
+provide a RDBMS agnostic API for handling database operations. LuaDBI
+also provides support for prepared statement handles, placeholders and
+bind parameters for all database operations.
+
+Currently LuaDBI supports DB2, Oracle, MySQL, PostgreSQL and SQLite
+databases with native database drivers.
+
+%prep
+%setup -q -c
+%patch1 -p1
+find . -name \*.[ch] -print -exec chmod -x '{}' \;
+sed -i -e '1d' DBI.lua
+
+%build
+%{__make} LIBDIR="%{_libdir}" CFLAGS="$RPM_OPT_FLAGS -fPIC -I/usr/include/lua51 -I. -I/usr/include/mysql/ -I/usr/include/postgresql/internal/ -I/usr/include/postgresql/server/" COMMON_LDFLAGS="-llua51 -shared"
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{luapkgdir}
+install -d $RPM_BUILD_ROOT%{lualibdir}
+
+cp -p *.so $RPM_BUILD_ROOT%{lualibdir}
+cp -p *.lua $RPM_BUILD_ROOT%{luapkgdir}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc README COPYING
+%{lualibdir}/*.so
+%{luapkgdir}/*.lua
diff --git a/lua-dbi-0.5-pgsql_transaction.patch b/lua-dbi-0.5-pgsql_transaction.patch
new file mode 100644
index 0000000..877c36a
--- /dev/null
+++ b/lua-dbi-0.5-pgsql_transaction.patch
@@ -0,0 +1,27 @@
+Make calling autocommit with the same value as set a NOOP to suppress the warning
+
+  WARNING:  there is already a transaction in progress
+
+from the PostgreSQL database (e.g. in prosody or prosodyctl). See also upstream commit:
+
+https://code.google.com/p/luadbi/source/detail?r=aab3ed7d93fe9b10b75e302c787737999a8b4a5f
+
+--- lua-dbi-0.5/dbd/postgresql/connection.c			2010-05-01 06:25:12.000000000 +0200
++++ lua-dbi-0.5/dbd/postgresql/connection.c.pgsql_transaction	2013-04-26 02:02:31.000000000 +0200
+@@ -109,10 +109,12 @@
+     int err = 0;
+ 
+     if (conn->postgresql) {
+-	if (on)
+-	    err = rollback(conn);
+-	else
+-	    err = begin(conn);
++	if (on != conn->autocommit) {
++	    if (on)
++		err = rollback(conn);
++	    else
++		err = begin(conn);
++	}
+ 
+ 	conn->autocommit = on;	
+     }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/lua-dbi.git/commitdiff/d25e69cced2319e26c8275ed8452b764a33df2bf



More information about the pld-cvs-commit mailing list