upload tizen1.0 source
[framework/pim/libaccounts-svc.git] / debian / libaccounts-svc-0.postinst
1 #!/bin/sh
2 if [ ! -d /opt/dbspace ]
3 then
4         mkdir -p /opt/dbspace
5 fi
6
7 if [ ! -f /opt/dbspace/.account.db ]
8         rm -rf /opt/dbspace/.account.db*
9 then
10         sqlite3 /opt/dbspace/.account.db 'PRAGMA journal_mode = PERSIST;
11         CREATE TABLE if not exists account (_id INTEGER PRIMARY KEY AUTOINCREMENT, user_name TEXT, email_address TEXT,
12         display_name TEXT, icon_path TEXT, source TEXT, package_name TEXT, access_token TEXT, domain_name TEXT,
13         auth_type INTEGER, secret INTEGER, txt_custom0 TEXT, txt_custom1 TEXT, txt_custom2 TEXT, txt_custom3 TEXT, txt_custom4 TEXT,
14         int_custom0 INTEGER, int_custom1 INTEGER, int_custom2 INTEGER, int_custom3 INTEGER, int_custom4 INTEGER);
15
16         CREATE TABLE if not exists capability (_id INTEGER PRIMARY KEY AUTOINCREMENT, key INTEGER, value INTEGER, package_name TEXT, user_name TEXT, account_id INTEGER);'
17 fi
18
19
20 if [ ${USER} == "root" ]
21 then
22         if [ -f /opt/dbspace/.account.db ]
23         then
24                 chown 5000:5000 /opt/dbspace/.account.db
25         fi
26
27         if [ -f /opt/dbspace/.account.db-journal ]
28         then
29                 chown 5000:5000 /opt/dbspace/.account.db-journal
30         fi
31 fi
32
33 if [ -f /opt/dbspace/.account.db ]
34 then
35         chmod 660 /opt/dbspace/.account.db
36 fi
37
38 if [ -f /opt/dbspace/.account.db-journal ]
39 then
40         chmod 660 /opt/dbspace/.account.db-journal
41 fi