Update wrt pack method to delete the installation action.
authoryugang <yugang.fan@intel.com>
Fri, 31 May 2013 02:50:58 +0000 (10:50 +0800)
committeryugang <yugang.fan@intel.com>
Fri, 31 May 2013 03:44:30 +0000 (11:44 +0800)
Change-Id: I0ee06c1e8112399086fd855ee6fb826e722d9531

22 files changed:
inst.sh
packaging/tct-wrt.spec
tct-extension-tests/Makefile.am
tct-extension-tests/pack.sh
tct-extension-tests/tct-extension-tests.spec
tct-management-tests/pack.sh
tct-management-tests/tct-management-tests.spec
tct-privacy-tests/Makefile.am
tct-privacy-tests/pack.sh
tct-privacy-tests/tct-privacy-tests.spec
tct-runtime-tests/Makefile.am
tct-runtime-tests/pack.sh
tct-runtime-tests/tct-runtime-tests.spec
tct-stability-tests/Makefile.am
tct-stability-tests/pack.sh
tct-stability-tests/tct-stability-tests.spec
tct-widget-tests/Makefile.am
tct-widget-tests/pack.sh
tct-widget-tests/tct-widget-tests.spec
tct-wrtui-tests/Makefile.am
tct-wrtui-tests/pack.sh
tct-wrtui-tests/tct-wrtui-tests.spec

diff --git a/inst.sh b/inst.sh
index 9cc363e..ca7b623 100755 (executable)
--- a/inst.sh
+++ b/inst.sh
@@ -52,8 +52,6 @@ function check_blackdir()
 
 echo "-->> Creating widgets >>--"
 cd $suite_dir
-rm -rf ./wgts
-mkdir -p ./wgts
 for app in $all_dirs; do
     check_blackdir $app
     if [ $? == 1 ]; then
@@ -62,9 +60,6 @@ for app in $all_dirs; do
     elif [ $(find $app|wc -l) -eq 1 ]; then
         echo "No files found in $app, skip it ..."
         continue
-    elif [ $app == "wgts" ]; then
-        echo "Skip wgts dir..."
-        continue
     else
         if [ -f $app.wgt ]; then
             echo "Delete old packaged file"
@@ -72,7 +67,7 @@ for app in $all_dirs; do
         fi
         cd $app
         echo "Start pack $app ..."
-        zip -rq ../wgts/$app.wgt *
+        zip -rq ../$app.wgt *
         if [ $? -ne 0 ]; then
             pack_fail='TRUE'
             echo "Create $app.wgt fail, continue to pack others"
@@ -82,10 +77,6 @@ for app in $all_dirs; do
     fi
 done
 echo "-- Create widgets done --"
-if [ -d "wgts" ]; then
-    cp -a wgts $build_root/opt/$suite_dir/
-    rm -rf ./wgts
-fi
 cd ..
 
 if [ $pack_fail != 'FALSE' ]; then
index afdabb0..2051b6d 100644 (file)
@@ -103,13 +103,6 @@ This is wrt webapp widget test suite package
 
 %build
 unset LD_AS_NEEDED  
-./autogen
-./configure --prefix=/usr
-make
-
-%install
-rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
 sh inst.sh "tct-extension-tests" $RPM_BUILD_ROOT
 sh inst.sh "tct-management-tests" $RPM_BUILD_ROOT
 sh inst.sh "tct-runtime-tests" $RPM_BUILD_ROOT
@@ -117,6 +110,13 @@ sh inst.sh "tct-wrtui-tests" $RPM_BUILD_ROOT
 sh inst.sh "tct-privacy-tests" $RPM_BUILD_ROOT
 sh inst.sh "tct-stability-tests" $RPM_BUILD_ROOT
 sh inst.sh "tct-widget-tests" $RPM_BUILD_ROOT
+./autogen
+./configure --prefix=/usr
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -154,213 +154,3 @@ rm -rf $RPM_BUILD_ROOT
 %files -n tct-widget-tests
 /opt/tct-widget-tests
 /usr/share/tct-widget-tests
-
-%post -n tct-extension-tests
-wgt_installer="wrt-installer"
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/tct-extension-tests/wgts/ -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      echo "Start install package $i_pkg"
-      [ -e $i_pkg ] && $wgt_installer -i $i_pkg
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-    done
-fi
-
-%post -n tct-management-tests
-wgt_installer="wrt-installer"
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/tct-management-tests/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      echo "Start install package $i_pkg"
-      [ -e $i_pkg ] && $wgt_installer -i $i_pkg
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-    done
-fi
-
-%post -n tct-runtime-tests
-wgt_installer="wrt-installer"
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/tct-runtime-tests/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      echo "Start install package $i_pkg"
-      [ -e $i_pkg ] && $wgt_installer -i $i_pkg
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-    done
-fi
-
-%post -n tct-wrtui-tests
-wgt_installer="wrt-installer"
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/tct-wrtui-tests/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      echo "Start install package $i_pkg"
-      [ -e $i_pkg ] && $wgt_installer -i $i_pkg
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-    done
-fi
-
-%post -n tct-privacy-tests
-wgt_installer="wrt-installer"
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/tct-privacy-tests/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      echo "Start install package $i_pkg"
-      [ -e $i_pkg ] && $wgt_installer -i $i_pkg
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-    done
-fi
-
-%post -n tct-stability-tests
-wgt_installer="wrt-installer"
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/tct-stability-tests/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      echo "Start install package $i_pkg"
-      [ -e $i_pkg ] && $wgt_installer -i $i_pkg
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-    done
-fi
-
-%post -n tct-widget-tests
-wgt_installer="wrt-installer"
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/tct-widget-tests/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      echo "Start install package $i_pkg"
-      [ -e $i_pkg ] && $wgt_installer -i $i_pkg
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-    done
-fi
-
-%preun -n tct-extension-tests
-wgt_installer="wrt-installer"
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/tct-extension-tests/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-      echo "Uninstall package $i_pkg_name"
-      i_pkg_nns=`wrt-launcher -l | grep $i_pkg_name | awk '{ print $NF }'`
-      for i_pkg_nn in $i_pkg_nns; do
-        echo "Package Name is $i_pkg_nn"
-        $wgt_installer -un $i_pkg_nn
-      done
-    done
-fi
-
-%preun -n tct-management-tests
-wgt_installer="wrt-installer"
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/tct-management-tests/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-      echo "Uninstall package $i_pkg_name"
-      i_pkg_nns=`wrt-launcher -l | grep $i_pkg_name | awk '{ print $NF }'`
-      for i_pkg_nn in $i_pkg_nns; do
-        echo "Package Name is $i_pkg_nn"
-        $wgt_installer -un $i_pkg_nn
-      done
-    done
-fi
-
-%preun -n tct-runtime-tests
-wgt_installer="wrt-installer"
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/tct-runtime-tests/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-      echo "Uninstall package $i_pkg_name"
-      i_pkg_nns=`wrt-launcher -l | grep $i_pkg_name | awk '{ print $NF }'`
-      for i_pkg_nn in $i_pkg_nns; do
-        echo "Package Name is $i_pkg_nn"
-        $wgt_installer -un $i_pkg_nn
-      done
-    done
-fi
-
-%preun -n tct-wrtui-tests
-wgt_installer="wrt-installer"
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/tct-wrtui-tests/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-      echo "Uninstall package $i_pkg_name"
-      i_pkg_nns=`wrt-launcher -l | grep $i_pkg_name | awk '{ print $NF }'`
-      for i_pkg_nn in $i_pkg_nns; do
-        echo "Package Name is $i_pkg_nn"
-        $wgt_installer -un $i_pkg_nn
-      done
-    done
-fi
-
-%preun -n tct-privacy-tests 
-wgt_installer="wrt-installer"
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/tct-privacy-tests/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-      echo "Uninstall package $i_pkg_name"
-      i_pkg_nns=`wrt-launcher -l | grep $i_pkg_name | awk '{ print $NF }'`
-      for i_pkg_nn in $i_pkg_nns; do
-        echo "Package Name is $i_pkg_nn"
-        $wgt_installer -un $i_pkg_nn
-      done
-    done
-fi
-
-%preun -n tct-stability-tests
-wgt_installer="wrt-installer"
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/tct-stability-tests/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-      echo "Uninstall package $i_pkg_name"
-      i_pkg_nns=`wrt-launcher -l | grep $i_pkg_name | awk '{ print $NF }'`
-      for i_pkg_nn in $i_pkg_nns; do
-        echo "Package Name is $i_pkg_nn"
-        $wgt_installer -un $i_pkg_nn
-      done
-    done
-fi
-
-%preun -n tct-widget-tests
-wgt_installer="wrt-installer"
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/tct-widget-tests/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-      echo "Uninstall package $i_pkg_name"
-      i_pkg_nns=`wrt-launcher -l | grep $i_pkg_name | awk '{ print $NF }'`
-      for i_pkg_nn in $i_pkg_nns; do
-        echo "Package Name is $i_pkg_nn"
-        $wgt_installer -un $i_pkg_nn
-      done
-    done
-fi
index 63b24a5..a68a8a9 100644 (file)
@@ -30,4 +30,4 @@
 testdefdir = $(datadir)/tct-extension-tests
 dist_testdef_DATA = tests.xml 
 docdir = /opt/tct-extension-tests
