summaryrefslogtreecommitdiff
path: root/debian/org.tizen.smartsearch.postinst.in
diff options
context:
space:
mode:
Diffstat (limited to 'debian/org.tizen.smartsearch.postinst.in')
-rwxr-xr-xdebian/org.tizen.smartsearch.postinst.in26
1 files changed, 26 insertions, 0 deletions
diff --git a/debian/org.tizen.smartsearch.postinst.in b/debian/org.tizen.smartsearch.postinst.in
new file mode 100755
index 0000000..61b094c
--- /dev/null
+++ b/debian/org.tizen.smartsearch.postinst.in
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+SEARCHPKG="org.tizen.smartsearch"
+
+# create db
+if [ ! -f /opt/apps/$SEARCHPKG/data/.search.db ]
+then
+ sqlite3 /opt/apps/$SEARCHPKG/data/.search.db 'PRAGMA journal_mode = PERSIST;
+ CREATE TABLE IF NOT EXISTS search_history (category int, keyword text not null, date TEXT, UNIQUE(category, keyword));'
+fi
+
+# owner & permission
+
+if [ ${USER} == "root" ]
+then
+ chown -R 5000:5000 /opt/apps/$SEARCHPKG/data
+ chown -R 5000:5000 /opt/apps/$SEARCHPKG/data/.search.db
+ chown -R 5000:5000 /opt/apps/$SEARCHPKG/data/.search.db-journal
+fi
+
+chmod 660 /opt/apps/$SEARCHPKG/data/.search.db
+chmod 660 /opt/apps/$SEARCHPKG/data/.search.db-journal
+
+#set default vconf key value
+vconftool set -t int db/smartsearch/category 0 -u 5000 -g 5000
+vconftool set -t string db/smartsearch/keyword '' -u 5000 -g 5000