summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsangwan.kwon <sangwan.kwon@samsung.com>2016-09-09 15:50:29 +0900
committersangwan.kwon <sangwan.kwon@samsung.com>2016-09-09 15:50:29 +0900
commitba9c2ee976bfe2c93565074c1b76bfc25a660d5d (patch)
tree9e13504469115542f5dda17c664f2b26609cd9be
parent42738e314155f40b68361bc07ac89fcfd5bfdc69 (diff)
downloadcert-checker-submit/tizen/20160912.023936.tar.gz
cert-checker-submit/tizen/20160912.023936.tar.bz2
cert-checker-submit/tizen/20160912.023936.zip
Change-Id: Ic04d915b58c4f7ea6119eea0b77f637db123e7ac Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
-rw-r--r--CMakeLists.txt1
-rw-r--r--db/CMakeLists.txt1
-rw-r--r--packaging/cert-checker.spec12
-rwxr-xr-xscripts/CMakeLists.txt25
-rwxr-xr-xscripts/cert-checker-upgrade.sh.in27
5 files changed, 65 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8a2e264..2ff70e3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -116,3 +116,4 @@ ADD_SUBDIRECTORY(db)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(systemd)
ADD_SUBDIRECTORY(pkgconfig)
+ADD_SUBDIRECTORY(scripts)
diff --git a/db/CMakeLists.txt b/db/CMakeLists.txt
index 67fa8cd..5e7f680 100644
--- a/db/CMakeLists.txt
+++ b/db/CMakeLists.txt
@@ -12,3 +12,4 @@ ADD_CUSTOM_COMMAND(
ADD_CUSTOM_TARGET(DB ALL DEPENDS ${TARGET_DB} ${TARGET_DB_TESTS})
INSTALL(FILES ${TARGET_DB} ${TARGET_DB_TESTS} DESTINATION ${DB_INSTALL_DIR})
+INSTALL(FILES ${TARGET_DB} DESTINATION ${UPGRADE_DATA_DIR})
diff --git a/packaging/cert-checker.spec b/packaging/cert-checker.spec
index 5a0f5e6..d185415 100644
--- a/packaging/cert-checker.spec
+++ b/packaging/cert-checker.spec
@@ -45,6 +45,11 @@ Check OCSP validation at app install/uninstall time.
%global popup_env /run/tizen-system-env
%global popup_unitdir %{_unitdir_user}
+# upgrade macro
+%define upgrade_dir %{ro_data_dir}/upgrade
+%define upgrade_script_dir %{upgrade_dir}/scripts
+%define upgrade_data_dir %{upgrade_dir}/data
+
%package -n lib%{name}-common
Summary: Common Library package for %{name}
License: Apache-2.0
@@ -112,7 +117,9 @@ export LDFLAGS+="-Wl,--rpath=%{_libdir} "
-DDB_INSTALL_DIR=%{db_dir} \
-DPOPUP_ENV_PATH=%{popup_env} \
-DPOPUP_STREAM=%{popup_stream} \
- -DPOPUP_SYSTEMD_UNIT_DIR=%{popup_unitdir}
+ -DPOPUP_SYSTEMD_UNIT_DIR=%{popup_unitdir} \
+ -DUPGRADE_SCRIPT_DIR=%upgrade_script_dir \
+ -DUPGRADE_DATA_DIR=%upgrade_data_dir
make %{?_smp_mflags}
@@ -167,6 +174,9 @@ fi
%{popup_unitdir}/%{name}-popup.socket
%{popup_unitdir}/sockets.target.wants/%{name}-popup.socket
+%attr(755, root, root) %{upgrade_script_dir}/cert-checker-upgrade.sh
+%{upgrade_data_dir}/.%{name}.db
+
%files -n lib%{name}-common
%manifest %{name}-common.manifest
%license LICENSE
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
new file mode 100755
index 0000000..546906f
--- /dev/null
+++ b/scripts/CMakeLists.txt
@@ -0,0 +1,25 @@
+# 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 CMakeLists.txt
+# @author Sangwan Kwon (sangwan.kwon@samsung.com)
+#
+
+CONFIGURE_FILE(
+ cert-checker-upgrade.sh.in cert-checker-upgrade.sh
+ @ONLY)
+
+INSTALL(FILES
+ cert-checker-upgrade.sh
+ DESTINATION ${UPGRADE_SCRIPT_DIR})
diff --git a/scripts/cert-checker-upgrade.sh.in b/scripts/cert-checker-upgrade.sh.in
new file mode 100755
index 0000000..7285c93
--- /dev/null
+++ b/scripts/cert-checker-upgrade.sh.in
@@ -0,0 +1,27 @@
+#!/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 cert-checker-upgrade.sh.in
+# @author Sangwan Kwon (sangwan.kwon@samsung.com)
+# @brief cert-checker db migration scripts for platform upgrade 2.4 -> 3.0
+#
+
+cp @UPGRADE_DATA_DIR@/.@SERVICE_NAME@.db @DB_INSTALL_DIR@
+
+# change permission
+chown @USER_NAME@:@GROUP_NAME@ @DB_INSTALL_DIR@/.@SERVICE_NAME@.db
+chmod 600 @DB_INSTALL_DIR@/.@SERVICE_NAME@.db