SHA256
10
0
forked from pool/lua-luasql

10 Commits

Author SHA256 Message Date
29068c5ba6 Accepting request 1222599 from devel:languages:lua
- Switch to _service and download the code from GitHub repo,
  upstream doesn't create releases.
- Update to version 2.6.0+git.1724375068.d60f8b2:
  * Add version history and credits
  * Update fr Documentation
  * Update br Documentation
  * Update US Documentation
  * Minor fixes
  * Fix HTML Characters
  * Update br Documentation
  * Update Fr Documentation
  * Update example
- Enable the test suite.
- Remove already upstreamed luasql-fix-configuration.patch

OBS-URL: https://build.opensuse.org/request/show/1222599
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lua-luasql?expand=0&rev=6
2024-11-08 11:00:40 +00:00
dd52904689 typo
OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-luasql?expand=0&rev=15
2024-11-07 22:15:46 +00:00
c224f5155c - Remove luasql-fix-configuration.patch
OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-luasql?expand=0&rev=14
2024-11-07 22:08:25 +00:00
92fef1614c Don't remove standard path
OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-luasql?expand=0&rev=13
2024-11-05 10:28:07 +00:00
808a539d6b - Switch to _service and download the code from GitHub repo,
upstream doesn't create releases.
- Update to version 2.6.0+git.1724375068.d60f8b2:
  * Add version history and credits
  * Update fr Documentation
  * Update br Documentation
  * Update US Documentation
  * Minor fixes
  * Fix HTML Characters
  * Update br Documentation
  * Update Fr Documentation
  * Update example
- Enable the test suite.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-luasql?expand=0&rev=12
2024-11-05 10:26:26 +00:00
0b35251dd9 Accepting request 1072753 from devel:languages:lua
- Update to 2.6.0:
  - Added read-only mode to SQLite3 and two new methods to MySQL
    fetch.
  - This release also added the library opening functions to
    luasql.h in order to ease the initialization process in C
    applications.
  - Added seek method to MySQL driver and bug-fix on ODBC driver
    number retrieval.
