SET(LIBDIR ${LIB_INSTALL_DIR})
SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
SET(ICONDIR "${PREFIX}/share/${PROJECT_NAME}")
-SET(DBDIR "/opt/dbspace")
SET(DBFILE ".notification.db")
SET(MAJOR_VER 0)
SET(VERSION ${MAJOR_VER}.1.0)
com-core
ecore
eina
+ libtzplatform-config
)
FOREACH(flag ${pkgs_CFLAGS})
ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
ADD_DEFINITIONS("-DICONDIR=\"${ICONDIR}\"")
-ADD_DEFINITIONS("-DDBDIR=\"${DBDIR}\"")
ADD_DEFINITIONS("-DDBFILE=\"${DBFILE}\"")
ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
ENDFOREACH(hfile)
CONFIGURE_FILE(${PROJECT_NAME}-service.pc.in ${PROJECT_NAME}-service.pc @ONLY)
-INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-service.pc DESTINATION lib/pkgconfig)
+INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-service.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
FOREACH(hfile ${HEADERS-SERVICE-DEVEL})
INSTALL(FILES ${CMAKE_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME}/service)
ENDFOREACH(hfile)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/notification_DB_init.sh DESTINATION ${SHARE_INSTALL_PREFIX}/${PROJECT_NAME})
#include <bundle.h>
#include <sqlite3.h>
-
-#ifndef DBDIR
-#error "DBDIR not defined"
-#endif
+#include <tzplatform_config.h>
#ifndef DBFILE
#error "DBFILE not defined"
#endif
-#define DBPATH DBDIR"/"DBFILE
+#define DBPATH tzplatform_mkpath(TZ_SYS_DB,DBFILE)
#define NOTIFICATION_QUERY_MAX 4096
--- /dev/null
+#!/bin/sh
+
+source /etc/tizen-platform.conf
+
+if [ ! -d $TZ_SYS_DB ]
+then
+ mkdir $TZ_SYS_DB
+fi
+
+if [ ! -f $TZ_SYS_DB/.notification.db ]
+then
+ sqlite3 $TZ_SYS_DB/.notification.db 'PRAGMA journal_mode = PERSIST;
+ create table if not exists noti_list (
+ type INTEGER NOT NULL,
+ layout INTEGER NOT NULL default 0,
+ caller_pkgname TEXT NOT NULL,
+ launch_pkgname TEXT,
+ image_path TEXT,
+ group_id INTEGER default 0,
+ internal_group_id INTEGER default 0,
+ priv_id INTERGER NOT NULL,
+ title_key TEXT,
+ b_text TEXT,
+ b_key TEXT,
+ b_format_args TEXT,
+ num_format_args INTEGER default 0,
+ text_domain TEXT,
+ text_dir TEXT,
+ time INTEGER default 0,
+ insert_time INTEGER default 0,
+ args TEXT,
+ group_args TEXT,
+ b_execute_option TEXT,
+ b_service_responding TEXT,
+ b_service_single_launch TEXT,
+ b_service_multi_launch TEXT,
+ sound_type INTEGER default 0,
+ sound_path TEXT,
+ vibration_type INTEGER default 0,
+ vibration_path TEXT,
+ led_operation INTEGER default 0,
+ led_argb INTEGER default 0,
+ led_on_ms INTEGER default -1,
+ led_off_ms INTEGER default -1,
+ flags_for_property INTEGER default 0,
+ flag_simmode INTEGER default 0,
+ display_applist INTEGER,
+ progress_size DOUBLE default 0,
+ progress_percentage DOUBLE default 0,
+ rowid INTEGER PRIMARY KEY AUTOINCREMENT,
+ UNIQUE (caller_pkgname, priv_id)
+ );
+ create table if not exists noti_group_data (
+ caller_pkgname TEXT NOT NULL,
+ group_id INTEGER default 0,
+ badge INTEGER default 0,
+ title TEXT,
+ content TEXT,
+ loc_title TEXT,
+ loc_content TEXT,
+ count_display_title INTEGER,
+ count_display_content INTEGER,
+ rowid INTEGER PRIMARY KEY AUTOINCREMENT,
+ UNIQUE (caller_pkgname, group_id)
+ );
+ create table if not exists ongoing_list (
+ caller_pkgname TEXT NOT NULL,
+ launch_pkgname TEXT,
+ icon_path TEXT,
+ group_id INTEGER default 0,
+ internal_group_id INTEGER default 0,
+ priv_id INTERGER NOT NULL,
+ title TEXT,
+ content TEXT,
+ default_content TEXT,
+ loc_title TEXT,
+ loc_content TEXT,
+ loc_default_content TEXT,
+ text_domain TEXT,
+ text_dir TEXT,
+ args TEXT,
+ group_args TEXT,
+ flag INTEGER default 0,
+ progress_size DOUBLE default 0,
+ progress_percentage DOUBLE default 0,
+ rowid INTEGER PRIMARY KEY AUTOINCREMENT,
+ UNIQUE (caller_pkgname, priv_id)
+ );
+ '
+fi
+
+users_gid=$(getent group $TZ_SYS_USER_GROUP | cut -f3 -d':')
+
+chown :$TZ_SYS_USER_GROUP $TZ_SYS_DB/.notification.db
+chown :$TZ_SYS_USER_GROUP $TZ_SYS_DB/.notification.db-journal
+chmod 640 $TZ_SYS_DB/.notification.db
+chmod 640 $TZ_SYS_DB/.notification.db-journal
+chsmack -a 'notification::db' $TZ_SYS_DB/.notification.db*
+SMACK_OPTION="-s system::vconf_misc"
+vconftool set -t string memory/private/libstatus/message "" -i -g $users_gid -f $SMACK_OPTION
BuildRequires: pkgconfig(com-core)
BuildRequires: pkgconfig(ecore)
BuildRequires: pkgconfig(eina)
+BuildRequires: pkgconfig(libtzplatform-config)
+Requires: libtzplatform-config
BuildRequires: cmake
Requires(post): /sbin/ldconfig
%post
/sbin/ldconfig
-
-if [ ! -d /opt/dbspace ]
-then
- mkdir /opt/dbspace
-fi
-
-if [ ! -f /opt/dbspace/.notification.db ]
-then
- sqlite3 /opt/dbspace/.notification.db 'PRAGMA journal_mode = PERSIST;
- create table if not exists noti_list (
- type INTEGER NOT NULL,
- layout INTEGER NOT NULL default 0,
- caller_pkgname TEXT NOT NULL,
- launch_pkgname TEXT,
- image_path TEXT,
- group_id INTEGER default 0,
- internal_group_id INTEGER default 0,
- priv_id INTERGER NOT NULL,
- title_key TEXT,
- b_text TEXT,
- b_key TEXT,
- b_format_args TEXT,
- num_format_args INTEGER default 0,
- text_domain TEXT,
- text_dir TEXT,
- time INTEGER default 0,
- insert_time INTEGER default 0,
- args TEXT,
- group_args TEXT,
- b_execute_option TEXT,
- b_service_responding TEXT,
- b_service_single_launch TEXT,
- b_service_multi_launch TEXT,
- sound_type INTEGER default 0,
- sound_path TEXT,
- vibration_type INTEGER default 0,
- vibration_path TEXT,
- led_operation INTEGER default 0,
- led_argb INTEGER default 0,
- led_on_ms INTEGER default -1,
- led_off_ms INTEGER default -1,
- flags_for_property INTEGER default 0,
- flag_simmode INTEGER default 0,
- display_applist INTEGER,
- progress_size DOUBLE default 0,
- progress_percentage DOUBLE default 0,
- rowid INTEGER PRIMARY KEY AUTOINCREMENT,
- UNIQUE (caller_pkgname, priv_id)
- );
- create table if not exists noti_group_data (
- caller_pkgname TEXT NOT NULL,
- group_id INTEGER default 0,
- badge INTEGER default 0,
- title TEXT,
- content TEXT,
- loc_title TEXT,
- loc_content TEXT,
- count_display_title INTEGER,
- count_display_content INTEGER,
- rowid INTEGER PRIMARY KEY AUTOINCREMENT,
- UNIQUE (caller_pkgname, group_id)
- );
- create table if not exists ongoing_list (
- caller_pkgname TEXT NOT NULL,
- launch_pkgname TEXT,
- icon_path TEXT,
- group_id INTEGER default 0,
- internal_group_id INTEGER default 0,
- priv_id INTERGER NOT NULL,
- title TEXT,
- content TEXT,
- default_content TEXT,
- loc_title TEXT,
- loc_content TEXT,
- loc_default_content TEXT,
- text_domain TEXT,
- text_dir TEXT,
- args TEXT,
- group_args TEXT,
- flag INTEGER default 0,
- progress_size DOUBLE default 0,
- progress_percentage DOUBLE default 0,
- rowid INTEGER PRIMARY KEY AUTOINCREMENT,
- UNIQUE (caller_pkgname, priv_id)
- );
- '
-fi
-
-chown :5000 /opt/dbspace/.notification.db
-chown :5000 /opt/dbspace/.notification.db-journal
-chmod 640 /opt/dbspace/.notification.db
-chmod 640 /opt/dbspace/.notification.db-journal
-chsmack -a 'notification::db' /opt/dbspace/.notification.db*
-SMACK_OPTION="-s system::vconf_misc"
-vconftool set -t string memory/private/libstatus/message "" -i -g 5000 -f $SMACK_OPTION
+%{_datadir}/%{name}/notification_DB_init.sh
%postun -p /sbin/ldconfig
%manifest notification.manifest
%defattr(-,root,root,-)
%{_libdir}/libnotification.so*
+%attr(0755,root,root) %{_datadir}/%{name}/notification_DB_init.sh
/usr/share/license/%{name}
%files devel
#include <notification_ipc.h>
#include <notification_setting.h>
#include <notification_internal.h>
+#include <tzplatform_config.h>
#define NOTIFICATION_SETTING_DB "notification_setting"
-#define NOTIFICATION_SETTING_DB_PATH "/opt/usr/dbspace/.notification_parser.db"
+#define NOTIFICATION_SETTING_DB_PATH tzplatform_mkpath(TZ_USER_DB,".notification_parser.db")
struct _notification_setting_h {
char *appid;