Add upgrade script 64/102264/1
authorKyungwook Tak <k.tak@samsung.com>
Mon, 5 Dec 2016 08:56:15 +0000 (17:56 +0900)
committerKyungwook Tak <k.tak@samsung.com>
Mon, 5 Dec 2016 08:56:15 +0000 (17:56 +0900)
Update credentials of db resource

Change-Id: I57ddcbd93b6b8ed7bdab3c3945d13857b2f544fc
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
packaging/drm-service-core-tizen.spec
scripts/200.drm-service-core-tizen.sh [new file with mode: 0755]

index b05c9a9..70f86a4 100755 (executable)
@@ -14,9 +14,11 @@ BuildRequires:  pkgconfig(openssl)
 BuildRequires:  pkgconfig(cryptsvc)
 BuildRequires:  pkgconfig(libtzplatform-config)
 
+%global ro_share_dir %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:%_datadir}
 %global bin_dir %{?TZ_SYS_BIN:%TZ_SYS_BIN}%{!?TZ_SYS_BIN:%_bindir}
-%global ro_data_dir %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE/tizen_app_drm}%{!?TZ_SYS_RO_SHARE:%_datadir/tizen_app_drm}
-%global test_data_dir %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE/drm_test}%{!?TZ_SYS_RO_SHARE:%_datadir/drm_test}
+%global ro_data_dir %{ro_share_dir}/tizen_app_drm
+%global test_data_dir %{ro_share_dir}/drm_test
+%global upgrade_script_dir %{ro_share_dir}/upgrade/scripts
 %global db_dir %{?TZ_SYS_DB:%TZ_SYS_DB}%{!?TZ_SYS_DB:/opt/dbspace}
 
 %description
@@ -65,6 +67,8 @@ make %{?_smp_mflags}
 
 %install
 %make_install
+mkdir -p %{buildroot}%{upgrade_script_dir}
+cp scripts/200.drm-service-core-tizen.sh %{buildroot}%{upgrade_script_dir}/
 
 %post
 %{bin_dir}/rm -f /etc/ld.so.cache
@@ -82,6 +86,7 @@ chmod 600 %{db_dir}/.dtapps.db*
 %{_libdir}/lib%{name}.so.*
 %{bin_dir}/drm_tizen_initialize
 %{ro_data_dir}/root_certs/ro_root_cert.pem
+%{upgrade_script_dir}/200.drm-service-core-tizen.sh
 
 %files devel
 %{_libdir}/pkgconfig/%{name}.pc
diff --git a/scripts/200.drm-service-core-tizen.sh b/scripts/200.drm-service-core-tizen.sh
new file mode 100755 (executable)
index 0000000..a27d7ae
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+# 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        200.drm-service-core-tizen.sh
+# @author      Kyungwook Tak (k.tak@samsung.com)
+# @breif
+
+chsmack -a "System" /opt/dbspace/.dtapps.db*
+chown app_fw:app_fw /opt/dbspace/.dtapps.db*
+chmod 600 /opt/dbspace/.dtapps.db*