download-provider patch for upgrade 33/86033/1 accepted/tizen/common/20160830.150341 accepted/tizen/ivi/20160830.235716 accepted/tizen/mobile/20160830.235706 accepted/tizen/tv/20160830.235709 accepted/tizen/wearable/20160830.235712 submit/tizen/20160830.080136
authorjaekuk, lee <juku1999@samsung.com>
Tue, 30 Aug 2016 07:57:17 +0000 (16:57 +0900)
committerjaekuk, lee <juku1999@samsung.com>
Tue, 30 Aug 2016 07:57:17 +0000 (16:57 +0900)
Change-Id: I7f9dd69ae088c955d33ffcce6b6b22233907ed1b
Signed-off-by: jaekuk, lee <juku1999@samsung.com>
download-provider_upgrade.sh [new file with mode: 0755]
packaging/download-provider.spec

diff --git a/download-provider_upgrade.sh b/download-provider_upgrade.sh
new file mode 100755 (executable)
index 0000000..62aa9c5
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/sh
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+#-----------------------------------------------#
+# download-provider patch for upgrade (2.4 -> 3.0) #
+#-------------------------------------------------#
+
+# Macro
+DOWNLOAD_DIR_24=/opt/usr/media/Downloads
+DOWNLOAD_DIR_30=/opt/usr/home/owner/content/Downloads
+SOCK_DIR_24=/opt/data/download-provider
+DATA_INSTALL_DIR=/opt/usr/data/download-provider
+NOTIFY_DIR=$DATA_INSTALL_DIR/notify
+DATABASE_DIR=$DATA_INSTALL_DIR/database
+DATABASE_CLIENT_DIR=$DATABASE_DIR/clients
+
+
+# Move
+mv $DOWNLOAD_DIR_24/.temp_download $DOWNLOAD_DIR_30
+mv `find $DOWNLOAD_DIR_24/* -type f` $DOWNLOAD_DIR_30
+
+# Remove
+rm -r $SOCK_DIR_24
+
+# Set permission
+chown -R web_fw:web_fw $NOTIFY_DIR
+chsmack -a 'System::Shared' $NOTIFY_DIR
+chsmack -a 'System::Shared' $NOTIFY_DIR/*
+chsmack -t $NOTIFY_DIR
+
+chmod 700 $DATABASE_DIR
+chown -R web_fw:web_fw $DATABASE_DIR
+chsmack -a 'System' $DATABASE_DIR
+chsmack -a 'System' $DATABASE_DIR/.download-provider*
+
+chmod 700 $DATABASE_CLIENT_DIR
+chsmack -a 'System' $DATABASE_CLIENT_DIR
+chsmack -a 'System' $DATABASE_CLIENT_DIR/.org.tizen.download-manager*
+chown -R web_fw:web_fw $DATABASE_CLIENT_DIR
+chown -R web_fw:web_fw $DATA_INSTALL_DIR
+
+chmod g+s $DOWNLOAD_DIR_30/.temp_download
+chown owner:priv_mediastorage $DOWNLOAD_DIR_30/.temp_download
+chsmack -a User::App::Shared $DOWNLOAD_DIR_30/.temp_download
+chown owner:users $DOWNLOAD_DIR_30/*
+chsmack -a User::App::Shared $DOWNLOAD_DIR_30/*
\ No newline at end of file
index bff06a5..c68f453 100755 (executable)
@@ -1,7 +1,7 @@
 %define _ux_define tizen2.3
 Name:       download-provider
 Summary:    Download the contents in background
-Version:    2.1.62
+Version:    2.1.63
 Release:    0
 Group:      Development/Libraries
 License:    Apache-2.0
@@ -68,6 +68,7 @@ Description: Download the contents in background (development files)
 %define _licensedir /usr/share/license
 %define _logdump_script_dir %{TZ_SYS_ETC}/dump.d/module.d
 %define _http_lib libcurl
+%define upgrade_script_path /usr/share/upgrade/scripts
 
 %define download_booster OFF
 %define support_oma_drm OFF
@@ -185,6 +186,10 @@ mkdir -p %{buildroot}/lib/systemd/system/sockets.target.wants
 ln -s ../download-provider.service %{buildroot}/lib/systemd/system/graphical.target.wants/
 ln -s ../download-provider.socket %{buildroot}/lib/systemd/system/sockets.target.wants/
 
+#OS Upgrade
+mkdir -p %{buildroot}%{upgrade_script_path}
+cp -f download-provider_upgrade.sh %{buildroot}%{upgrade_script_path}
+
 %post
 #make notify dir in post section for smack
 mkdir %{TZ_SYS_GLOBALUSER_DATA}/download-provider
@@ -219,6 +224,7 @@ chown -R web_fw:web_fw %{_data_install_path}
 #%if 0%{?sec_product_feature_container_enable}
 %attr(0644,root,root) /etc/vasum/vsmzone.resource/download-provider.res
 #%endif
+%{upgrade_script_path}/download-provider_upgrade.sh
 
 %files devel
 %defattr(-,root,root,-)