%postun -n libnss-security-manager -p /sbin/ldconfig
%post policy
+%{_datadir}/security-manager/policy/update.sh
%{_bindir}/security-manager-policy-reload
%files -n security-manager
INSTALL(FILES "pkg-rules-template.smack" DESTINATION ${POLICY_DIR})
INSTALL(FILES "author-rules-template.smack" DESTINATION ${POLICY_DIR})
INSTALL(FILES "privilege-group.list" DESTINATION ${POLICY_DIR})
+INSTALL(PROGRAMS "update.sh" DESTINATION ${POLICY_DIR})
+INSTALL(DIRECTORY "updates" USE_SOURCE_PERMISSIONS DESTINATION ${POLICY_DIR})
INSTALL(FILES "policy-version" DESTINATION ${LOCAL_STATE_DIR}/security-manager/)
INSTALL(PROGRAMS security-manager-policy-reload DESTINATION ${BIN_INSTALL_DIR})
--- /dev/null
+#!/bin/sh -e
+
+export PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+. /etc/tizen-platform.conf
+
+policy_version_file=$TZ_SYS_VAR/security-manager/policy-version
+updates_dir=$TZ_SYS_RO_SHARE/security-manager/policy/updates
+
+current_version=`cat $policy_version_file`
+for file in `ls -v $updates_dir/update-policy-to-v*.sh`
+do
+ version=`echo $file | sed -r 's/.*-v([0-9]+)\.sh$/\1/'`
+ if [ $version -gt $current_version ]
+ then
+ echo Updating policy to v$version
+ $file
+ current_version=$version
+ echo $current_version >$policy_version_file
+ fi
+done
--- /dev/null
+#!/bin/sh -e
+
+export PATH=/sbin:/usr/sbin:/bin:/usr/bin
+
+. /etc/tizen-platform.conf
+
+echo "Initial version, nothing to do"