Release notification lib for Tizen2.0 beta(tagging)
[apps/home/notification.git] / debian / libnotification-0.postinst.in
1 #!/bin/sh
2
3
4 if [ ! -d @DATADIR@/dbspace ]
5 then
6         mkdir @DATADIR@/dbspace
7 fi
8
9 if [ ! -f @DATADIR@/dbspace/.notification.db ]
10 then
11         sqlite3 @DATADIR@/dbspace/.notification.db 'PRAGMA journal_mode = PERSIST;
12                 create  table if not exists noti_list ( 
13                         type INTEGER NOT NULL,
14                         caller_pkgname TEXT NOT NULL,
15                         launch_pkgname TEXT,
16                         image_path TEXT,
17                         group_id INTEGER default 0,  
18                         internal_group_id INTEGER default 0,  
19                         priv_id INTERGER NOT NULL,  
20                         title_key TEXT,
21                         b_text TEXT,
22                         b_key TEXT,
23                         b_format_args TEXT,
24                         num_format_args INTEGER default 0,
25                         text_domain TEXT,
26                         text_dir TEXT,
27                         time INTEGER default 0,  
28                         insert_time INTEGER default 0,  
29                         args TEXT,  
30                         group_args TEXT,  
31                         b_execute_option TEXT,
32                         b_service_responding TEXT,
33                         b_service_single_launch TEXT,
34                         b_service_multi_launch TEXT,
35                         sound_type INTEGER default 0,
36                         sound_path TEXT,
37                         vibration_type INTEGER default 0,
38                         vibration_path TEXT,
39                         flags_for_property INTEGER default 0,
40                         flag_simmode INTEGER default 0,
41                         display_applist INTEGER,
42                         progress_size DOUBLE default 0,
43                         progress_percentage DOUBLE default 0,
44                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,        
45                         UNIQUE (caller_pkgname, priv_id)  
46                 ); 
47                 create table if not exists noti_group_data (
48                         caller_pkgname TEXT NOT NULL,
49                         group_id INTEGER default 0,
50                         badge INTEGER default 0,
51                         title TEXT,
52                         content TEXT,
53                         loc_title TEXT,
54                         loc_content TEXT,
55                         count_display_title INTEGER,
56                         count_display_content INTEGER,
57                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,
58                         UNIQUE (caller_pkgname, group_id)
59                 );
60                 create  table if not exists ongoing_list ( 
61                         caller_pkgname TEXT NOT NULL,
62                         launch_pkgname TEXT,
63                         icon_path TEXT,
64                         group_id INTEGER default 0,
65                         internal_group_id INTEGER default 0,  
66                         priv_id INTERGER NOT NULL,
67                         title TEXT,
68                         content TEXT,
69                         default_content TEXT,
70                         loc_title TEXT,
71                         loc_content TEXT,
72                         loc_default_content TEXT,
73                         text_domain TEXT,
74                         text_dir TEXT,
75                         args TEXT,  
76                         group_args TEXT,  
77                         flag INTEGER default 0,
78                         progress_size DOUBLE default 0,
79                         progress_percentage DOUBLE default 0,
80                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,        
81                         UNIQUE (caller_pkgname, priv_id)  
82                 ); 
83         '
84 fi
85
86 if [ ${USER} = "root" ]
87 then
88         chown root:5000 @DATADIR@/dbspace/.notification.db
89         chown root:5000 @DATADIR@/dbspace/.notification.db-journal
90 fi
91 chmod 660 @DATADIR@/dbspace/.notification.db
92 chmod 660 @DATADIR@/dbspace/.notification.db-journal