[packages/lua-dbi] updated to 0.7.2, uses lua 5.3

bszx bszx at pld-linux.org
Sun Apr 5 21:01:56 CEST 2020


commit b0e3e280fcccfbb6ee7ec15ee566db916aebc77e
Author: Bartek Szady <bszx at bszx.eu>
Date:   Sun Apr 5 20:53:47 2020 +0200

    updated to 0.7.2, uses lua 5.3

 lua-dbi-0.5-pgsql_transaction.patch | 27 ----------------
 lua-dbi.spec                        | 63 ++++++++++++++++++++++++-------------
 makefile.patch                      | 11 +++++++
 3 files changed, 53 insertions(+), 48 deletions(-)
---
diff --git a/lua-dbi.spec b/lua-dbi.spec
index aa05d2c..b535cbb 100644
--- a/lua-dbi.spec
+++ b/lua-dbi.spec
@@ -1,19 +1,28 @@
 # TODO
 # - subpackage for each driver
-%define		luaver 5.1
+%define		luaver 5.3
+%define		real_name luadbi
+
+%define		luasuffix %(echo %{luaver} | tr -d .)
+%if "%{luaver}" == "5.1"
+%define		luaincludedir %{_includedir}/lua51
+%else
+%define		luaincludedir %{_includedir}/lua%{luaver}
+%endif
 %define		lualibdir %{_libdir}/lua/%{luaver}
 %define		luapkgdir %{_datadir}/lua/%{luaver}
+
 Summary:	Database interface library for Lua
-Name:		lua-dbi
-Version:	0.5
+Name:		lua%{luasuffix}-dbi
+Version:	0.7.2
 Release:	1
 License:	MIT
 Group:		Development/Libraries
-Source0:	http://luadbi.googlecode.com/files/luadbi.%{version}.tar.gz
-# Source0-md5:	ede2b003aadddc151aac87050c3d926e
-URL:		http://code.google.com/p/luadbi
-Patch1:		%{name}-0.5-pgsql_transaction.patch
-BuildRequires:	lua51-devel
+Source0:	https://github.com/mwild1/luadbi/archive/v%{version}/%{real_name}-%{version}.tar.gz
+# Source0-md5:	8e80fdc9ea25845c17e9268b75980b85
+URL:		https://github.com/mwild1/luadbi
+Patch0:		makefile.patch
+BuildRequires:	lua%{luasuffix}-devel
 BuildRequires:	mysql-devel
 BuildRequires:	postgresql-backend-devel
 BuildRequires:	postgresql-devel
@@ -31,33 +40,45 @@ Currently LuaDBI supports DB2, Oracle, MySQL, PostgreSQL and SQLite
 databases with native database drivers.
 
 %prep
-%setup -qc
-%patch1 -p1
+%setup -q -n %{real_name}-%{version}
+%patch0 -p1
 find . -name \*.[ch] -print -exec chmod -x '{}' \;
 sed -i -e '1d' DBI.lua
 
-%{__sed} -i -e 's,-O2,$(EXTRA_CFLAGS),' Makefile
-
 %build
-%{__make} \
+%{__make} free \
 	LIBDIR="%{_libdir}" \
 	CC="%{__cc}" \
-	EXTRA_CFLAGS="%{rpmcflags} %{rpmcppflags} -I/usr/include/lua51 -I/usr/include/postgresql/internal -I/usr/include/postgresql/server"
-	COMMON_LDFLAGS="%{rpmldflags} -llua51 -shared"
+	CFLAGS="%{rpmcflags}" \
+	LDFLAGS="%{rpmldflags}" \
+	LUA_V="%{luaver}" \
+	LUA_INC="-I%{luaincludedir}" \
+	LUA_LDIR="%{luapkgdir}" \
+	LUA_CDIR="%{lualibdir}"
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{luapkgdir},%{lualibdir}}
-install -p *.so $RPM_BUILD_ROOT%{lualibdir}
-cp -p *.lua $RPM_BUILD_ROOT%{luapkgdir}
+
+%{__make} install_free \
+	DESTDIR=$RPM_BUILD_ROOT \
+	LIBDIR="%{_libdir}" \
+	CC="%{__cc}" \
+	CFLAGS="%{rpmcflags}" \
+	LDFLAGS="%{rpmldflags}" \
+	LUA_V="%{luaver}" \
+	LUA_INC="-I%{luaincludedir}" \
+	LUA_LDIR="%{luapkgdir}" \
+	LUA_CDIR="%{lualibdir}"
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc README COPYING
-%{lualibdir}/dbdmysql.so
-%{lualibdir}/dbdpostgresql.so
-%{lualibdir}/dbdsqlite3.so
+%doc README.md COPYING
+%dir %{lualibdir}/dbd
+%{lualibdir}/dbd/mysql.so
+%{lualibdir}/dbd/postgresql.so
+%{lualibdir}/dbd/sqlite3.so
 %{luapkgdir}/DBI.lua
diff --git a/lua-dbi-0.5-pgsql_transaction.patch b/lua-dbi-0.5-pgsql_transaction.patch
deleted file mode 100644
index 877c36a..0000000
--- a/lua-dbi-0.5-pgsql_transaction.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-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;	
-     }
diff --git a/makefile.patch b/makefile.patch
new file mode 100644
index 0000000..fb26d7d
--- /dev/null
+++ b/makefile.patch
@@ -0,0 +1,11 @@
+--- luadbi-0.7.2/Makefile.orig	2019-01-14 10:39:17.000000000 +0100
++++ luadbi-0.7.2/Makefile	2020-04-05 20:24:34.738355081 +0200
+@@ -10,7 +10,7 @@
+ LUA_LDIR	?= /usr/share/lua/$(LUA_V)
+ LUA_CDIR	?= /usr/lib/lua/$(LUA_V)
+ 
+-COMMON_CFLAGS	 ?= -g -pedantic -Wall -O2 -shared -fPIC -DPIC -std=c99
++COMMON_CFLAGS	 ?= -pedantic -Wall -shared -fPIC -DPIC -std=c99
+ LUA_INC		?= -I/usr/include/lua$(LUA_V)
+ MYSQL_INC	?= -I/usr/include/mysql
+ PSQL_INC	?= -I/usr/include/postgresql
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list