Add a scripts to upgrade shortcut db 34/86934/1 accepted/tizen/common/20160912.181357 submit/tizen/20160912.053645
authorMyungki Lee <mk5004.lee@samsung.com>
Mon, 5 Sep 2016 13:28:46 +0000 (22:28 +0900)
committerMyungki Lee <mk5004.lee@samsung.com>
Mon, 5 Sep 2016 13:29:31 +0000 (22:29 +0900)
Change-Id: I21911fbdc8f773caf45b82f98047c11d4f793a6e
Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
packaging/libshortcut.spec
scripts/107.shortcut_upgrade.sh [new file with mode: 0644]

index ba2eb54..169bd4d 100755 (executable)
@@ -21,6 +21,8 @@ BuildRequires: pkgconfig(capi-base-common)
 BuildRequires: pkgconfig(aul)
 BuildRequires: pkgconfig(libtzplatform-config)
 
+%define upgrade_script_path /usr/share/upgrade/scripts
+
 %description
 [Shortcut] AddToHome feature supporting library for menu/home screen developers.
 
@@ -46,6 +48,9 @@ rm -rf %{buildroot}
 %make_install
 mkdir -p %{buildroot}%{TZ_SYS_DB}
 
+mkdir -p %{buildroot}%{upgrade_script_path}
+cp -f scripts/107.shortcut_upgrade.sh %{buildroot}%{upgrade_script_path}
+
 %post
 /sbin/ldconfig
 
@@ -89,6 +94,7 @@ chsmack -a User::Home %{TZ_SYS_DB}/.shortcut_service.db-journal
 %{_libdir}/*.so*
 %{_sysconfdir}/package-manager/parserlib/*
 %{_datarootdir}/license/*
+%{upgrade_script_path}/107.shortcut_upgrade.sh
 
 %files devel
 %manifest %{name}.manifest
diff --git a/scripts/107.shortcut_upgrade.sh b/scripts/107.shortcut_upgrade.sh
new file mode 100644 (file)
index 0000000..3502b0a
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+#------------------------------------------#
+# shortcut upgrade (2.4 -> 3.0)                   #
+#------------------------------------------#
+
+# Macro
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+DB_DIR=/opt/dbspace
+DB_SHORTCUT=$DB_DIR/.shortcut_service.db
+
+chown owner:users $DB_SHORTCUT
+chown owner:users $DB_SHORTCUT-journal
+
+chsmack -a User::Home $DB_SHORTCUT
+chsmack -a User::Home $DB_SHORTCUT-journal