-dist_doc_DATA = Changelog README
+dist_doc_DATA = Changelog README *.wgt
index 5a70e84..8a9b8ab 100755 (executable)
 #               Fan, Yugang <yugang.fan@intel.com>
 #
 
-USAGE="Usage: ./pack.sh [-t <package type: all | rpm | zip> -s <subtype: wgt>]"
+USAGE="Usage: ./pack.sh"
 
 if [[ $1 == "-h" || $1 == "--help" ]]; then
     echo $USAGE
     exit 1
 fi
 
-type='None'
-subtype='None'
-
-while getopts t:s: o; do
-    case "$o" in
-    t)
-        type=$OPTARG
-        ;;
-    s)
-       subtype=$OPTARG
-        ;;
-    *)
-        echo $USAGE
-        exit 1
-        ;;
-    esac
-done
-
-if [ $type == 'None' ]; then
-    echo -e "Create package with default option \"all\""
-    type="all"
-fi
-
-if [ $subtype == 'None' ]; then
-    echo -e "Create sub package with default option \"wgt\""
-    subtype="wgt"
-fi
-
 pack_fail='FALSE'
 suite_dir=${PWD}
 all_dirs=`ls -l --time-style="long-iso" $suite_dir | grep '^d' | awk '{print $8}'`
@@ -92,48 +64,40 @@ if [ -z "$NAME" ];then
         exit 1
 fi
 
-if [ $subtype == "wgt" ]; then
-    echo "-->> Creating widgets >>--"
-    rm -rf ./wgts
-    mkdir -p ./wgts
-    for app in $all_dirs; do
-        check_blackdir $app
-        if [ $? == 1 ]; then
-            echo "Got a black dir: $app"
-            continue
-        elif [ $(find $app|wc -l) -eq 1 ]; then
-            echo "No files found in $app, skip it ..."
-            continue
-        elif [ $app == "wgts" ]; then
-            echo "Skip wgts dir..."
-            continue
+echo "-->> Creating widgets >>--"
+for app in $all_dirs; do
+    check_blackdir $app
+    if [ $? == 1 ]; then
+        echo "Got a black dir: $app"
+        continue
+    elif [ $(find $app|wc -l) -eq 1 ]; then
+        echo "No files found in $app, skip it ..."
+        continue
+    else
+        if [ -f $app.wgt ]; then
+            echo "Delete old packaged file"
+            rm -rf $app.wgt
+        fi 
+        cd $app
+        echo "Start pack $app ..."
+        zip -rq ../$app.wgt *
+        if [ $? -ne 0 ]; then
+            pack_fail='TRUE'
+            echo "Create $app.wgt fail, continue to pack others"
         else
-            if [ -f $app.wgt ]; then
-                echo "Delete old packaged file"
-                rm -rf $app.wgt
-            fi 
-            cd $app
-            echo "Start pack $app ..."
-            zip -rq ../wgts/$app.wgt *
-            if [ $? -ne 0 ]; then
-                pack_fail='TRUE'
-                echo "Create $app.wgt fail, continue to pack others"
-            else
+           if [ -d "../../signing" ]; then
+                echo "Start sign wgt ..."
                 cd ../../signing
-                ./sign-widget.sh --config default.conf ../$NAME/wgts/$app.wgt
+                ./sign-widget.sh --config default.conf ../$NAME/$app.wgt
                 cd -
-                echo -e "Done\n"
             fi
-            cd $suite_dir
-        fi 
-    done
-    echo "-- Create widgets done --"
-fi
+            echo -e "Done\n"
+        fi
+        cd $suite_dir
+    fi 
+done
+echo "-- Create widgets done --"
    
-if [ $subtype == "crx" ]; then
-    echo "Reserved for crx format ..."
-fi
-
 if [ $pack_fail != 'FALSE' ]; then
     echo "Fail to pack some packages ..."
     exit 1
@@ -178,7 +142,7 @@ mkdir -p $RPM_ROOT/RPMS $RPM_ROOT/SRPMS $RPM_ROOT/SPECS $RPM_ROOT/SOURCES $RPM_R
 
 # prepare
 echo "prepare workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-rm -rf *.rpm *.tar.bz2 *.tar.gz *.zip
