Commit 8615a645 authored by Timo Teräs's avatar Timo Teräs
Browse files

main/kamailio: update sqlite patch

also fix some apkbuild typoes and the build target.
parent 485a705b
......@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=kamailio
pkgver=3.1.1
pkgrel=0
pkgrel=1
pkgdesc="Open Source SIP Server"
url="http://www.kamailio.org/"
pkgusers="kamailio"
......@@ -41,7 +41,7 @@ prepare() {
for i in $source; do
case $i in
*.patch)
msg "Apllying $i"
msg "Applying $i"
patch -p1 -i "$srcdir"/$i || return 1
;;
esac
......@@ -77,7 +77,7 @@ build() {
DESTDIR="$pkgdir" \
cfg_prefix="$pkgdir" \
cfg
make || return 1
make kamailio modules modules_k modules_s || return 1
}
package() {
......@@ -157,4 +157,4 @@ md5sums="f0bf80cfae676c086f827b499eaf21cd kamailio-3.1.1_src.tar.gz
a3c959ec568c43a905710e7d25cd8c25 kamailio.cfg
81100c479890a2a8c2628db22fdd1a0c kamailio.initd
3cb2eaeed81e4cdb1830f06a88de19e7 kamailio-3.1-backslash.patch
ed43b0d8d60b1e87199ce18ba326ccee sqlite.patch"
199df21eaa4856dcacdcc438f72765f1 sqlite.patch"
commit 09d0be81bbc95caf323b2ce3da8bf4f1ee8aa9d4
Author: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue Aug 24 13:13:34 2010 +0000
add support for sqlite
diff --git a/modules_k/db_sqlite/Makefile b/modules_k/db_sqlite/Makefile
new file mode 100644
index 0000000..9a75593
--- /dev/null
+++ b/modules_k/db_sqlite/Makefile
Index: kamailio-3.1.1/modules_k/db_sqlite/Makefile
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ kamailio-3.1.1/modules_k/db_sqlite/Makefile 2011-01-05 14:19:03.000000000 +0200
@@ -0,0 +1,15 @@
+# $Id$
+#
......@@ -25,12 +18,11 @@ index 0000000..9a75593
+SERLIBPATH=../../lib
+SER_LIBS+=$(SERLIBPATH)/srdb1/srdb1
+include ../../Makefile.modules
diff --git a/modules_k/db_sqlite/db_sqlite.c b/modules_k/db_sqlite/db_sqlite.c
new file mode 100644
index 0000000..1ec1267
--- /dev/null
+++ b/modules_k/db_sqlite/db_sqlite.c
@@ -0,0 +1,92 @@
Index: kamailio-3.1.1/modules_k/db_sqlite/db_sqlite.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ kamailio-3.1.1/modules_k/db_sqlite/db_sqlite.c 2011-01-05 14:21:13.000000000 +0200
@@ -0,0 +1,90 @@
+/*
+ * $Id$
+ *
......@@ -77,11 +69,9 @@ index 0000000..1ec1267
+ dbb->free_result = db_sqlite_free_result;
+ dbb->query = db_sqlite_query;
+ dbb->insert = db_sqlite_insert;
+ dbb->delete = db_sqlite_delete;
+ dbb->delete = db_sqlite_delete;
+ dbb->update = db_sqlite_update;
+#if 0
+ dbb->raw_query = db_oracle_raw_query;
+#endif
+ dbb->raw_query = db_sqlite_raw_query;
+
+ return 0;
+}
......@@ -123,12 +113,11 @@ index 0000000..1ec1267
+ sqlite_mod_destroy, /* destroy function */
+ 0 /* per-child init function */
+};
diff --git a/modules_k/db_sqlite/dbase.c b/modules_k/db_sqlite/dbase.c
new file mode 100644
index 0000000..9ae1bdb
--- /dev/null
+++ b/modules_k/db_sqlite/dbase.c
@@ -0,0 +1,504 @@
Index: kamailio-3.1.1/modules_k/db_sqlite/dbase.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ kamailio-3.1.1/modules_k/db_sqlite/dbase.c 2011-01-05 14:20:47.000000000 +0200
@@ -0,0 +1,515 @@
+/*
+ * $Id$
+ *
......@@ -377,8 +366,9 @@ index 0000000..9ae1bdb
+ if (strstr(decltype, "INT") != NULL ||
+ strncasecmp(decltype, "SERIAL", 6) == 0)
+ return DB1_INT;
+ if (strstr(decltype, "CHAR") != NULL ||
+ strstr(decltype, "TEXT") != NULL)
+ if (strstr(decltype, "CHAR") != NULL)
+ return DB1_STRING;
+ if (strstr(decltype, "TEXT") != NULL)
+ return DB1_STR;
+ if (strstr(decltype, "REAL") != NULL ||
+ strstr(decltype, "FLOA") != NULL ||
......@@ -411,9 +401,10 @@ index 0000000..9ae1bdb
+
+static void str_assign(str* s, const char *_s, int len)
+{
+ s->s = (char *) pkg_malloc(len);
+ s->s = (char *) pkg_malloc(len + 1);
+ s->len = len;
+ memcpy(s->s, _s, len);
+ s->s[len] = 0;
+}
+
+/*
......@@ -485,6 +476,9 @@ index 0000000..9ae1bdb
+ case DB1_BIGINT:
+ VAL_BIGINT(val) = sqlite3_column_int64(conn->stmt, i);
+ break;
+ case DB1_STRING:
+ /* first field of struct str* is the char* so we can just
+ * do whatever DB1_STR case does */
+ case DB1_STR:
+ str_assign(&VAL_STR(val),
+ (const char*) sqlite3_column_text(conn->stmt, i),
......@@ -633,12 +627,17 @@ index 0000000..9ae1bdb
+ return rc;
+}
+
diff --git a/modules_k/db_sqlite/dbase.h b/modules_k/db_sqlite/dbase.h
new file mode 100644
index 0000000..d1e57f4
--- /dev/null
+++ b/modules_k/db_sqlite/dbase.h
@@ -0,0 +1,70 @@
+int db_sqlite_raw_query(const db1_con_t* _h, const str* _s, db1_res_t** _r)
+{
+ return db_do_raw_query(_h, _s, _r,
+ db_sqlite_submit_query,
+ db_sqlite_store_result);
+}
Index: kamailio-3.1.1/modules_k/db_sqlite/dbase.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ kamailio-3.1.1/modules_k/db_sqlite/dbase.h 2011-01-05 14:20:47.000000000 +0200
@@ -0,0 +1,72 @@
+/*
+ * $Id$
+ *
......@@ -705,6 +704,8 @@ index 0000000..d1e57f4
+int db_sqlite_update(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _o,
+ const db_val_t* _v, const db_key_t* _uk, const db_val_t* _uv,
+ int _n, int _un);
+int db_sqlite_raw_query(const db1_con_t* _h, const str* _s, db1_res_t** _r);
+
+int db_sqlite_use_table(db1_con_t* _h, const str* _t);
+
+
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment