#define WCL_EDJ_NAME WCL_EDJ_PATH"/ug_worldclock.edj"
#define WCL_THEME_NAME WCL_EDJ_PATH"/ug_worldclock_theme.edj"
-//#define WORLDCLOCK_FILE_PATH "/opt/.worldclock.txt"
-#define WORLDCLOCK_DB "/opt/dbspace/.worldclock.db"
-
#define VCONFKEY_SETAPPL_PREFIX "db/setting"
#define SETTING_THEME_SELECTED_THEME VCONFKEY_SETAPPL_PREFIX"/selected_theme"
BuildRequires: cmake
BuildRequires: edje-tools
BuildRequires: gettext-tools
+BuildRequires: pkgconfig(libtzplatform-config)
%description
Worldclock UI gadget
%post
/sbin/ldconfig
-CITY_TABLE_FILE="/opt/dbspace/.worldclock.db"
+CITY_TABLE_FILE="%{TZ_SYS_DB}/.worldclock.db"
if [ ! -e "$CITY_TABLE_FILE" ]
then
#create db
-sqlite3 /opt/dbspace/.worldclock.db 'PRAGMA journal_mode = PERSIST;
+sqlite3 %{TZ_SYS_DB}/.worldclock.db 'PRAGMA journal_mode = PERSIST;
CREATE TABLE city_table (idex int primary key, city varchar(128), country varchar(128), timezone varchar(20), dst_type int, dst_enabled int, selected int, sequence int, tz_path varchar(128));
INSERT INTO "city_table" VALUES(0,"IDS_WCL_BODY_CITYNAME_ABIDJAN","IDS_WCL_BODY_COTE_DIVOIRE","GMT+0",0,1,0,0,"Africa/Abidjan");
INSERT INTO "city_table" VALUES(1,"IDS_WCL_BODY_CITYNAME_ABUDHABI","IDS_WCL_BODY_UNITED_ARAB_EMIRATES","GMT+4",0,1,0,0,"Asia/Dubai");
# Change file owner
-chown :6015 /opt/dbspace/.worldclock.db
-chown :6015 /opt/dbspace/.worldclock.db-journal
-chmod 664 /opt/dbspace/.worldclock.db
-chmod 664 /opt/dbspace/.worldclock.db-journal
+chown :$UID %{TZ_SYS_DB}/.worldclock.db
+chown :$UID %{TZ_SYS_DB}/.worldclock.db-journal
+chmod 664 %{TZ_SYS_DB}/.worldclock.db
+chmod 664 %{TZ_SYS_DB}/.worldclock.db-journal
-%postun -p /sbin/ldconfig
+chsmack -a 'System::Shared' %{TZ_SYS_DB}/.worldclock.db
+chsmack -a 'System::Shared' %{TZ_SYS_DB}/.worldclock.db-journal
+%postun -p /sbin/ldconfig
%files
%manifest %{name}.manifest
#include <fcntl.h>
#include <vconf.h>
+#include <tzplatform_config.h>
#include "worldclock.h"
#include "worldclock_data.h"
#include "worldclock_types.h"
#include "worldclock_util.h"
+#define WORLDCLOCK_DB tzplatform_mkpath(TZ_SYS_DB, ".worldclock.db")
#define WORLDCLOCK_DB_QUERY_LEN 512
#define WORLDCLOCK_DB_TABLE_CITY "city_table"