add upgrade script 99/85399/4 accepted/tizen/common/20160831.161504 accepted/tizen/ivi/20160831.080027 accepted/tizen/mobile/20160831.075910 accepted/tizen/tv/20160831.075935 accepted/tizen/wearable/20160831.080002 submit/tizen/20160831.011016
authorIckhee Woo <ickhee.woo@samsung.com>
Thu, 25 Aug 2016 02:43:32 +0000 (11:43 +0900)
committerIckhee Woo <ickhee.woo@samsung.com>
Fri, 26 Aug 2016 07:29:59 +0000 (16:29 +0900)
Change-Id: I34857ebbfcf66111f53b4a90937a88aeabbe9997
Signed-off-by: Ickhee Woo <ickhee.woo@samsung.com>
packaging/push.spec
scripts/sppc-upgrade.sh [new file with mode: 0755]

index c34fcc4..f865965 100644 (file)
@@ -56,6 +56,9 @@ Requires:   %{name}-bin = %{version}-%{release}
 %description tool
 Push service tool
 
+%define _upgrade_script_path /usr/share/upgrade/scripts/
+%define _upgrade_script sppc-upgrade.sh
+
 %prep
 %setup -q
 
@@ -67,8 +70,8 @@ mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
 install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/pushd.service
 %install_service multi-user.target.wants pushd.service
 
-mkdir -p %{buildroot}/usr/share/license
-cp -f LICENSE %{buildroot}/usr/share/license/%{name}
+mkdir -p %{buildroot}/usr/share/licenses/%{name}
+cp -f LICENSE %{buildroot}/usr/share/licenses/%{name}
 
 mkdir -p %{buildroot}%{_includedir}
 cp -a include/push-service.h %{buildroot}%{_includedir}
@@ -83,6 +86,10 @@ cp -a push.pc %{buildroot}%{_libdir}/pkgconfig/
 mkdir -p %{buildroot}/usr/share/push/
 mkdir -p %{buildroot}%{_bindir}
 
+mkdir -p %{buildroot}%{_upgrade_script_path}
+cp -f scripts/%{_upgrade_script} %{buildroot}%{_upgrade_script_path}
+
+
 %ifarch %{arm}
 
 #libpush
@@ -207,8 +214,8 @@ mkdir -p %{TZ_SYS_GLOBALUSER_DB}
 sqlite3 %{TZ_SYS_GLOBALUSER_DB}/.push.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null
 chown service_fw:service_fw %{TZ_SYS_GLOBALUSER_DB}/.push.db
 chown service_fw:service_fw %{TZ_SYS_GLOBALUSER_DB}/.push.db-journal
-chmod 660 %{TZ_SYS_GLOBALUSER_DB}/.push.db
-chmod 660 %{TZ_SYS_GLOBALUSER_DB}/.push.db-journal
+chmod 644 %{TZ_SYS_GLOBALUSER_DB}/.push.db
+chmod 644 %{TZ_SYS_GLOBALUSER_DB}/.push.db-journal
 
 chsmack -a "*" %{TZ_SYS_GLOBALUSER_DB}/.push.db
 chsmack -a "*" %{TZ_SYS_GLOBALUSER_DB}/.push.db-journal
@@ -220,7 +227,7 @@ chsmack -a "*" %{TZ_SYS_GLOBALUSER_DB}/.push.db-journal
 
 %files -n libpush
 %manifest libpush.manifest
-%attr(644,service_fw,service_fw)%{_libdir}/libpush.so.*
+%attr(755,root,root) %{_libdir}/libpush.so.*
 
 %files -n libpush-devel
 %{_includedir}/*.h
@@ -230,8 +237,11 @@ chsmack -a "*" %{TZ_SYS_GLOBALUSER_DB}/.push.db-journal
 %files bin
 %manifest push-bin.manifest
 %{_bindir}/pushd
-%attr(644,service_fw,service_fw)/usr/share/push/*.cer
-%attr(644,service_fw,service_fw)/usr/share/license/%{name}
+%attr(600,service_fw,service_fw) /usr/share/push/*.cer
+%attr(644,root,root) /usr/share/licenses/%{name}/LICENSE
+
+%{_upgrade_script_path}%{_upgrade_script}
+%attr(755,root,root) %{_upgrade_script_path}%{_upgrade_script}
 
 %{_unitdir}/pushd.service
 %{_unitdir}/multi-user.target.wants/pushd.service
@@ -250,7 +260,7 @@ chsmack -a "*" %{TZ_SYS_GLOBALUSER_DB}/.push.db-journal
 * Mon Oct 22 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.25
 - bundle null check added & protobuf null check added
 * Wed Sep 19 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.24
-- when pkg is uninstlled, db process is added
+- when pkg is uninstalled, db process is added
 * Fri Sep 7 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.23
 - emul check logic is changed(using capi-system-info)
 * Tue Sep 4 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.22
diff --git a/scripts/sppc-upgrade.sh b/scripts/sppc-upgrade.sh
new file mode 100755 (executable)
index 0000000..b91d18b
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+##########################
+# sppc patch for upgrade #
+##########################
+
+# 2.4
+SPPC_SOCKET_DIR_24=/tmp
+SPPC_USERD_DIR_24=/usr/lib/systemd/user
+
+# 3.0
+SPPC_DB_DIR=/opt/usr/dbspace
+SPPC_CERT_DIR=/usr/share/push
+
+#Socket
+rm -rf $SPPC_SOCKET_DIR_24/push_unread
+rm -rf $SPPC_SOCKET_DIR_24/push_cli
+
+#Service
+rm -rf $SPPC_USERD_DIR_24/tizen-middleware.target.wants/pushd.service
+rm -rf $SPPC_USERD_DIR_24/pushd.service
+
+#Certification
+chown service_fw:service_fw $SPPC_CERT_DIR/*
+
+chmod 600 $SPPC_CERT_DIR/*
+
+#DB
+chown service_fw:service_fw $SPPC_DB_DIR/.push.db
+chown service_fw:service_fw $SPPC_DB_DIR/.push.db-journal
+
+chmod 644 $SPPC_DB_DIR/.push.db
+chmod 644 $SPPC_DB_DIR/.push.db-journal
+