Initialize Tizen 2.3
[apps/home/smartsearch.git] / debian / org.tizen.smartsearch.postinst.in
1 #!/bin/sh
2
3 SEARCHPKG="org.tizen.smartsearch"
4
5 # create db
6 if [ ! -f /opt/apps/$SEARCHPKG/data/.search.db ]
7 then
8         sqlite3 /opt/apps/$SEARCHPKG/data/.search.db 'PRAGMA journal_mode = PERSIST;
9                                CREATE TABLE IF NOT EXISTS search_history (category int, keyword text not null, date TEXT, UNIQUE(category, keyword));'
10 fi                               
11
12 # owner & permission
13
14 if [ ${USER} == "root" ]
15 then
16     chown -R 5000:5000 /opt/apps/$SEARCHPKG/data
17     chown -R 5000:5000 /opt/apps/$SEARCHPKG/data/.search.db
18     chown -R 5000:5000 /opt/apps/$SEARCHPKG/data/.search.db-journal
19 fi
20
21 chmod 660 /opt/apps/$SEARCHPKG/data/.search.db
22 chmod 660 /opt/apps/$SEARCHPKG/data/.search.db-journal
23
24 #set default vconf key value
25 vconftool set -t int db/smartsearch/category 0 -u 5000 -g 5000
26 vconftool set -t string db/smartsearch/keyword '' -u 5000 -g 5000