# Set required packages
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED glib-2.0 tcore dlog)
+pkg_check_modules(pkgs REQUIRED glib-2.0 tcore dlog libtzplatform-config)
FOREACH(flag ${pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(tcore)
+BuildRequires: pkgconfig(libtzplatform-config)
%description
Telephony AT Modem library
%post
/sbin/ldconfig
-mkdir -p /opt/dbspace
+mkdir -p %{TZ_SYS_DB}
-if [ ! -f /opt/dbspace/.mcc_mnc_oper_list.db ]
+if [ ! -f %{TZ_SYS_DB}/.mcc_mnc_oper_list.db ]
then
- sqlite3 /opt/dbspace/.mcc_mnc_oper_list.db < /tmp/mcc_mnc_oper_list.sql
+ sqlite3 %{TZ_SYS_DB}/.mcc_mnc_oper_list.db < /tmp/mcc_mnc_oper_list.sql
fi
rm -f /tmp/mcc_mnc_oper_list.sql
-if [ -f /opt/dbspace/.mcc_mnc_oper_list.db ]
+if [ -f %{TZ_SYS_DB}/.mcc_mnc_oper_list.db ]
then
-chmod 600 /opt/dbspace/.mcc_mnc_oper_list.db
+chmod 600 %{TZ_SYS_DB}/.mcc_mnc_oper_list.db
fi
-if [ -f /opt/dbspace/.mcc_mnc_oper_list.db-journal ]
+if [ -f %{TZ_SYS_DB}/.mcc_mnc_oper_list.db-journal ]
then
-chmod 644 /opt/dbspace/.mcc_mnc_oper_list.db-journal
+chmod 644 %{TZ_SYS_DB}/.mcc_mnc_oper_list.db-journal
fi
%postun -p /sbin/ldconfig
#include <co_network.h>
#include <server.h>
#include <storage.h>
+#include <tzplatform_config.h>
#include "s_common.h"
#include "s_network.h"
gpointer key, value;
GHashTable *result = NULL, *row = NULL;
struct tcore_network_operator_info *noi = NULL;
+ const char *path = NULL;
int count = 0;
s = tcore_plugin_ref_server(plugin);
strg = tcore_server_find_storage(s, "database");
- handle = tcore_storage_create_handle(strg, "/opt/dbspace/.mcc_mnc_oper_list.db");
+ path = tzplatform_mkpath(TZ_SYS_DB, ".mcc_mnc_oper_list.db");
+
+ handle = tcore_storage_create_handle(strg, path);
if (!handle) {
dbg("fail to create database handle");
return;