From 7470c03467062f8fd3c5d8617f77fd22cbcf037fd41a1c03a81bc7bbe50e48f0 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 3 Oct 2024 17:25:05 +0000 Subject: [PATCH 1/2] - Update to 0.7.3: - oracle column name bugfix - [travis] fix mysql grant error - Don't break SQLite 3.6.20 as shipped in RHEL/CentOS 6 - dbd/mysql/statement.c: fix compilation with mysql-8 - Issue 56: Remove useless setting of is_null - Issue-66: dbd/mysql/statement.c: return nil for NULL - Attempt to provide partial fix for Issue #64. OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-luadbi?expand=0&rev=22 --- .gitattributes | 23 +++++++++ .gitignore | 1 + _multibuild | 5 ++ lua-luadbi.changes | 55 ++++++++++++++++++++++ lua-luadbi.spec | 83 +++++++++++++++++++++++++++++++++ luadbi-0.7.2.tar.gz | 3 ++ luadbi-0.7.3.tar.gz | 3 ++ luadbi-postgresql-headers.patch | 12 +++++ tests-modules-load.lua | 74 +++++++++++++++++++++++++++++ 9 files changed, 259 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _multibuild create mode 100644 lua-luadbi.changes create mode 100644 lua-luadbi.spec create mode 100644 luadbi-0.7.2.tar.gz create mode 100644 luadbi-0.7.3.tar.gz create mode 100644 luadbi-postgresql-headers.patch create mode 100644 tests-modules-load.lua diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..72d2b45 --- /dev/null +++ b/_multibuild @@ -0,0 +1,5 @@ + +lua51 +lua53 +lua54 + diff --git a/lua-luadbi.changes b/lua-luadbi.changes new file mode 100644 index 0000000..6aa90d4 --- /dev/null +++ b/lua-luadbi.changes @@ -0,0 +1,55 @@ +------------------------------------------------------------------- +Thu Oct 3 15:12:49 UTC 2024 - Matej Cepl + +- Update to 0.7.3: + - oracle column name bugfix + - [travis] fix mysql grant error + - Don't break SQLite 3.6.20 as shipped in RHEL/CentOS 6 + - dbd/mysql/statement.c: fix compilation with mysql-8 + - Issue 56: Remove useless setting of is_null + - Issue-66: dbd/mysql/statement.c: return nil for NULL + - Attempt to provide partial fix for Issue #64. + +------------------------------------------------------------------- +Thu Feb 22 09:57:57 UTC 2024 - Michael Vetter + +- Use %autosetup macro. Allows to eliminate the usage of deprecated + %patchN. + +------------------------------------------------------------------- +Thu Feb 18 15:55:03 UTC 2021 - Callum Farmer + +- Use %lua_provides macro for default lua versioning + +------------------------------------------------------------------- +Fri Oct 9 02:58:43 UTC 2020 - Emil Biserov + +- updated for 0.7.2 +- tests-modules-load.lua added + +------------------------------------------------------------------- +Mon Jul 6 19:04:27 UTC 2020 - Matej Cepl + +- Add lua54 as new build target + +------------------------------------------------------------------- +Wed Jun 12 11:24:33 UTC 2019 - Tomáš Chvátal + +- Fix build after the postgresql package gained two devel packages + +------------------------------------------------------------------- +Mon Oct 30 14:45:32 UTC 2017 - jmatejek@suse.com + +- do not build for Lua 5.2 + +------------------------------------------------------------------- +Thu Jul 13 19:07:55 UTC 2017 - tchvatal@suse.com + +- Switch to multibuild layout to compile for all lua variants + +------------------------------------------------------------------- +Sat Jun 29 00:33:08 UTC 2013 - i@marguerite.su + +- initial version 0.5 +- add new patch: luadbi-postgresql-headers.patch + diff --git a/lua-luadbi.spec b/lua-luadbi.spec new file mode 100644 index 0000000..7298721 --- /dev/null +++ b/lua-luadbi.spec @@ -0,0 +1,83 @@ +# +# spec file for package lua-luadbi +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define flavor @BUILD_FLAVOR@ +%define mod_name luadbi +Version: 0.7.3 +Release: 0 +Summary: A database interface library for Lua +License: MIT +Group: Productivity/Databases/Tools +URL: https://github.com/mwild1/luadbi +Source: https://github.com/mwild1/%{mod_name}/archive/refs/tags/v%{version}.tar.gz#/%{mod_name}-%{version}.tar.gz +# Formely found on code.google.com +Source: luadbi-%{version}.tar.gz +Source50: tests-modules-load.lua +# PATCH-FIX-UPSTREAM marguerite@opensuse.org - fix postgresql headers' path +Patch0: luadbi-postgresql-headers.patch +BuildRequires: %{flavor}-devel +BuildRequires: libmysqld-devel +BuildRequires: postgresql-devel +BuildRequires: postgresql-server-devel +BuildRequires: sqlite3-devel +Requires: %{flavor} +# %%lua_provides +%if "%{flavor}" == "" +Name: lua-%{mod_name} +ExclusiveArch: do_not_build +%else +Name: %{flavor}-%{mod_name} +%endif + +%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. But openSUSE version doesn't build with DB2 and +Oracle. + +%prep +%autosetup -p1 -n luadbi-%{version} + +sed -i \ + -e 's:-g -pedantic -Wall -O2:%{optflags} -fPIC -I%{lua_incdir}:g' \ + Makefile + +%build +%make_build LIBDIR=%{_libdir} + +%install +install -d %{buildroot}%{lua_archdir} +install -d %{buildroot}%{lua_noarchdir} +make install_free DESTDIR=%{buildroot} LUA_LDIR=%{lua_noarchdir} LUA_CDIR=%{lua_archdir} + +%check +# run tests +lua%lua_version %{SOURCE50} "%{buildroot}" + +%files +%license COPYING +%doc README.md +%dir %{lua_archdir}/dbd +%{lua_archdir}/dbd/*.so +%{lua_noarchdir}/*.lua + +%changelog diff --git a/luadbi-0.7.2.tar.gz b/luadbi-0.7.2.tar.gz new file mode 100644 index 0000000..10a3b4f --- /dev/null +++ b/luadbi-0.7.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05a7d02d0cae3970af24f72f39edfe717e39424927d07fbbc09ebe96ea02f5a6 +size 36462 diff --git a/luadbi-0.7.3.tar.gz b/luadbi-0.7.3.tar.gz new file mode 100644 index 0000000..fc8b27e --- /dev/null +++ b/luadbi-0.7.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8370c3e764b695e805124ad5cd95b285f19cb2246e93c0230dcdcd88096b004b +size 35753 diff --git a/luadbi-postgresql-headers.patch b/luadbi-postgresql-headers.patch new file mode 100644 index 0000000..3f3a78f --- /dev/null +++ b/luadbi-postgresql-headers.patch @@ -0,0 +1,12 @@ +--- + dbd/postgresql/dbd_postgresql.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/dbd/postgresql/dbd_postgresql.h ++++ b/dbd/postgresql/dbd_postgresql.h +@@ -1,4 +1,4 @@ +-#include ++#include + #include + + /* diff --git a/tests-modules-load.lua b/tests-modules-load.lua new file mode 100644 index 0000000..ae51a3b --- /dev/null +++ b/tests-modules-load.lua @@ -0,0 +1,74 @@ +#!/usr/bin/lua + +-- test stubs +_test_name = string.gsub(arg[0], ".*/(.*)%.lua$", "%1") +function _progress(...) + io.stdout:write(_test_name, ": ", ...) +end + +function _add_buildroot(buildroot, var) + local path_sep = package.config:sub(3,3); + local path_sep_mask = path_sep:gsub('[()%%.[^$%]*+%-?]','%%%1') + local mask = "([^" .. path_sep_mask .."]+)" + + local paths = {} + for p in var:gmatch(mask) do + if not (p:sub(1, 2) == './') then + table.insert(paths, buildroot .. p) + end + table.insert(paths, p) + end + return table.concat(paths, path_sep) +end + +if arg[1] then + local buildroot = arg[1] + _progress("add buildroot ", buildroot, " to package.path - ") + package.path = _add_buildroot(buildroot, package.path) + print("done") + + _progress("add buildroot ", buildroot, " to package.cpath - ") + package.cpath = _add_buildroot(buildroot, package.cpath) + print("done") +end +-- /test stubs + +_progress("--- Test modules loading from:\n") +_progress("package.path=") +print(package.path) +_progress("package.cpath=") +print(package.cpath) +_progress("---\n") + +-- run test +local modules = { + { 'lua', 'DBI' }, + { 'MySQL', 'dbd.mysql' }, + { 'PostgreSQL', 'dbd.postgresql' }, + { 'SQLite3', 'dbd.sqlite3' }, +} + +errors = 0 +for _, m in ipairs(modules) do + driver = m[1] + modulefile = m[2] + + _progress("load ", driver, " module ", modulefile, ": ") + local m, err = pcall(require, modulefile) + if m then + print("success"); + else + print("FAILED, err="..err); + print() + errors = errors + 1; + end +end + +_progress() +if errors == 0 then + print("SUCCESS") + os.exit(0) +else + print("FAILED, " .. errors .. " error(s) found") + os.exit(1) +end From 4f9359d5b84d9d6dd44ac50ebc83b3d627187e311e35362edc49fa89e63a0a10 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 3 Oct 2024 17:27:36 +0000 Subject: [PATCH 2/2] Clean up the SPEC OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-luadbi?expand=0&rev=23 --- lua-luadbi.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua-luadbi.spec b/lua-luadbi.spec index 7298721..b86ff8e 100644 --- a/lua-luadbi.spec +++ b/lua-luadbi.spec @@ -24,9 +24,9 @@ Summary: A database interface library for Lua License: MIT Group: Productivity/Databases/Tools URL: https://github.com/mwild1/luadbi -Source: https://github.com/mwild1/%{mod_name}/archive/refs/tags/v%{version}.tar.gz#/%{mod_name}-%{version}.tar.gz +Source0: https://github.com/mwild1/%{mod_name}/archive/refs/tags/v%{version}.tar.gz#/%{mod_name}-%{version}.tar.gz # Formely found on code.google.com -Source: luadbi-%{version}.tar.gz +Source1: luadbi-%{version}.tar.gz Source50: tests-modules-load.lua # PATCH-FIX-UPSTREAM marguerite@opensuse.org - fix postgresql headers' path Patch0: luadbi-postgresql-headers.patch @@ -71,7 +71,7 @@ make install_free DESTDIR=%{buildroot} LUA_LDIR=%{lua_noarchdir} LUA_CDIR=%{lua_ %check # run tests -lua%lua_version %{SOURCE50} "%{buildroot}" +lua%{lua_version} %{SOURCE50} %{buildroot} %files %license COPYING