summaryrefslogtreecommitdiff
path: root/debian/org.tizen.smartsearch.postinst.in
diff options
context:
space:
mode:
authorHyungKyu Song <hk76.song@samsung.com>2013-02-16 00:00:57 +0900
committerHyungKyu Song <hk76.song@samsung.com>2013-02-16 00:00:57 +0900
commitcc411fe3142413dc1341ad4d074d9596cd8bf3ef (patch)
tree13492e8870c607304fe4e80abae5cf49efc10bf9 /debian/org.tizen.smartsearch.postinst.in
parent636878b6968ffd73d0fee4722d992ecb47e9f3a4 (diff)
downloadsmartsearch-cc411fe3142413dc1341ad4d074d9596cd8bf3ef.tar.gz
smartsearch-cc411fe3142413dc1341ad4d074d9596cd8bf3ef.tar.bz2
smartsearch-cc411fe3142413dc1341ad4d074d9596cd8bf3ef.zip
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