Add script to support platform upgrade scenario 18/85418/3
authorKyungwook Tak <k.tak@samsung.com>
Thu, 25 Aug 2016 05:09:39 +0000 (14:09 +0900)
committerKyungwook Tak <k.tak@samsung.com>
Fri, 26 Aug 2016 01:51:01 +0000 (10:51 +0900)
Change-Id: Id140e2877d8156019c715143f76947dbb4bb537c
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
CMakeLists.txt
data/scripts/csr-upgrade.sh.in [new file with mode: 0644]
packaging/csr-framework.spec

index 34cc1e8..28a5d86 100644 (file)
@@ -83,6 +83,7 @@ IF (PLATFORM_VERSION_3)
        SET(DECLARE_POPUP_SMACK_PROCESS_LABEL "")
        CONFIGURE_FILE(packaging/${SERVICE_NAME}.manifest.in ${SERVICE_NAME}.manifest @ONLY)
        CONFIGURE_FILE(packaging/${SERVICE_NAME}-test.manifest.in ${SERVICE_NAME}-test.manifest @ONLY)
+       CONFIGURE_FILE(data/scripts/${SERVICE_NAME}-upgrade.sh.in data/scripts/${SERVICE_NAME}-upgrade.sh @ONLY)
 ELSE (PLATFORM_VERSION_3)
        SET(DECLARE_POPUP_USER User=app)
        SET(DECLARE_POPUP_GROUP Group=app)
diff --git a/data/scripts/csr-upgrade.sh.in b/data/scripts/csr-upgrade.sh.in
new file mode 100644 (file)
index 0000000..66b30a3
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+# @file        csr-upgrade.sh.in
+# @author      Kyungwook Tak (k.tak@samsung.com)
+# @brief       Create RW data/directory for platform upgrade(2.4->3.0) scenario
+#
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+mkdir -p @RW_DBSPACE@ @ENGINE_RW_WORKING_DIR@
+chown @SERVICE_USER@:@SERVICE_GROUP@ @RW_DBSPACE@ @ENGINE_RW_WORKING_DIR@
+chsmack -t -a @SMACK_DOMAIN_NAME@ @RW_DBSPACE@ @ENGINE_RW_WORKING_DIR@
index af78217..e0ff04a 100644 (file)
@@ -73,6 +73,7 @@ file contents and checking url to prevent malicious items.
 %global popup_service_env_file_path  /run/tizen-system-env
 %global smack_domain_name            System
 %global popup_unitdir                %{_unitdir_user}
+%global upgrade_script_dir           %{ro_data_dir}/upgrade/scripts
 %else
 %global service_user                 system
 %global service_group                system
@@ -212,6 +213,11 @@ mkdir -p %{buildroot}%{rw_db_dir}
 mkdir -p %{buildroot}%{ro_db_dir}
 cp data/scripts/*.sql %{buildroot}%{ro_db_dir}
 
+%if "%{?tizen_version}" == "3.0"
+mkdir -p %{buildroot}%{upgrade_script_dir}
+cp data/scripts/%{service_name}-upgrade.sh %{buildroot}%{upgrade_script_dir}
+%endif
+
 mkdir -p %{buildroot}%{engine_dir}
 mkdir -p %{buildroot}%{engine_rw_working_dir}
 
@@ -294,6 +300,11 @@ chsmack -a "_" %{test_dir}/test_dir/dir1
 %dir %{engine_dir}
 %dir %attr(775, %{service_user}, %{service_group}) %{engine_rw_working_dir}
 
+# RW area platform upgrade script
+%if "%{?tizen_version}" == "3.0"
+%attr(755, -, -) %{upgrade_script_dir}/%{service_name}-upgrade.sh
+%endif
+
 %files -n lib%{name}-common
 %defattr(-,root,root,-)
 %manifest %{service_name}-common.manifest