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
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."
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
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
25 echo "Remove source file fail, please check if the source file exist: /opt/usr/media/tct/opt/$NAME ..."
30 -h|--help) echo "$USAGE"
34 *) echo "Unknown option: $1"