- Clean up luasql-fix-configuration.patch (now on
  gh#lunarmodules/luasql!152).

OBS-URL: https://build.opensuse.org/request/show/1072753
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lua-luasql?expand=0&rev=5
2023-03-18 23:31:05 +00:00
35e62b6f24 - Clean up luasql-fix-configuration.patch (now on
gh#lunarmodules/luasql!152).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-luasql?expand=0&rev=10
2023-03-17 21:37:30 +00:00
2883f04e3b - Update to 2.6.0:
- Added read-only mode to SQLite3 and two new methods to MySQL
    fetch.
  - This release also added the library opening functions to
    luasql.h in order to ease the initialization process in C
    applications.
  - Added seek method to MySQL driver and bug-fix on ODBC driver
    number retrieval.
- Clean up luasql-fix-configuration.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-luasql?expand=0&rev=9
2023-03-17 21:30:14 +00:00
7d5c9d2fd7 Accepting request 1072462 from devel:languages:lua
- Change upstream homepage to the current one at Lunar Modules.

OBS-URL: https://build.opensuse.org/request/show/1072462
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lua-luasql?expand=0&rev=4
2023-03-17 16:04:16 +00:00
85ad886091 - Change upstream homepage to the current one at Lunar Modules.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-luasql?expand=0&rev=7
2023-03-16 18:19:10 +00:00
8 changed files with 92 additions and 164 deletions

15
_service Normal file
View File

@@ -0,0 +1,15 @@
<services>
<service name="obs_scm" mode="manual">
<param name="scm">git</param>
<param name="url">https://github.com/lunarmodules/luasql.git</param>
<param name="versionprefix">2.6.0+git</param>
<param name="changesgenerate">enable</param>
<param name="changesauthor">mcepl@cepl.eu</param>
</service>
<service name="tar" mode="buildtime"/>
<service name="recompress" mode="buildtime">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
<service name="set_version" mode="manual"/>
</services>

4
_servicedata Normal file
View File

@@ -0,0 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/lunarmodules/luasql.git</param>
<param name="changesrevision">d60f8b2a613c31a9626bc8d9a760609830cd1d4d</param></service></servicedata>

View File

@@ -1,3 +1,40 @@
-------------------------------------------------------------------
Tue Nov 5 10:25:55 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
- Switch to _service and download the code from GitHub repo,
upstream doesn't create releases.
- Update to version 2.6.0+git.1724375068.d60f8b2:
* Add version history and credits
* Update fr Documentation
* Update br Documentation
* Update US Documentation
* Minor fixes
* Fix HTML Characters
* Update br Documentation
* Update Fr Documentation
* Update example
- Enable the test suite.
- Remove already upstreamed luasql-fix-configuration.patch
-------------------------------------------------------------------
Fri Mar 17 18:24:52 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Update to 2.6.0:
- Added read-only mode to SQLite3 and two new methods to MySQL
fetch.
- This release also added the library opening functions to
luasql.h in order to ease the initialization process in C
applications.
- Added seek method to MySQL driver and bug-fix on ODBC driver
number retrieval.
- Clean up luasql-fix-configuration.patch (now on
gh#lunarmodules/luasql!152).
-------------------------------------------------------------------
Thu Mar 16 18:18:57 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Change upstream homepage to the current one at Lunar Modules.
-------------------------------------------------------------------
Thu Feb 18 15:58:47 UTC 2021 - Callum Farmer <gmbr3@opensuse.org>

View File

@@ -1,7 +1,7 @@
#
# spec file for package lua-luasql
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2014 Malcolm J Lewis <malcolmlewis@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
@@ -19,12 +19,25 @@
%global flavor @BUILD_FLAVOR@%{nil}
%define flavor_dec $(c=%{flavor}; echo ${c:0:-1}.${c: -1})
%define flavor_ver %{lua:ver, ok = string.gsub(rpm.expand("%{flavor}"), "lua(%d)(%d)", "%1.%2"); print(ver)}
%define flavor_ver %{lua:ver, ok = string.gsub(rpm.expand("%{flavor}"), "lua(%{d})(%{d})", "%{1}.%{2}"); print(ver)}
%define mod_name luasql
%define lua_archdir %{_libdir}/lua/%{flavor_ver}
%define lua_incdir %{_includedir}/lua%{flavor_ver}
%define lua_noarchdir %{_datadir}/lua/%{flavor_ver}
Version: 2.6.0+git.1724375068.d60f8b2
Release: 0
Summary: Simple interface from Lua to a DBMS
License: MIT
Group: Development/Libraries/Other
URL: https://github.com/lunarmodules/luasql
# Source0: https://github.com/lunarmodules/luasql/archive/refs/tags/%%{version}/%%{mod_name}-%%{version}.tar.gz
Source0: %{mod_name}-%{version}.tar.gz
BuildRequires: %{flavor}-devel
BuildRequires: libiodbc-devel
BuildRequires: libmysqlclient-devel
BuildRequires: lua-macros
BuildRequires: pkgconf
BuildRequires: postgresql-devel
BuildRequires: sqlite3-devel
Requires: %{flavor}
Requires: libmariadb3
%lua_provides
%if "%{flavor}" == ""
Name: lua-%{mod_name}
@@ -32,24 +45,6 @@ ExclusiveArch: do_not_build
%else
Name: %{flavor}-%{mod_name}
%endif
Version: 2.4.0
Release: 0
Summary: Simple interface from Lua to a DBMS
License: MIT
Group: Development/Libraries/Other
URL: https://keplerproject.github.io/luasql/
Source0: https://github.com/keplerproject/luasql/archive/v%{version}/%{mod_name}-%{version}.tar.gz
#Source0 via https://codeload.github.com/keplerproject/luasql/tar.gz/v2.3.0
# PATCH-FIX-OPENSUSE luasql-fix-configuration.patch malcolmlewis@opensuse.org -- Clean up building and add rpm optflags.
Patch0: luasql-fix-configuration.patch
BuildRequires: %{flavor}-devel
BuildRequires: libiodbc-devel
BuildRequires: libmysqlclient-devel
BuildRequires: pkg-config
BuildRequires: postgresql-devel
BuildRequires: sqlite3-devel
Requires: %{flavor}
Requires: libmariadb3
%description
A simple interface from Lua to a DBMS. It enables a Lua program to:
@@ -58,21 +53,20 @@ A simple interface from Lua to a DBMS. It enables a Lua program to:
- Retrieve results in a row-by-row cursor fashion.
%prep
%setup -q -n %{mod_name}-%{version}
%patch0 -p1
%autosetup -p1 -n %{mod_name}-%{version}
%build
export OPTFLAGS="%{optflags}"
export LUA_INC="%{lua_incdir}"
# also oci8 firebird
make %{?_smp_mflags} \
%make_build \
DRIVER_INCS="-I%{_includedir}" DRIVER_LIBS_sqlite3="-lsqlite3" sqlite3
make %{?_smp_mflags} \
%make_build \
DRIVER_INCS="-I%{_includedir}/pgsql" DRIVER_LIBS_postgres="-lpq" postgres
make %{?_smp_mflags} \
%make_build \
DRIVER_INCS="-I%{_includedir}/mysql" DRIVER_LIBS_mysql="-lmysqlclient -lz" mysql
make %{?_smp_mflags} \
%make_build \
DRIVER_INCS="-I%{_includedir}" DRIVER_LIBS_odbc="-liodbc" odbc
%install
@@ -81,6 +75,11 @@ make %{?_smp_mflags} \
%make_install LUA_LIBDIR='$(DESTDIR)%{lua_archdir}' mysql
%make_install LUA_LIBDIR='$(DESTDIR)%{lua_archdir}' odbc
%check
export LUA_PATH='%{buildroot}%{lua_archdir}/?.lua;;'
export LUA_CPATH='%{buildroot}%{lua_archdir}/?.so'
lua%{lua_version} tests/test.lua sqlite3
%files
%doc doc/us/*
%dir %{lua_archdir}/luasql

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:db2458a8c8c5f3bc717e4030fe2878f1ad8d71e437ec6149c381eebad5d525c5
size 103139

BIN
luasql-2.6.0+git.1724375068.d60f8b2.obscpio (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -1,131 +0,0 @@
--- a/config
+++ b/config
@@ -46,9 +46,8 @@ DRIVER_LIBS_firebird ?= -L/usr/local/fir
DRIVER_INCS_firebird ?=
# general compilation parameters
-WARN = -Wall -Wmissing-prototypes -Wmissing-declarations -pedantic
+WARN= -fPIC $(OPTFLAGS) -Wmissing-prototypes -Wmissing-declarations -ansi -pedantic
INCS = -I$(LUA_INC)
-DEFS =
-CFLAGS = -O2 -std=gnu99 $(WARN) -fPIC $(DRIVER_INCS) $(INCS) \
- -DLUASQL_VERSION_NUMBER='"$V"' $(DEFS)
+DEFS = -std=gnu99 -fPIC
+CFLAGS=$(WARN) $(DRIVER_INCS) $(INCS) -DLUASQL_VERSION_NUMBER='"$V"' $(DEFS)
CC= gcc
--- a/src/ls_mysql.c
+++ b/src/ls_mysql.c
@@ -29,28 +29,28 @@
#define LUASQL_CURSOR_MYSQL "MySQL cursor"
/* For compat with old version 4.0 */
-#if (MYSQL_VERSION_ID < 40100)
-#define MYSQL_TYPE_VAR_STRING FIELD_TYPE_VAR_STRING
-#define MYSQL_TYPE_STRING FIELD_TYPE_STRING
-#define MYSQL_TYPE_DECIMAL FIELD_TYPE_DECIMAL
-#define MYSQL_TYPE_SHORT FIELD_TYPE_SHORT
-#define MYSQL_TYPE_LONG FIELD_TYPE_LONG
-#define MYSQL_TYPE_FLOAT FIELD_TYPE_FLOAT
-#define MYSQL_TYPE_DOUBLE FIELD_TYPE_DOUBLE
-#define MYSQL_TYPE_LONGLONG FIELD_TYPE_LONGLONG
-#define MYSQL_TYPE_INT24 FIELD_TYPE_INT24
-#define MYSQL_TYPE_YEAR FIELD_TYPE_YEAR
-#define MYSQL_TYPE_TINY FIELD_TYPE_TINY
-#define MYSQL_TYPE_TINY_BLOB FIELD_TYPE_TINY_BLOB
-#define MYSQL_TYPE_MEDIUM_BLOB FIELD_TYPE_MEDIUM_BLOB
-#define MYSQL_TYPE_LONG_BLOB FIELD_TYPE_LONG_BLOB
-#define MYSQL_TYPE_BLOB FIELD_TYPE_BLOB
-#define MYSQL_TYPE_DATE FIELD_TYPE_DATE
-#define MYSQL_TYPE_NEWDATE FIELD_TYPE_NEWDATE
-#define MYSQL_TYPE_DATETIME FIELD_TYPE_DATETIME
-#define MYSQL_TYPE_TIME FIELD_TYPE_TIME
-#define MYSQL_TYPE_TIMESTAMP FIELD_TYPE_TIMESTAMP
-#define MYSQL_TYPE_ENUM FIELD_TYPE_ENUM
+#if (MYSQL_VERSION_ID < 40100)
+#define MYSQL_TYPE_VAR_STRING FIELD_TYPE_VAR_STRING
+#define MYSQL_TYPE_STRING FIELD_TYPE_STRING
+#define MYSQL_TYPE_DECIMAL FIELD_TYPE_DECIMAL
+#define MYSQL_TYPE_SHORT FIELD_TYPE_SHORT
+#define MYSQL_TYPE_LONG FIELD_TYPE_LONG
+#define MYSQL_TYPE_FLOAT FIELD_TYPE_FLOAT
+#define MYSQL_TYPE_DOUBLE FIELD_TYPE_DOUBLE
+#define MYSQL_TYPE_LONGLONG FIELD_TYPE_LONGLONG
+#define MYSQL_TYPE_INT24 FIELD_TYPE_INT24
+#define MYSQL_TYPE_YEAR FIELD_TYPE_YEAR
+#define MYSQL_TYPE_TINY FIELD_TYPE_TINY
+#define MYSQL_TYPE_TINY_BLOB FIELD_TYPE_TINY_BLOB
+#define MYSQL_TYPE_MEDIUM_BLOB FIELD_TYPE_MEDIUM_BLOB
+#define MYSQL_TYPE_LONG_BLOB FIELD_TYPE_LONG_BLOB
+#define MYSQL_TYPE_BLOB FIELD_TYPE_BLOB
+#define MYSQL_TYPE_DATE FIELD_TYPE_DATE
+#define MYSQL_TYPE_NEWDATE FIELD_TYPE_NEWDATE
+#define MYSQL_TYPE_DATETIME FIELD_TYPE_DATETIME
+#define MYSQL_TYPE_TIME FIELD_TYPE_TIME
+#define MYSQL_TYPE_TIMESTAMP FIELD_TYPE_TIMESTAMP
+#define MYSQL_TYPE_ENUM FIELD_TYPE_ENUM
#define MYSQL_TYPE_SET FIELD_TYPE_SET
#define MYSQL_TYPE_NULL FIELD_TYPE_NULL
@@ -135,7 +135,7 @@ static char *getcolumntype (enum enum_fi
return "string";
case MYSQL_TYPE_DECIMAL: case MYSQL_TYPE_SHORT: case MYSQL_TYPE_LONG:
case MYSQL_TYPE_FLOAT: case MYSQL_TYPE_DOUBLE: case MYSQL_TYPE_LONGLONG:
- case MYSQL_TYPE_INT24: case MYSQL_TYPE_YEAR: case MYSQL_TYPE_TINY:
+ case MYSQL_TYPE_INT24: case MYSQL_TYPE_YEAR: case MYSQL_TYPE_TINY:
return "number";
case MYSQL_TYPE_TINY_BLOB: case MYSQL_TYPE_MEDIUM_BLOB:
case MYSQL_TYPE_LONG_BLOB: case MYSQL_TYPE_BLOB:
@@ -193,7 +193,7 @@ static void cur_nullify (lua_State *L, c
luaL_unref (L, LUA_REGISTRYINDEX, cur->coltypes);
}
-
+
/*
** Get another row of the given cursor.
*/
@@ -225,7 +225,7 @@ static int cur_fetch (lua_State *L) {
if (cur->colnames == LUA_NOREF)
create_colinfo(L, cur);
lua_rawgeti (L, LUA_REGISTRYINDEX, cur->colnames);/* Push colnames*/
-
+
/* Copy values to alphanumerical indices */
for (i = 0; i < cur->numcols; i++) {
lua_rawgeti(L, -1, i+1); /* push the field name */
@@ -288,7 +288,7 @@ static void _pushtable (lua_State *L, cu
/* If colnames or coltypes do not exist, create both. */
if (*ref == LUA_NOREF)
create_colinfo(L, cur);
-
+
/* Pushes the right table (colnames or coltypes) */
lua_rawgeti (L, LUA_REGISTRYINDEX, *ref);
}
@@ -417,7 +417,7 @@ static int conn_execute (lua_State *L) {
conn_data *conn = getconnection (L);
size_t st_len;
const char *statement = luaL_checklstring (L, 2, &st_len);
- if (mysql_real_query(conn->my_conn, statement, st_len))
+ if (mysql_real_query(conn->my_conn, statement, st_len))
/* error executing query */
return luasql_failmsg(L, "error executing query. MySQL: ", mysql_error(conn->my_conn));
else
@@ -524,7 +524,7 @@ static int env_connect (lua_State *L) {
if (conn == NULL)
return luasql_faildirect(L, "error connecting: Out of memory.");
- if (!mysql_real_connect(conn, host, username, password,
+ if (!mysql_real_connect(conn, host, username, password,
sourcename, port, unix_socket, client_flag))
{
char error_msg[100];
@@ -618,7 +618,7 @@ static int create_environment (lua_State
** Creates the metatables for the objects and registers the
** driver open method.
*/
-LUASQL_API int luaopen_luasql_mysql (lua_State *L) {
+LUASQL_API int luaopen_luasql_mysql (lua_State *L) {
struct luaL_Reg driver[] = {
{"mysql", create_environment},
{NULL, NULL},

4
luasql.obsinfo Normal file
View File

@@ -0,0 +1,4 @@
name: luasql
version: 2.6.0+git.1724375068.d60f8b2
mtime: 1724375068
commit: d60f8b2a613c31a9626bc8d9a760609830cd1d4d