From: Kyungwook Tak Date: Mon, 5 Dec 2016 08:56:15 +0000 (+0900) Subject: Add upgrade script X-Git-Tag: accepted/tizen/common/20161227.192120~6 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fsecurity%2Fdrm-service-core-tizen.git;a=commitdiff_plain;h=9509f51c79f3f06ca588e32b9ff679b9e6931e3e Add upgrade script Update credentials of db resource Change-Id: I57ddcbd93b6b8ed7bdab3c3945d13857b2f544fc Signed-off-by: Kyungwook Tak --- diff --git a/packaging/drm-service-core-tizen.spec b/packaging/drm-service-core-tizen.spec index b05c9a9..70f86a4 100755 --- a/packaging/drm-service-core-tizen.spec +++ b/packaging/drm-service-core-tizen.spec @@ -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 index 0000000..a27d7ae --- /dev/null +++ b/scripts/200.drm-service-core-tizen.sh @@ -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*