+rm -rf *.rpm *.tar.bz2 *.tar.gz
 cp -a $SRC_ROOT/* $RPM_ROOT/src_tmp/$NAME-$VERSION
 # create Makefile in top src folder
 #cp $SRC_ROOT/top_Makefile $RPM_ROOT/src_tmp/$NAME-$VERSION/Makefile
@@ -190,27 +154,15 @@ cd -
 # build
 echo "build from workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 cd  $RPM_ROOT/SPECS
-rpmbuild -ba ${NAME}.spec --clean --define "_topdir $RPM_ROOT" --define="TYPE $type" --target=noarch
+rpmbuild -ba ${NAME}.spec --clean --define "_topdir $RPM_ROOT" --target=noarch
 cd -
 
 echo "copy from workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 echo "get packages......"
-if [ $type == 'all' ]; then
-        find $RPM_ROOT -name "$NAME*.zip" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-        find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-elif [ $type == 'zip' ]; then
-        find $RPM_ROOT -name "$NAME*.zip" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-        find $RPM_ROOT -name "$NAME*.src.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-else
-        find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-fi
+find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
 
 if [[ $platform != "" && $platform != "default" ]]; then
         cd $PWD
-        for file in `ls *.zip`; do
-                new_name=`echo $file | sed "s/\.zip/\.$platform\.zip/g"`
-                mv $file $new_name
-        done
         for file in `ls *.rpm`; do
                 new_name=`echo $file | sed "s/\.rpm/\.$platform\.rpm/g"`
                 mv $file $new_name
@@ -224,22 +176,15 @@ mv $RPM_ROOT/SOURCES/$NAME-$VERSION.$ARCHIVE_TYPE $PWD -f
 # clean
 echo "cleaning workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 rm -rf $RPM_ROOT
-rm -rf wgts
+rm -rf *.wgt
 
 # validate
 echo "checking result... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-if [ $type == 'all' ] || [ $type == 'zip' ]; then
-        if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ] || [ -z "`ls | grep "\.zip"`" ];then
-                echo "------------------------------ FAILED to build $NAME packages --------------------------"
-                exit 1
-        fi
-else
-        if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ];then
-                echo "------------------------------ FAILED to build $NAME packages --------------------------"
-                exit 1
-        fi
+if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ];then
+        echo "------------------------------ FAILED to build $NAME packages --------------------------"
+        exit 1
 fi
 
 echo "------------------------------ Done to build $NAME packages --------------------------"
-ls *.rpm *.$ARCHIVE_TYPE *.zip 2>/dev/null
+ls *.rpm *.$ARCHIVE_TYPE 2>/dev/null
 ##############################################################################
index 684dcc9..4b37e30 100644 (file)
@@ -23,14 +23,6 @@ make
 %install
 rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT
-if [ -d "wgts" ]; then
-    cp -a wgts $RPM_BUILD_ROOT/opt/%name/
-fi
-
-cp -a $RPM_BUILD_ROOT $RPM_BUILD_DIR/%name
-cd $RPM_BUILD_DIR
-zip -Drq %name-%version-%release.zip %name
-cd $RPM_BUILD_DIR/%name
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -40,49 +32,3 @@ rm -rf $RPM_BUILD_ROOT
 /usr/share/%name
 
 %changelog
-
-%post
-############## install/uninstall crx, wgt packge ####################
-crx_installer="chromium-browser"
-wgt_installer="wrt-installer"
-
-which $crx_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    echo "Reserved for crx package"
-fi
-
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/%name/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      echo "Start install package $i_pkg"
-      [ -e $i_pkg ] && $wgt_installer -i $i_pkg
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-    done
-fi
-
-%preun
-crx_installer="chromium-browser"
-wgt_installer="wrt-installer"
-
-which $crx_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    echo "Reserved for crx package"
-fi
-
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/%name/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-      echo "Uninstall package $i_pkg_name"
-      i_pkg_nns=`wrt-launcher -l | grep $i_pkg_name | awk '{ print $NF }'`
-      for i_pkg_nn in $i_pkg_nns; do
-       echo "Package Name is $i_pkg_nn"
-        $wgt_installer -un $i_pkg_nn
-      done
-    done
-fi
-########################## end ##############################
index 5a70e84..8a9b8ab 100755 (executable)
 #               Fan, Yugang <yugang.fan@intel.com>
 #
 
-USAGE="Usage: ./pack.sh [-t <package type: all | rpm | zip> -s <subtype: wgt>]"
+USAGE="Usage: ./pack.sh"
 
 if [[ $1 == "-h" || $1 == "--help" ]]; then
     echo $USAGE
     exit 1
 fi
 
-type='None'
-subtype='None'
-
-while getopts t:s: o; do
-    case "$o" in
-    t)
-        type=$OPTARG
-        ;;
-    s)
-       subtype=$OPTARG
-        ;;
-    *)
-        echo $USAGE
-        exit 1
-        ;;
-    esac
-done
-
-if [ $type == 'None' ]; then
-    echo -e "Create package with default option \"all\""
-    type="all"
-fi
-
-if [ $subtype == 'None' ]; then
-    echo -e "Create sub package with default option \"wgt\""
-    subtype="wgt"
-fi
-
 pack_fail='FALSE'
 suite_dir=${PWD}
 all_dirs=`ls -l --time-style="long-iso" $suite_dir | grep '^d' | awk '{print $8}'`
@@ -92,48 +64,40 @@ if [ -z "$NAME" ];then
         exit 1
 fi
 
-if [ $subtype == "wgt" ]; then
-    echo "-->> Creating widgets >>--"
-    rm -rf ./wgts
-    mkdir -p ./wgts
-    for app in $all_dirs; do
-        check_blackdir $app
-        if [ $? == 1 ]; then
-            echo "Got a black dir: $app"
-            continue
-        elif [ $(find $app|wc -l) -eq 1 ]; then
-            echo "No files found in $app, skip it ..."
-            continue
-        elif [ $app == "wgts" ]; then
-            echo "Skip wgts dir..."
-            continue
+echo "-->> Creating widgets >>--"
+for app in $all_dirs; do
+    check_blackdir $app
+    if [ $? == 1 ]; then
+        echo "Got a black dir: $app"
+        continue
+    elif [ $(find $app|wc -l) -eq 1 ]; then
+        echo "No files found in $app, skip it ..."
+        continue
+    else
+        if [ -f $app.wgt ]; then
+            echo "Delete old packaged file"
+            rm -rf $app.wgt
+        fi 
+        cd $app
+        echo "Start pack $app ..."
+        zip -rq ../$app.wgt *
+        if [ $? -ne 0 ]; then
+            pack_fail='TRUE'
+            echo "Create $app.wgt fail, continue to pack others"
         else
-            if [ -f $app.wgt ]; then
-                echo "Delete old packaged file"
-                rm -rf $app.wgt
-            fi 
-            cd $app
-            echo "Start pack $app ..."
-            zip -rq ../wgts/$app.wgt *
-            if [ $? -ne 0 ]; then
-                pack_fail='TRUE'
-                echo "Create $app.wgt fail, continue to pack others"
-            else
+           if [ -d "../../signing" ]; then
+                echo "Start sign wgt ..."
                 cd ../../signing
-                ./sign-widget.sh --config default.conf ../$NAME/wgts/$app.wgt
+                ./sign-widget.sh --config default.conf ../$NAME/$app.wgt
                 cd -
-                echo -e "Done\n"
             fi
-            cd $suite_dir
-        fi 
-    done
-    echo "-- Create widgets done --"
-fi
+            echo -e "Done\n"
+        fi
+        cd $suite_dir
+    fi 
+done
+echo "-- Create widgets done --"
    
-if [ $subtype == "crx" ]; then
-    echo "Reserved for crx format ..."
-fi
-
 if [ $pack_fail != 'FALSE' ]; then
     echo "Fail to pack some packages ..."
     exit 1
@@ -178,7 +142,7 @@ mkdir -p $RPM_ROOT/RPMS $RPM_ROOT/SRPMS $RPM_ROOT/SPECS $RPM_ROOT/SOURCES $RPM_R
 
 # prepare
 echo "prepare workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-rm -rf *.rpm *.tar.bz2 *.tar.gz *.zip
+rm -rf *.rpm *.tar.bz2 *.tar.gz
 cp -a $SRC_ROOT/* $RPM_ROOT/src_tmp/$NAME-$VERSION
 # create Makefile in top src folder
 #cp $SRC_ROOT/top_Makefile $RPM_ROOT/src_tmp/$NAME-$VERSION/Makefile
@@ -190,27 +154,15 @@ cd -
 # build
 echo "build from workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 cd  $RPM_ROOT/SPECS
-rpmbuild -ba ${NAME}.spec --clean --define "_topdir $RPM_ROOT" --define="TYPE $type" --target=noarch
+rpmbuild -ba ${NAME}.spec --clean --define "_topdir $RPM_ROOT" --target=noarch
 cd -
 
 echo "copy from workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 echo "get packages......"
-if [ $type == 'all' ]; then
-        find $RPM_ROOT -name "$NAME*.zip" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-        find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-elif [ $type == 'zip' ]; then
-        find $RPM_ROOT -name "$NAME*.zip" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-        find $RPM_ROOT -name "$NAME*.src.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-else
-        find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-fi
+find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
 
 if [[ $platform != "" && $platform != "default" ]]; then
         cd $PWD
-        for file in `ls *.zip`; do
-                new_name=`echo $file | sed "s/\.zip/\.$platform\.zip/g"`
-                mv $file $new_name
-        done
         for file in `ls *.rpm`; do
                 new_name=`echo $file | sed "s/\.rpm/\.$platform\.rpm/g"`
                 mv $file $new_name
@@ -224,22 +176,15 @@ mv $RPM_ROOT/SOURCES/$NAME-$VERSION.$ARCHIVE_TYPE $PWD -f
 # clean
 echo "cleaning workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 rm -rf $RPM_ROOT
-rm -rf wgts
+rm -rf *.wgt
 
 # validate
 echo "checking result... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-if [ $type == 'all' ] || [ $type == 'zip' ]; then
-        if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ] || [ -z "`ls | grep "\.zip"`" ];then
-                echo "------------------------------ FAILED to build $NAME packages --------------------------"
-                exit 1
-        fi
-else
-        if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ];then
-                echo "------------------------------ FAILED to build $NAME packages --------------------------"
-                exit 1
-        fi
+if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ];then
+        echo "------------------------------ FAILED to build $NAME packages --------------------------"
+        exit 1
 fi
 
 echo "------------------------------ Done to build $NAME packages --------------------------"
-ls *.rpm *.$ARCHIVE_TYPE *.zip 2>/dev/null
+ls *.rpm *.$ARCHIVE_TYPE 2>/dev/null
 ##############################################################################
index 024e1ec..4114ade 100644 (file)
@@ -23,14 +23,6 @@ make
 %install
 rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT
-if [ -d "wgts" ]; then
-    cp -a wgts $RPM_BUILD_ROOT/opt/%name/
-fi
-
-cp -a $RPM_BUILD_ROOT $RPM_BUILD_DIR/%name
-cd $RPM_BUILD_DIR
-zip -Drq %name-%version-%release.zip %name
-cd $RPM_BUILD_DIR/%name
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -38,52 +30,5 @@ rm -rf $RPM_BUILD_ROOT
 %files
 /opt/%name
 /usr/share/%name
-/opt/%name/resources
 
 %changelog
-
-%post
-############## install/uninstall crx, wgt packge ####################
-crx_installer="chromium-browser"
-wgt_installer="wrt-installer"
-
-which $crx_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    echo "Reserved for crx package"
-fi
-
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/%name/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      echo "Start install package $i_pkg"
-      [ -e $i_pkg ] && $wgt_installer -i $i_pkg
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-    done
-fi
-
-%preun
-crx_installer="chromium-browser"
-wgt_installer="wrt-installer"
-
-which $crx_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    echo "Reserved for crx package"
-fi
-
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/%name/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-      echo "Uninstall package $i_pkg_name"
-      i_pkg_nns=`wrt-launcher -l | grep $i_pkg_name | awk '{ print $NF }'`
-      for i_pkg_nn in $i_pkg_nns; do
-        echo "Package Name is $i_pkg_nn"
-        $wgt_installer -un $i_pkg_nn
-      done
-    done
-fi
-########################## end ##############################
index eb6ad55..756a48b 100644 (file)
@@ -30,4 +30,4 @@
 testdefdir = $(datadir)/tct-privacy-tests
 dist_testdef_DATA = tests.xml
 docdir = /opt/tct-privacy-tests
-dist_doc_DATA = Changelog README
+dist_doc_DATA = Changelog README *.wgt
index 5a70e84..8a9b8ab 100755 (executable)
 #               Fan, Yugang <yugang.fan@intel.com>
 #
 
-USAGE="Usage: ./pack.sh [-t <package type: all | rpm | zip> -s <subtype: wgt>]"
+USAGE="Usage: ./pack.sh"
 
 if [[ $1 == "-h" || $1 == "--help" ]]; then
     echo $USAGE
     exit 1
 fi
 
-type='None'
-subtype='None'
-
-while getopts t:s: o; do
-    case "$o" in
-    t)
-        type=$OPTARG
-        ;;
-    s)
-       subtype=$OPTARG
-        ;;
-    *)
-        echo $USAGE
-        exit 1
-        ;;
-    esac
-done
-
-if [ $type == 'None' ]; then
-    echo -e "Create package with default option \"all\""
-    type="all"
-fi
-
-if [ $subtype == 'None' ]; then
-    echo -e "Create sub package with default option \"wgt\""
-    subtype="wgt"
-fi
-
 pack_fail='FALSE'
 suite_dir=${PWD}
 all_dirs=`ls -l --time-style="long-iso" $suite_dir | grep '^d' | awk '{print $8}'`
@@ -92,48 +64,40 @@ if [ -z "$NAME" ];then
         exit 1
 fi
 
-if [ $subtype == "wgt" ]; then
-    echo "-->> Creating widgets >>--"
-    rm -rf ./wgts
-    mkdir -p ./wgts
-    for app in $all_dirs; do
-        check_blackdir $app
-        if [ $? == 1 ]; then
-            echo "Got a black dir: $app"
-            continue
-        elif [ $(find $app|wc -l) -eq 1 ]; then
-            echo "No files found in $app, skip it ..."
-            continue
-        elif [ $app == "wgts" ]; then
-            echo "Skip wgts dir..."
-            continue
+echo "-->> Creating widgets >>--"
+for app in $all_dirs; do
+    check_blackdir $app
+    if [ $? == 1 ]; then
+        echo "Got a black dir: $app"
+        continue
+    elif [ $(find $app|wc -l) -eq 1 ]; then
+        echo "No files found in $app, skip it ..."
+        continue
+    else
+        if [ -f $app.wgt ]; then
+            echo "Delete old packaged file"
+            rm -rf $app.wgt
+        fi 
+        cd $app
+        echo "Start pack $app ..."
+        zip -rq ../$app.wgt *
+        if [ $? -ne 0 ]; then
+            pack_fail='TRUE'
+            echo "Create $app.wgt fail, continue to pack others"
         else
-            if [ -f $app.wgt ]; then
-                echo "Delete old packaged file"
-                rm -rf $app.wgt
-            fi 
-            cd $app
-            echo "Start pack $app ..."
-            zip -rq ../wgts/$app.wgt *
-            if [ $? -ne 0 ]; then
-                pack_fail='TRUE'
-                echo "Create $app.wgt fail, continue to pack others"
-            else
+           if [ -d "../../signing" ]; then
+                echo "Start sign wgt ..."
                 cd ../../signing
-                ./sign-widget.sh --config default.conf ../$NAME/wgts/$app.wgt
+                ./sign-widget.sh --config default.conf ../$NAME/$app.wgt
                 cd -
-                echo -e "Done\n"
             fi
-            cd $suite_dir
-        fi 
-    done
-    echo "-- Create widgets done --"
-fi
+            echo -e "Done\n"
+        fi
+        cd $suite_dir
+    fi 
+done
+echo "-- Create widgets done --"
    
-if [ $subtype == "crx" ]; then
-    echo "Reserved for crx format ..."
-fi
-
 if [ $pack_fail != 'FALSE' ]; then
     echo "Fail to pack some packages ..."
     exit 1
@@ -178,7 +142,7 @@ mkdir -p $RPM_ROOT/RPMS $RPM_ROOT/SRPMS $RPM_ROOT/SPECS $RPM_ROOT/SOURCES $RPM_R
 
 # prepare
 echo "prepare workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-rm -rf *.rpm *.tar.bz2 *.tar.gz *.zip
+rm -rf *.rpm *.tar.bz2 *.tar.gz
 cp -a $SRC_ROOT/* $RPM_ROOT/src_tmp/$NAME-$VERSION
 # create Makefile in top src folder
 #cp $SRC_ROOT/top_Makefile $RPM_ROOT/src_tmp/$NAME-$VERSION/Makefile
@@ -190,27 +154,15 @@ cd -
 # build
 echo "build from workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 cd  $RPM_ROOT/SPECS
-rpmbuild -ba ${NAME}.spec --clean --define "_topdir $RPM_ROOT" --define="TYPE $type" --target=noarch
+rpmbuild -ba ${NAME}.spec --clean --define "_topdir $RPM_ROOT" --target=noarch
 cd -
 
 echo "copy from workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 echo "get packages......"
-if [ $type == 'all' ]; then
-        find $RPM_ROOT -name "$NAME*.zip" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-        find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-elif [ $type == 'zip' ]; then
-        find $RPM_ROOT -name "$NAME*.zip" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-        find $RPM_ROOT -name "$NAME*.src.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-else
-        find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-fi
+find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
 
 if [[ $platform != "" && $platform != "default" ]]; then
         cd $PWD
-        for file in `ls *.zip`; do
-                new_name=`echo $file | sed "s/\.zip/\.$platform\.zip/g"`
-                mv $file $new_name
-        done
         for file in `ls *.rpm`; do
                 new_name=`echo $file | sed "s/\.rpm/\.$platform\.rpm/g"`
                 mv $file $new_name
@@ -224,22 +176,15 @@ mv $RPM_ROOT/SOURCES/$NAME-$VERSION.$ARCHIVE_TYPE $PWD -f
 # clean
 echo "cleaning workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 rm -rf $RPM_ROOT
-rm -rf wgts
+rm -rf *.wgt
 
 # validate
 echo "checking result... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-if [ $type == 'all' ] || [ $type == 'zip' ]; then
-        if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ] || [ -z "`ls | grep "\.zip"`" ];then
-                echo "------------------------------ FAILED to build $NAME packages --------------------------"
-                exit 1
-        fi
-else
-        if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ];then
-                echo "------------------------------ FAILED to build $NAME packages --------------------------"
-                exit 1
-        fi
+if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ];then
+        echo "------------------------------ FAILED to build $NAME packages --------------------------"
+        exit 1
 fi
 
 echo "------------------------------ Done to build $NAME packages --------------------------"
-ls *.rpm *.$ARCHIVE_TYPE *.zip 2>/dev/null
+ls *.rpm *.$ARCHIVE_TYPE 2>/dev/null
 ##############################################################################
index 1cb07cf..9f4618d 100644 (file)
@@ -23,14 +23,6 @@ make
 %install
 rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT
-if [ -d "wgts" ]; then
-    cp -a wgts $RPM_BUILD_ROOT/opt/%name/
-fi
-
-cp -a $RPM_BUILD_ROOT $RPM_BUILD_DIR/%name
-cd $RPM_BUILD_DIR
-zip -Drq %name-%version-%release.zip %name
-cd $RPM_BUILD_DIR/%name
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -40,49 +32,3 @@ rm -rf $RPM_BUILD_ROOT
 /usr/share/%name
 
 %changelog
-
-%post
-############## install/uninstall crx, wgt packge ####################
-crx_installer="chromium-browser"
-wgt_installer="wrt-installer"
-
-which $crx_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    echo "Reserved for crx package"
-fi
-
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/%name/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      echo "Start install package $i_pkg"
-      [ -e $i_pkg ] && $wgt_installer -i $i_pkg
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-    done
-fi
-
-%preun
-crx_installer="chromium-browser"
-wgt_installer="wrt-installer"
-
-which $crx_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    echo "Reserved for crx package"
-fi
-
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/%name/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-      echo "Uninstall package $i_pkg_name"
-      i_pkg_nns=`wrt-launcher -l | grep $i_pkg_name | awk '{ print $NF }'`
-      for i_pkg_nn in $i_pkg_nns; do
-        echo "Package Name is $i_pkg_nn"
-        $wgt_installer -un $i_pkg_nn
-      done
-    done
-fi
-########################## end ##############################
index 8c9f47f..cd2d147 100644 (file)
@@ -30,4 +30,4 @@
 testdefdir = $(datadir)/tct-runtime-tests
 dist_testdef_DATA = tests.xml 
 docdir = /opt/tct-runtime-tests
-dist_doc_DATA = Changelog README
+dist_doc_DATA = Changelog README *.wgt
index 5a70e84..8a9b8ab 100755 (executable)
 #               Fan, Yugang <yugang.fan@intel.com>
 #
 
-USAGE="Usage: ./pack.sh [-t <package type: all | rpm | zip> -s <subtype: wgt>]"
+USAGE="Usage: ./pack.sh"
 
 if [[ $1 == "-h" || $1 == "--help" ]]; then
     echo $USAGE
     exit 1
 fi
 
-type='None'
-subtype='None'
-
-while getopts t:s: o; do
-    case "$o" in
-    t)
-        type=$OPTARG
-        ;;
-    s)
-       subtype=$OPTARG
-        ;;
-    *)
-        echo $USAGE
-        exit 1
-        ;;
-    esac
-done
-
-if [ $type == 'None' ]; then
-    echo -e "Create package with default option \"all\""
-    type="all"
-fi
-
-if [ $subtype == 'None' ]; then
-    echo -e "Create sub package with default option \"wgt\""
-    subtype="wgt"
-fi
-
 pack_fail='FALSE'
 suite_dir=${PWD}
 all_dirs=`ls -l --time-style="long-iso" $suite_dir | grep '^d' | awk '{print $8}'`
@@ -92,48 +64,40 @@ if [ -z "$NAME" ];then
         exit 1
 fi
 
-if [ $subtype == "wgt" ]; then
-    echo "-->> Creating widgets >>--"
-    rm -rf ./wgts
-    mkdir -p ./wgts
-    for app in $all_dirs; do
-        check_blackdir $app
-        if [ $? == 1 ]; then
-            echo "Got a black dir: $app"
-            continue
-        elif [ $(find $app|wc -l) -eq 1 ]; then
-            echo "No files found in $app, skip it ..."
-            continue
-        elif [ $app == "wgts" ]; then
-            echo "Skip wgts dir..."
-            continue
+echo "-->> Creating widgets >>--"
+for app in $all_dirs; do
+    check_blackdir $app
+    if [ $? == 1 ]; then
+        echo "Got a black dir: $app"
+        continue
+    elif [ $(find $app|wc -l) -eq 1 ]; then
+        echo "No files found in $app, skip it ..."
+        continue
+    else
+        if [ -f $app.wgt ]; then
+            echo "Delete old packaged file"
+            rm -rf $app.wgt
+        fi 
+        cd $app
+        echo "Start pack $app ..."
+        zip -rq ../$app.wgt *
+        if [ $? -ne 0 ]; then
+            pack_fail='TRUE'
+            echo "Create $app.wgt fail, continue to pack others"
         else
-            if [ -f $app.wgt ]; then
-                echo "Delete old packaged file"
-                rm -rf $app.wgt
-            fi 
-            cd $app
-            echo "Start pack $app ..."
-            zip -rq ../wgts/$app.wgt *
-            if [ $? -ne 0 ]; then
-                pack_fail='TRUE'
-                echo "Create $app.wgt fail, continue to pack others"
-            else
+           if [ -d "../../signing" ]; then
+                echo "Start sign wgt ..."
                 cd ../../signing
-                ./sign-widget.sh --config default.conf ../$NAME/wgts/$app.wgt
+                ./sign-widget.sh --config default.conf ../$NAME/$app.wgt
                 cd -
-                echo -e "Done\n"
             fi
-            cd $suite_dir
-        fi 
-    done
-    echo "-- Create widgets done --"
-fi
+            echo -e "Done\n"
+        fi
+        cd $suite_dir
+    fi 
+done
+echo "-- Create widgets done --"
    
-if [ $subtype == "crx" ]; then
-    echo "Reserved for crx format ..."
-fi
-
 if [ $pack_fail != 'FALSE' ]; then
     echo "Fail to pack some packages ..."
     exit 1
@@ -178,7 +142,7 @@ mkdir -p $RPM_ROOT/RPMS $RPM_ROOT/SRPMS $RPM_ROOT/SPECS $RPM_ROOT/SOURCES $RPM_R
 
 # prepare
 echo "prepare workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-rm -rf *.rpm *.tar.bz2 *.tar.gz *.zip
+rm -rf *.rpm *.tar.bz2 *.tar.gz
 cp -a $SRC_ROOT/* $RPM_ROOT/src_tmp/$NAME-$VERSION
 # create Makefile in top src folder
 #cp $SRC_ROOT/top_Makefile $RPM_ROOT/src_tmp/$NAME-$VERSION/Makefile
@@ -190,27 +154,15 @@ cd -
 # build
 echo "build from workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 cd  $RPM_ROOT/SPECS
-rpmbuild -ba ${NAME}.spec --clean --define "_topdir $RPM_ROOT" --define="TYPE $type" --target=noarch
+rpmbuild -ba ${NAME}.spec --clean --define "_topdir $RPM_ROOT" --target=noarch
 cd -
 
 echo "copy from workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 echo "get packages......"
-if [ $type == 'all' ]; then
-        find $RPM_ROOT -name "$NAME*.zip" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-        find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-elif [ $type == 'zip' ]; then
-        find $RPM_ROOT -name "$NAME*.zip" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-        find $RPM_ROOT -name "$NAME*.src.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-else
-        find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-fi
+find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
 
 if [[ $platform != "" && $platform != "default" ]]; then
         cd $PWD
-        for file in `ls *.zip`; do
-                new_name=`echo $file | sed "s/\.zip/\.$platform\.zip/g"`
-                mv $file $new_name
-        done
         for file in `ls *.rpm`; do
                 new_name=`echo $file | sed "s/\.rpm/\.$platform\.rpm/g"`
                 mv $file $new_name
@@ -224,22 +176,15 @@ mv $RPM_ROOT/SOURCES/$NAME-$VERSION.$ARCHIVE_TYPE $PWD -f
 # clean
 echo "cleaning workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 rm -rf $RPM_ROOT
-rm -rf wgts
+rm -rf *.wgt
 
 # validate
 echo "checking result... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-if [ $type == 'all' ] || [ $type == 'zip' ]; then
-        if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ] || [ -z "`ls | grep "\.zip"`" ];then
-                echo "------------------------------ FAILED to build $NAME packages --------------------------"
-                exit 1
-        fi
-else
-        if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ];then
-                echo "------------------------------ FAILED to build $NAME packages --------------------------"
-                exit 1
-        fi
+if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ];then
+        echo "------------------------------ FAILED to build $NAME packages --------------------------"
+        exit 1
 fi
 
 echo "------------------------------ Done to build $NAME packages --------------------------"
-ls *.rpm *.$ARCHIVE_TYPE *.zip 2>/dev/null
+ls *.rpm *.$ARCHIVE_TYPE 2>/dev/null
 ##############################################################################
index 50d6afa..37aba1c 100644 (file)
@@ -23,14 +23,6 @@ make
 %install
 rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT
-if [ -d "wgts" ]; then
-    cp -a wgts $RPM_BUILD_ROOT/opt/%name/
-fi
-
-cp -a $RPM_BUILD_ROOT $RPM_BUILD_DIR/%name
-cd $RPM_BUILD_DIR
-zip -Drq %name-%version-%release.zip %name
-cd $RPM_BUILD_DIR/%name
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -40,49 +32,3 @@ rm -rf $RPM_BUILD_ROOT
 /usr/share/%name
 
 %changelog
-
-%post
-############## install/uninstall crx, wgt packge ####################
-crx_installer="chromium-browser"
-wgt_installer="wrt-installer"
-
-which $crx_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    echo "Reserved for crx package"
-fi
-
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/%name/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      echo "Start install package $i_pkg"
-      [ -e $i_pkg ] && $wgt_installer -i $i_pkg
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-    done
-fi
-
-%preun
-crx_installer="chromium-browser"
-wgt_installer="wrt-installer"
-
-which $crx_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    echo "Reserved for crx package"
-fi
-
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/%name/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-      echo "Uninstall package $i_pkg_name"
-      i_pkg_nns=`wrt-launcher -l | grep $i_pkg_name | awk '{ print $NF }'`
-      for i_pkg_nn in $i_pkg_nns; do
-        echo "Package Name is $i_pkg_nn"
-        $wgt_installer -un $i_pkg_nn
-      done
-    done
-fi
-########################## end ##############################
index 4be84db..dce0fa7 100644 (file)
@@ -30,4 +30,4 @@
 testdefdir = $(datadir)/tct-stability-tests
 dist_testdef_DATA = tests.xml 
 docdir = /opt/tct-stability-tests
-dist_doc_DATA = Changelog README
+dist_doc_DATA = Changelog README *.wgt
index 5a70e84..8a9b8ab 100755 (executable)
 #               Fan, Yugang <yugang.fan@intel.com>
 #
 
-USAGE="Usage: ./pack.sh [-t <package type: all | rpm | zip> -s <subtype: wgt>]"
+USAGE="Usage: ./pack.sh"
 
 if [[ $1 == "-h" || $1 == "--help" ]]; then
     echo $USAGE
     exit 1
 fi
 
-type='None'
-subtype='None'
-
-while getopts t:s: o; do
-    case "$o" in
-    t)
-        type=$OPTARG
-        ;;
-    s)
-       subtype=$OPTARG
-        ;;
-    *)
-        echo $USAGE
-        exit 1
-        ;;
-    esac
-done
-
-if [ $type == 'None' ]; then
-    echo -e "Create package with default option \"all\""
-    type="all"
-fi
-
-if [ $subtype == 'None' ]; then
-    echo -e "Create sub package with default option \"wgt\""
-    subtype="wgt"
-fi
-
 pack_fail='FALSE'
 suite_dir=${PWD}
 all_dirs=`ls -l --time-style="long-iso" $suite_dir | grep '^d' | awk '{print $8}'`
@@ -92,48 +64,40 @@ if [ -z "$NAME" ];then
         exit 1
 fi
 
-if [ $subtype == "wgt" ]; then
-    echo "-->> Creating widgets >>--"
-    rm -rf ./wgts
-    mkdir -p ./wgts
-    for app in $all_dirs; do
-        check_blackdir $app
-        if [ $? == 1 ]; then
-            echo "Got a black dir: $app"
-            continue
-        elif [ $(find $app|wc -l) -eq 1 ]; then
-            echo "No files found in $app, skip it ..."
-            continue
-        elif [ $app == "wgts" ]; then
-            echo "Skip wgts dir..."
-            continue
+echo "-->> Creating widgets >>--"
+for app in $all_dirs; do
+    check_blackdir $app
+    if [ $? == 1 ]; then
+        echo "Got a black dir: $app"
+        continue
+    elif [ $(find $app|wc -l) -eq 1 ]; then
+        echo "No files found in $app, skip it ..."
+        continue
+    else
+        if [ -f $app.wgt ]; then
+            echo "Delete old packaged file"
+            rm -rf $app.wgt
+        fi 
+        cd $app
+        echo "Start pack $app ..."
+        zip -rq ../$app.wgt *
+        if [ $? -ne 0 ]; then
+            pack_fail='TRUE'
+            echo "Create $app.wgt fail, continue to pack others"
         else
-            if [ -f $app.wgt ]; then
-                echo "Delete old packaged file"
-                rm -rf $app.wgt
-            fi 
-            cd $app
-            echo "Start pack $app ..."
-            zip -rq ../wgts/$app.wgt *
-            if [ $? -ne 0 ]; then
-                pack_fail='TRUE'
-                echo "Create $app.wgt fail, continue to pack others"
-            else
+           if [ -d "../../signing" ]; then
+                echo "Start sign wgt ..."
                 cd ../../signing
-                ./sign-widget.sh --config default.conf ../$NAME/wgts/$app.wgt
+                ./sign-widget.sh --config default.conf ../$NAME/$app.wgt
                 cd -
-                echo -e "Done\n"
             fi
-            cd $suite_dir
-        fi 
-    done
-    echo "-- Create widgets done --"
-fi
+            echo -e "Done\n"
+        fi
+        cd $suite_dir
+    fi 
+done
+echo "-- Create widgets done --"
    
-if [ $subtype == "crx" ]; then
-    echo "Reserved for crx format ..."
-fi
-
 if [ $pack_fail != 'FALSE' ]; then
     echo "Fail to pack some packages ..."
     exit 1
@@ -178,7 +142,7 @@ mkdir -p $RPM_ROOT/RPMS $RPM_ROOT/SRPMS $RPM_ROOT/SPECS $RPM_ROOT/SOURCES $RPM_R
 
 # prepare
 echo "prepare workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-rm -rf *.rpm *.tar.bz2 *.tar.gz *.zip
+rm -rf *.rpm *.tar.bz2 *.tar.gz
 cp -a $SRC_ROOT/* $RPM_ROOT/src_tmp/$NAME-$VERSION
 # create Makefile in top src folder
 #cp $SRC_ROOT/top_Makefile $RPM_ROOT/src_tmp/$NAME-$VERSION/Makefile
@@ -190,27 +154,15 @@ cd -
 # build
 echo "build from workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 cd  $RPM_ROOT/SPECS
-rpmbuild -ba ${NAME}.spec --clean --define "_topdir $RPM_ROOT" --define="TYPE $type" --target=noarch
+rpmbuild -ba ${NAME}.spec --clean --define "_topdir $RPM_ROOT" --target=noarch
 cd -
 
 echo "copy from workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 echo "get packages......"
-if [ $type == 'all' ]; then
-        find $RPM_ROOT -name "$NAME*.zip" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-        find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-elif [ $type == 'zip' ]; then
-        find $RPM_ROOT -name "$NAME*.zip" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-        find $RPM_ROOT -name "$NAME*.src.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-else
-        find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-fi
+find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
 
 if [[ $platform != "" && $platform != "default" ]]; then
         cd $PWD
-        for file in `ls *.zip`; do
-                new_name=`echo $file | sed "s/\.zip/\.$platform\.zip/g"`
-                mv $file $new_name
-        done
         for file in `ls *.rpm`; do
                 new_name=`echo $file | sed "s/\.rpm/\.$platform\.rpm/g"`
                 mv $file $new_name
@@ -224,22 +176,15 @@ mv $RPM_ROOT/SOURCES/$NAME-$VERSION.$ARCHIVE_TYPE $PWD -f
 # clean
 echo "cleaning workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 rm -rf $RPM_ROOT
-rm -rf wgts
+rm -rf *.wgt
 
 # validate
 echo "checking result... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-if [ $type == 'all' ] || [ $type == 'zip' ]; then
-        if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ] || [ -z "`ls | grep "\.zip"`" ];then
-                echo "------------------------------ FAILED to build $NAME packages --------------------------"
-                exit 1
-        fi
-else
-        if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ];then
-                echo "------------------------------ FAILED to build $NAME packages --------------------------"
-                exit 1
-        fi
+if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ];then
+        echo "------------------------------ FAILED to build $NAME packages --------------------------"
+        exit 1
 fi
 
 echo "------------------------------ Done to build $NAME packages --------------------------"
-ls *.rpm *.$ARCHIVE_TYPE *.zip 2>/dev/null
+ls *.rpm *.$ARCHIVE_TYPE 2>/dev/null
 ##############################################################################
index b59514f..5b2dc8c 100644 (file)
@@ -23,14 +23,6 @@ make
 %install
 rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT
-if [ -d "wgts" ]; then
-    cp -a wgts $RPM_BUILD_ROOT/opt/%name/
-fi
-
-cp -a $RPM_BUILD_ROOT $RPM_BUILD_DIR/%name
-cd $RPM_BUILD_DIR
-zip -Drq %name-%version-%release.zip %name
-cd $RPM_BUILD_DIR/%name
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -40,49 +32,3 @@ rm -rf $RPM_BUILD_ROOT
 /usr/share/%name
 
 %changelog
-
-%post
-############## install/uninstall crx, wgt packge ####################
-crx_installer="chromium-browser"
-wgt_installer="wrt-installer"
-
-which $crx_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    echo "Reserved for crx package"
-fi
-
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/%name/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      echo "Start install package $i_pkg"
-      [ -e $i_pkg ] && $wgt_installer -i $i_pkg
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-    done
-fi
-
-%preun
-crx_installer="chromium-browser"
-wgt_installer="wrt-installer"
-
-which $crx_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    echo "Reserved for crx package"
-fi
-
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/%name/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-      echo "Uninstall package $i_pkg_name"
-      i_pkg_nns=`wrt-launcher -l | grep $i_pkg_name | awk '{ print $NF }'`
-      for i_pkg_nn in $i_pkg_nns; do
-       echo "Package Name is $i_pkg_nn"
-        $wgt_installer -un $i_pkg_nn
-      done
-    done
-fi
-########################## end ##############################
index 72339ee..78a1a93 100644 (file)
@@ -30,4 +30,4 @@
 testdefdir = $(datadir)/tct-widget-tests
 dist_testdef_DATA = tests.xml
 docdir = /opt/tct-widget-tests
-dist_doc_DATA = Changelog README
+dist_doc_DATA = Changelog README *.wgt
index 5a70e84..8a9b8ab 100755 (executable)
 #               Fan, Yugang <yugang.fan@intel.com>
 #
 
-USAGE="Usage: ./pack.sh [-t <package type: all | rpm | zip> -s <subtype: wgt>]"
+USAGE="Usage: ./pack.sh"
 
 if [[ $1 == "-h" || $1 == "--help" ]]; then
     echo $USAGE
     exit 1
 fi
 
-type='None'
-subtype='None'
-
-while getopts t:s: o; do
-    case "$o" in
-    t)
-        type=$OPTARG
-        ;;
-    s)
-       subtype=$OPTARG
-        ;;
-    *)
-        echo $USAGE
-        exit 1
-        ;;
-    esac
-done
-
-if [ $type == 'None' ]; then
-    echo -e "Create package with default option \"all\""
-    type="all"
-fi
-
-if [ $subtype == 'None' ]; then
-    echo -e "Create sub package with default option \"wgt\""
-    subtype="wgt"
-fi
-
 pack_fail='FALSE'
 suite_dir=${PWD}
 all_dirs=`ls -l --time-style="long-iso" $suite_dir | grep '^d' | awk '{print $8}'`
@@ -92,48 +64,40 @@ if [ -z "$NAME" ];then
         exit 1
 fi
 
-if [ $subtype == "wgt" ]; then
-    echo "-->> Creating widgets >>--"
-    rm -rf ./wgts
-    mkdir -p ./wgts
-    for app in $all_dirs; do
-        check_blackdir $app
-        if [ $? == 1 ]; then
-            echo "Got a black dir: $app"
-            continue
-        elif [ $(find $app|wc -l) -eq 1 ]; then
-            echo "No files found in $app, skip it ..."
-            continue
-        elif [ $app == "wgts" ]; then
-            echo "Skip wgts dir..."
-            continue
+echo "-->> Creating widgets >>--"
+for app in $all_dirs; do
+    check_blackdir $app
+    if [ $? == 1 ]; then
+        echo "Got a black dir: $app"
+        continue
+    elif [ $(find $app|wc -l) -eq 1 ]; then
+        echo "No files found in $app, skip it ..."
+        continue
+    else
+        if [ -f $app.wgt ]; then
+            echo "Delete old packaged file"
+            rm -rf $app.wgt
+        fi 
+        cd $app
+        echo "Start pack $app ..."
+        zip -rq ../$app.wgt *
+        if [ $? -ne 0 ]; then
+            pack_fail='TRUE'
+            echo "Create $app.wgt fail, continue to pack others"
         else
-            if [ -f $app.wgt ]; then
-                echo "Delete old packaged file"
-                rm -rf $app.wgt
-            fi 
-            cd $app
-            echo "Start pack $app ..."
-            zip -rq ../wgts/$app.wgt *
-            if [ $? -ne 0 ]; then
-                pack_fail='TRUE'
-                echo "Create $app.wgt fail, continue to pack others"
-            else
+           if [ -d "../../signing" ]; then
+                echo "Start sign wgt ..."
                 cd ../../signing
-                ./sign-widget.sh --config default.conf ../$NAME/wgts/$app.wgt
+                ./sign-widget.sh --config default.conf ../$NAME/$app.wgt
                 cd -
-                echo -e "Done\n"
             fi
-            cd $suite_dir
-        fi 
-    done
-    echo "-- Create widgets done --"
-fi
+            echo -e "Done\n"
+        fi
+        cd $suite_dir
+    fi 
+done
+echo "-- Create widgets done --"
    
-if [ $subtype == "crx" ]; then
-    echo "Reserved for crx format ..."
-fi
-
 if [ $pack_fail != 'FALSE' ]; then
     echo "Fail to pack some packages ..."
     exit 1
@@ -178,7 +142,7 @@ mkdir -p $RPM_ROOT/RPMS $RPM_ROOT/SRPMS $RPM_ROOT/SPECS $RPM_ROOT/SOURCES $RPM_R
 
 # prepare
 echo "prepare workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-rm -rf *.rpm *.tar.bz2 *.tar.gz *.zip
+rm -rf *.rpm *.tar.bz2 *.tar.gz
 cp -a $SRC_ROOT/* $RPM_ROOT/src_tmp/$NAME-$VERSION
 # create Makefile in top src folder
 #cp $SRC_ROOT/top_Makefile $RPM_ROOT/src_tmp/$NAME-$VERSION/Makefile
@@ -190,27 +154,15 @@ cd -
 # build
 echo "build from workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 cd  $RPM_ROOT/SPECS
-rpmbuild -ba ${NAME}.spec --clean --define "_topdir $RPM_ROOT" --define="TYPE $type" --target=noarch
+rpmbuild -ba ${NAME}.spec --clean --define "_topdir $RPM_ROOT" --target=noarch
 cd -
 
 echo "copy from workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 echo "get packages......"
-if [ $type == 'all' ]; then
-        find $RPM_ROOT -name "$NAME*.zip" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-        find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-elif [ $type == 'zip' ]; then
-        find $RPM_ROOT -name "$NAME*.zip" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-        find $RPM_ROOT -name "$NAME*.src.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-else
-        find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-fi
+find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
 
 if [[ $platform != "" && $platform != "default" ]]; then
         cd $PWD
-        for file in `ls *.zip`; do
-                new_name=`echo $file | sed "s/\.zip/\.$platform\.zip/g"`
-                mv $file $new_name
-        done
         for file in `ls *.rpm`; do
                 new_name=`echo $file | sed "s/\.rpm/\.$platform\.rpm/g"`
                 mv $file $new_name
@@ -224,22 +176,15 @@ mv $RPM_ROOT/SOURCES/$NAME-$VERSION.$ARCHIVE_TYPE $PWD -f
 # clean
 echo "cleaning workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 rm -rf $RPM_ROOT
-rm -rf wgts
+rm -rf *.wgt
 
 # validate
 echo "checking result... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-if [ $type == 'all' ] || [ $type == 'zip' ]; then
-        if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ] || [ -z "`ls | grep "\.zip"`" ];then
-                echo "------------------------------ FAILED to build $NAME packages --------------------------"
-                exit 1
-        fi
-else
-        if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ];then
-                echo "------------------------------ FAILED to build $NAME packages --------------------------"
-                exit 1
-        fi
+if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ];then
+        echo "------------------------------ FAILED to build $NAME packages --------------------------"
+        exit 1
 fi
 
 echo "------------------------------ Done to build $NAME packages --------------------------"
-ls *.rpm *.$ARCHIVE_TYPE *.zip 2>/dev/null
+ls *.rpm *.$ARCHIVE_TYPE 2>/dev/null
 ##############################################################################
index e67ac92..76a09b5 100644 (file)
@@ -23,14 +23,6 @@ make
 %install
 rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT
-if [ -d "wgts" ]; then
-    cp -a wgts $RPM_BUILD_ROOT/opt/%name/
-fi
-
-cp -a $RPM_BUILD_ROOT $RPM_BUILD_DIR/%name
-cd $RPM_BUILD_DIR
-zip -Drq %name-%version-%release.zip %name
-cd $RPM_BUILD_DIR/%name
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -40,49 +32,3 @@ rm -rf $RPM_BUILD_ROOT
 /usr/share/%name
 
 %changelog
-
-%post
-############## install/uninstall crx, wgt packge ####################
-crx_installer="chromium-browser"
-wgt_installer="wrt-installer"
-
-which $crx_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    echo "Reserved for crx package"
-fi
-
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/%name/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      echo "Start install package $i_pkg"
-      [ -e $i_pkg ] && $wgt_installer -i $i_pkg
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-    done
-fi
-
-%preun
-crx_installer="chromium-browser"
-wgt_installer="wrt-installer"
-
-which $crx_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    echo "Reserved for crx package"
-fi
-
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/%name/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-      echo "Uninstall package $i_pkg_name"
-      i_pkg_nns=`wrt-launcher -l | grep $i_pkg_name | awk '{ print $NF }'`
-      for i_pkg_nn in $i_pkg_nns; do
-        echo "Package Name is $i_pkg_nn"
-        $wgt_installer -un $i_pkg_nn
-      done
-    done
-fi
-########################## end ##############################
index 3f14099..e3dc69a 100644 (file)
@@ -30,4 +30,4 @@
 testdefdir = $(datadir)/tct-wrtui-tests
 dist_testdef_DATA = tests.xml 
 docdir = /opt/tct-wrtui-tests
-dist_doc_DATA = Changelog
+dist_doc_DATA = Changelog *.wgt
index 5a70e84..8a9b8ab 100755 (executable)
 #               Fan, Yugang <yugang.fan@intel.com>
 #
 
-USAGE="Usage: ./pack.sh [-t <package type: all | rpm | zip> -s <subtype: wgt>]"
+USAGE="Usage: ./pack.sh"
 
 if [[ $1 == "-h" || $1 == "--help" ]]; then
     echo $USAGE
     exit 1
 fi
 
-type='None'
-subtype='None'
-
-while getopts t:s: o; do
-    case "$o" in
-    t)
-        type=$OPTARG
-        ;;
-    s)
-       subtype=$OPTARG
-        ;;
-    *)
-        echo $USAGE
-        exit 1
-        ;;
-    esac
-done
-
-if [ $type == 'None' ]; then
-    echo -e "Create package with default option \"all\""
-    type="all"
-fi
-
-if [ $subtype == 'None' ]; then
-    echo -e "Create sub package with default option \"wgt\""
-    subtype="wgt"
-fi
-
 pack_fail='FALSE'
 suite_dir=${PWD}
 all_dirs=`ls -l --time-style="long-iso" $suite_dir | grep '^d' | awk '{print $8}'`
@@ -92,48 +64,40 @@ if [ -z "$NAME" ];then
         exit 1
 fi
 
-if [ $subtype == "wgt" ]; then
-    echo "-->> Creating widgets >>--"
-    rm -rf ./wgts
-    mkdir -p ./wgts
-    for app in $all_dirs; do
-        check_blackdir $app
-        if [ $? == 1 ]; then
-            echo "Got a black dir: $app"
-            continue
-        elif [ $(find $app|wc -l) -eq 1 ]; then
-            echo "No files found in $app, skip it ..."
-            continue
-        elif [ $app == "wgts" ]; then
-            echo "Skip wgts dir..."
-            continue
+echo "-->> Creating widgets >>--"
+for app in $all_dirs; do
+    check_blackdir $app
+    if [ $? == 1 ]; then
+        echo "Got a black dir: $app"
+        continue
+    elif [ $(find $app|wc -l) -eq 1 ]; then
+        echo "No files found in $app, skip it ..."
+        continue
+    else
+        if [ -f $app.wgt ]; then
+            echo "Delete old packaged file"
+            rm -rf $app.wgt
+        fi 
+        cd $app
+        echo "Start pack $app ..."
+        zip -rq ../$app.wgt *
+        if [ $? -ne 0 ]; then
+            pack_fail='TRUE'
+            echo "Create $app.wgt fail, continue to pack others"
         else
-            if [ -f $app.wgt ]; then
-                echo "Delete old packaged file"
-                rm -rf $app.wgt
-            fi 
-            cd $app
-            echo "Start pack $app ..."
-            zip -rq ../wgts/$app.wgt *
-            if [ $? -ne 0 ]; then
-                pack_fail='TRUE'
-                echo "Create $app.wgt fail, continue to pack others"
-            else
+           if [ -d "../../signing" ]; then
+                echo "Start sign wgt ..."
                 cd ../../signing
-                ./sign-widget.sh --config default.conf ../$NAME/wgts/$app.wgt
+                ./sign-widget.sh --config default.conf ../$NAME/$app.wgt
                 cd -
-                echo -e "Done\n"
             fi
-            cd $suite_dir
-        fi 
-    done
-    echo "-- Create widgets done --"
-fi
+            echo -e "Done\n"
+        fi
+        cd $suite_dir
+    fi 
+done
+echo "-- Create widgets done --"
    
-if [ $subtype == "crx" ]; then
-    echo "Reserved for crx format ..."
-fi
-
 if [ $pack_fail != 'FALSE' ]; then
     echo "Fail to pack some packages ..."
     exit 1
@@ -178,7 +142,7 @@ mkdir -p $RPM_ROOT/RPMS $RPM_ROOT/SRPMS $RPM_ROOT/SPECS $RPM_ROOT/SOURCES $RPM_R
 
 # prepare
 echo "prepare workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-rm -rf *.rpm *.tar.bz2 *.tar.gz *.zip
+rm -rf *.rpm *.tar.bz2 *.tar.gz
 cp -a $SRC_ROOT/* $RPM_ROOT/src_tmp/$NAME-$VERSION
 # create Makefile in top src folder
 #cp $SRC_ROOT/top_Makefile $RPM_ROOT/src_tmp/$NAME-$VERSION/Makefile
@@ -190,27 +154,15 @@ cd -
 # build
 echo "build from workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 cd  $RPM_ROOT/SPECS
-rpmbuild -ba ${NAME}.spec --clean --define "_topdir $RPM_ROOT" --define="TYPE $type" --target=noarch
+rpmbuild -ba ${NAME}.spec --clean --define "_topdir $RPM_ROOT" --target=noarch
 cd -
 
 echo "copy from workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 echo "get packages......"
-if [ $type == 'all' ]; then
-        find $RPM_ROOT -name "$NAME*.zip" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-        find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-elif [ $type == 'zip' ]; then
-        find $RPM_ROOT -name "$NAME*.zip" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-        find $RPM_ROOT -name "$NAME*.src.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-else
-        find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
-fi
+find $RPM_ROOT -name "$NAME*.rpm" | grep -v debuginfo | xargs -n1 -I {} mv {} $PWD -f
 
 if [[ $platform != "" && $platform != "default" ]]; then
         cd $PWD
-        for file in `ls *.zip`; do
-                new_name=`echo $file | sed "s/\.zip/\.$platform\.zip/g"`
-                mv $file $new_name
-        done
         for file in `ls *.rpm`; do
                 new_name=`echo $file | sed "s/\.rpm/\.$platform\.rpm/g"`
                 mv $file $new_name
@@ -224,22 +176,15 @@ mv $RPM_ROOT/SOURCES/$NAME-$VERSION.$ARCHIVE_TYPE $PWD -f
 # clean
 echo "cleaning workspace... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
 rm -rf $RPM_ROOT
-rm -rf wgts
+rm -rf *.wgt
 
 # validate
 echo "checking result... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-if [ $type == 'all' ] || [ $type == 'zip' ]; then
-        if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ] || [ -z "`ls | grep "\.zip"`" ];then
-                echo "------------------------------ FAILED to build $NAME packages --------------------------"
-                exit 1
-        fi
-else
-        if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ];then
-                echo "------------------------------ FAILED to build $NAME packages --------------------------"
-                exit 1
-        fi
+if [ -z "`ls | grep "\.rpm"`" ] || [ -z "`ls | grep "\.$ARCHIVE_TYPE"`" ];then
+        echo "------------------------------ FAILED to build $NAME packages --------------------------"
+        exit 1
 fi
 
 echo "------------------------------ Done to build $NAME packages --------------------------"
-ls *.rpm *.$ARCHIVE_TYPE *.zip 2>/dev/null
+ls *.rpm *.$ARCHIVE_TYPE 2>/dev/null
 ##############################################################################
index 788359f..44630fb 100644 (file)
@@ -23,14 +23,6 @@ make
 %install
 rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT
-if [ -d "wgts" ]; then
-    cp -a wgts $RPM_BUILD_ROOT/opt/%name/
-fi
-
-cp -a $RPM_BUILD_ROOT $RPM_BUILD_DIR/%name
-cd $RPM_BUILD_DIR
-zip -Drq %name-%version-%release.zip %name
-cd $RPM_BUILD_DIR/%name
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -40,49 +32,3 @@ rm -rf $RPM_BUILD_ROOT
 /usr/share/%name
 
 %changelog
-
-%post
-############## install/uninstall crx, wgt packge ####################
-crx_installer="chromium-browser"
-wgt_installer="wrt-installer"
-
-which $crx_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    echo "Reserved for crx package"
-fi
-
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/%name/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      echo "Start install package $i_pkg"
-      [ -e $i_pkg ] && $wgt_installer -i $i_pkg
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-    done
-fi
-
-%preun
-crx_installer="chromium-browser"
-wgt_installer="wrt-installer"
-
-which $crx_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    echo "Reserved for crx package"
-fi
-
-which $wgt_installer > /dev/null 2>&1
-if [ $? -eq 0 ]; then
-    wgt_list=`find /opt/%name/wgts -name "*.wgt"`
-    for i_pkg in $wgt_list; do
-      i_pkg_names=`basename $i_pkg`
-      i_pkg_name=${i_pkg_names%.*}
-      echo "Uninstall package $i_pkg_name"
-      i_pkg_nns=`wrt-launcher -l | grep $i_pkg_name | awk '{ print $NF }'`
-      for i_pkg_nn in $i_pkg_nns; do
-        echo "Package Name is $i_pkg_nn"
-        $wgt_installer -un $i_pkg_nn
-      done
-    done
-fi
-########################## end ##############################