echo "-->> Creating widgets >>--"
cd $suite_dir
-rm -rf ./wgts
-mkdir -p ./wgts
for app in $all_dirs; do
check_blackdir $app
if [ $? == 1 ]; then
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"
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"
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
%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
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
%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
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
# 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}'`
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
# 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
# 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
# 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
##############################################################################
%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
/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 ##############################
# 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}'`
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
# 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
# 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
# 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
##############################################################################
%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
%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 ##############################
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
# 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}'`
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
# 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
# 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
# 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
##############################################################################
%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
/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 ##############################
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
# 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}'`
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
# 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
# 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
# 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
##############################################################################
%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
/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 ##############################
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
# 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}'`
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
# 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
# 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
# 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
##############################################################################
%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
/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 ##############################
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
# 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}'`
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
# 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
# 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
# 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
##############################################################################
%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
/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 ##############################
testdefdir = $(datadir)/tct-wrtui-tests
dist_testdef_DATA = tests.xml
docdir = /opt/tct-wrtui-tests
-dist_doc_DATA = Changelog
+dist_doc_DATA = Changelog *.wgt
# 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}'`
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
# 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
# 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
# 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
##############################################################################
%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
/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 ##############################