#!/bin/sh
# Minimalistic install script.
# Installs a Kopete-style in either a system-wide KDEDIR or in the current users KDEHOME
# Utilizes KDialog and KDESu to be fully graphical.
# Will state some simple debug output on console
# Feel free to reuse the scripts install.sh and copy.sh in whatever way you like
#
# Written by Christian Nitschkowski, 03 April 2005
function nokde() {
echo "Couldn't find kde-config. Please check your installation"
exit 1
}
kde-config >/dev/null 2>&1 || nokde
for i in `kde-config --path exe | sed -e y/:/\\\n/`; do
if test -x ${i}/kdialog; then
DIALOG=${i}/kdialog
SU=${i}/kdesu
break;
fi
done
KDEINST=`kde-config --install data`
KDEHOME=`kde-config --localprefix`/share/apps
if test -x ${DIALOG}; then
echo Found ${DIALOG}
else
echo "Couldn't find kdialog. Please check your installation"
exit 1
fi
if test -x ${SU}; then
echo Found ${SU}
else
echo "Couldn't find kdesu. Please check your installation"
exit 1
fi
TMP=`mktemp`
cd `dirname ${0}`
${DIALOG} --yesno "Do you want to install ShadedBubble for all users?\n(Root password required)" && SYS=1 || SYS=0
if test $SYS -eq 1; then
${SU} -d sh ./copy.sh ${KDEINST} ${TMP}
else
sh ./copy.sh ${KDEHOME} ${TMP}
fi
${DIALOG} --textbox ${TMP}
rm ${TMP}