echo -e "$color_warn Usage: \n\t build.sh \t [(-v|--verbose) Be verbose when compiling (default: no)] \n\t\t\t [(-u|--uninstall) Uninstall KBFX (default: no)] \n\t\t\t [(-p|--prefix) Install prefix (default: KDE prefix)] \n\t\t\t [(-s|--strigi) Compile strigi search plugin (default: no)] \n\t\t\t [(-m|-menudrake-off) Don't use menudrake in Mandriva (default: auto)] \n\t\t\t [(-k|--kde4) Compile for KDE4 (default: no)] \n\t\t\t [(-n|--nocheck) Do not check for old KBFX versions (default: check)] $color_normal"
echo
}
parse_command_line $command_line_args
if["$?" -eq 1];then
prog_err "build.sh"
show_usage
exit1
fi
show_usage
if["$ACTION"="install"]
then{
if[$kbfx_installed -eq 1 -a $NOCHECK -eq 0];then
echo
echo -e "$color_error \n\t You have KBFX installed in your \$PATH!\n\t In order to compile the new version you HAVE TO REMOVE the old KBFX first!\n $color_normal"
exit1
fi
if[ -d build ];then
echo
echo -e "$color_warn Directory 'build' exists! Using it...$color_normal"
echo -e "$color_error If 'build.sh' fails, try removing the directory 'build' and run 'build.sh' again! $color_normal"
echo -e "$color_warn NOTE: If you have used a custom prefix for your install (-p or --prefix option for script), \n you should add '$s' to your \$TDEDIRS environment variable\n and '$s/lib' to your \$LD_LIBRARY_PATH environment variable!\n $color_normal"
echo -e "$color_error \n\t Directory 'build' DOES NOT exist!\n\t You HAVE NOT used 'build.sh' script for installing KBFX! \n\t Uninstall CAN NOT continue!\n $color_normal"
exit1
fi
if[ -f kbfx_install_user ]
then
sucommand="make uninstall"
after_su="rm -f kbfx_install_user"
elif[ -f kbfx_install_root ]
then
sucommand="su root -c 'make uninstall'"
after_su="rm -f kbfx_install_root"
elif[ -f kbfx_build ]
then
echo
echo -e "$color_error \n\t KBFX IS NOT installed! \n\t Uninstall CAN NOT continue!\n $color_normal"
exit1
else
echo
echo -e "$color_error \n\t You HAVE NOT used 'build.sh' script for installing KBFX! \n\t Uninstall CAN NOT continue!\n $color_normal"