summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2013-07-18 01:13:19 (GMT)
committerSung-jae Park <nicesj.park@samsung.com>2013-07-18 01:13:19 (GMT)
commit5c379cf93870e75ccbbb6fd5eab6b9e0a7995be0 (patch)
treedc7db1b33375539ee4517a20db31701ca28a5c66
parent8d12f2a6f8aa3ae1ea213de58346f1c182933ee8 (diff)
downloaddata-provider-master-5c379cf93870e75ccbbb6fd5eab6b9e0a7995be0.zip
data-provider-master-5c379cf93870e75ccbbb6fd5eab6b9e0a7995be0.tar.gz
data-provider-master-5c379cf93870e75ccbbb6fd5eab6b9e0a7995be0.tar.bz2
Execute DDL for livebox DB if it is empty.
Change-Id: I802646f5a5c8323abfb3a56a79f4ce047ad9c561
-rw-r--r--packaging/data-provider-master.spec17
1 files changed, 15 insertions, 2 deletions
diff --git a/packaging/data-provider-master.spec b/packaging/data-provider-master.spec
index c1cf6e3..0e4c05b 100644
--- a/packaging/data-provider-master.spec
+++ b/packaging/data-provider-master.spec
@@ -1,6 +1,6 @@
Name: data-provider-master
Summary: Master service provider for liveboxes.
-Version: 0.24.20
+Version: 0.24.21
Release: 1
Group: HomeTF/Livebox
License: Flora License
@@ -61,12 +61,25 @@ mkdir -p %{buildroot}/opt/usr/share/live_magazine/log
mkdir -p %{buildroot}/opt/usr/share/live_magazine/reader
mkdir -p %{buildroot}/opt/usr/share/live_magazine/always
mkdir -p %{buildroot}/opt/dbspace
-mkdir -p %{buildroot}/%{_sysconfdir}/rc.d/rc3.d
+#mkdir -p %{buildroot}/%{_sysconfdir}/rc.d/rc3.d
mkdir -p %{buildroot}/%{_libdir}/systemd/user/tizen-middleware.target.wants
touch %{buildroot}/opt/dbspace/.livebox.db
touch %{buildroot}/opt/dbspace/.livebox.db-journal
#ln -sf %{_sysconfdir}/rc.d/init.d/data-provider-master %{buildroot}/%{_sysconfdir}/rc.d/rc3.d/S99data-provider-master
ln -sf %{_libdir}/systemd/user/data-provider-master.service %{buildroot}/%{_libdir}/systemd/user/tizen-middleware.target.wants/data-provider-master.service
+if [ ! -s ${buildroot}/opt/dbspace/.livebox.db ]; then
+echo "LiveBox DB file is not exists, initiate it"
+sqlite3 ${buildroot}/opt/dbspace/.livebox.db <<EOF
+CREATE TABLE box_size ( pkgid TEXT NOT NULL, size_type INTEGER, preview TEXT, touch_effect INTEGER, need_frame INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
+CREATE TABLE client (pkgid TEXT PRIMARY KEY NOT NULL, icon TEXT, name TEXT, auto_launch TEXT, pd_size TEXT, content TEXT DEFAULT 'default', nodisplay INTEGER, setup TEXT, mouse_event INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
+CREATE TABLE groupinfo ( id INTEGER PRIMARY KEY AUTOINCREMENT, cluster TEXT NOT NULL, category TEXT NOT NULL, pkgid TEXT NOT NULL, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
+CREATE TABLE groupmap (option_id INTEGER PRIMARY KEY AUTOINCREMENT, id INTEGER, pkgid TEXT NOT NULL, ctx_item TEXT NOT NULL, FOREIGN KEY(id) REFERENCES groupinfo(id), FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
+CREATE TABLE i18n ( pkgid TEXT NOT NULL, lang TEXT COLLATE NOCASE, name TEXT, icon TEXT, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
+CREATE TABLE option ( pkgid TEXT NOT NULL, option_id INTEGER, key TEXT NOT NULL, value TEXT NOT NULL, FOREIGN KEY(option_id) REFERENCES groupmap(option_id), FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
+CREATE TABLE pkgmap ( pkgid TEXT PRIMARY KEY NOT NULL, appid TEXT, uiapp TEXT, prime INTEGER );
+CREATE TABLE provider ( pkgid TEXT PRIMARY KEY NOT NULL, network INTEGER, abi TEXT, secured INTEGER, box_type INTEGER, box_src TEXT, box_group TEXT, pd_type INTEGER, pd_src TEXT, pd_group TEXT, libexec TEXT, timeout INTEGER, period TEXT, script TEXT, pinup INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
+EOF
+fi
%pre
# Executing the stop script for stopping the service of installed provider (old version)