Enabled test cases to install to target
[platform/core/uifw/dali-toolkit.git] / automated-tests / templates / tct-package / inst.sh
1 #!/bin/bash
2 NAME=$(basename $(cd $(dirname $0);pwd))
3 PKG_DIR=%{PKG_DIR} # directory supplied by external script
4 PKG_NAME=%{PKG_NAME} # name supplied by external script
5 PKG_FULLNAME=%{PKG_FULLNAME} # name supplied by external script
6
7 #parse params
8 USAGE="Usage: ./inst.sh [-i] [-u]
9   -i install wgt and config environment
10   -u uninstall wgt and remove source file
11 [-i] option was set as default."
12
13 function installpkg(){
14     rpm -e `rpm -qa | grep $PKG_NAME`
15     rpm -ivh --quiet /$PKG_DIR/$PKG_FULLNAME
16     /tmp/add_all_smack_rule.sh
17 }
18
19 function uninstallpkg(){
20 ### remove source file ###
21 if [ -d /opt/usr/media/tct/opt/$NAME ];then
22     rm -rf /opt/usr/media/tct/opt/$NAME
23     rpm -e $PKG_NAME
24 else
25     echo "Remove source file fail, please check if the source file exist: /opt/usr/media/tct/opt/$NAME ..."
26 fi
27 }
28
29 case "$1" in
30     -h|--help) echo "$USAGE"
31                exit ;;
32     ""|-i) installpkg;;
33     -u) uninstallpkg;;
34     *) echo "Unknown option: $1"
35        echo "$USAGE"
36        exit ;;
37 esac