added ebuild for skype-2.0.0.72

This commit is contained in:
Manuel Friedli 2008-09-01 21:28:39 +00:00
parent 243b64e9ac
commit 52cb473943
4 changed files with 171 additions and 0 deletions

View file

@ -0,0 +1,67 @@
#!/bin/bash
#
# Wrapper script to run Skype with sound wrapper when possible
logfile="${HOME}/.Skype/skype.log"
progname="skype"
progpath="/opt/${progname}/"
progopts="--resources-path ${progpath}"
shellcheck1=` which artsshell 2> /dev/null `
shellcheck2=` which esd 2> /dev/null `
artsdcheck=` ps x | grep artsd | grep -v grep `
## We use ps ax for esd as esd can be used globaly for all users.
esdcheck=` ps ax | grep "esd ." | grep -v grep `
skypecmd="${progpath}${progname}.bin"
wrapsound="yes"
#Use 32bits wrapper in 64 bits system
xdspsuffix=""
if [ `uname -m` == "x86_64" ]; then
xdspsuffix=32
fi
[ "$1" == "oss" ] && wrapsound="no"
[ -d "$(dirname "${logfile}")" ] || mkdir "$(dirname "${logfile}")"
echo "===== " `date` " =====" > ${logfile}
if [[ -z ${shellcheck1} && -z ${shellcheck2} ]]
then
echo "No installed artsshell or esd found"
echo "Assuming you're running no sound daemon"
echo "Starting ${progname} without a sound wrapper" | tee --append "${logfile}"
else
if [[ ${wrapsound} == "yes" && ${shellcheck1} == $(artsc-config --arts-prefix)/bin/artsshell && -n ${artsdcheck} ]]
then
echo "Running artsd found"
echo "Starting artsd wrapped ${progname}" | tee --append "${logfile}"
skypecmd="env MALLOC_CHECK_=0 artsdsp${xdspsuffix} -m ${skypecmd}"
elif [[ ${wrapsound} == "yes" && ${shellcheck2} == /usr/bin/esd && -n ${esdcheck} ]]
then
echo "Running esd found"
echo "Starting esd wrapped ${progname}" | tee --append "${logfile}"
skypecmd="esddsp${xdspsuffix} ${skypecmd}"
else
if [ ${wrapsound} == "yes" ]
then
echo "No running artsd or esd found"
else
echo "Use of sound-daemon disabled"
fi
echo "Starting ${progname} without sound daemon" | tee --append "${logfile}"
fi
fi
#Going to "homedir"
cd ${progpath}
echo "${skypecmd} ${progopts}" >> ${logfile}
echo "=========================================="
${skypecmd} ${progopts} >> ${logfile} 2>> ${logfile}
if [[ $? -ne 0 ]] ; then
echo "Running wrapped Skype failed, trying not-wrapped mode..."
echo "=========================================="
skypecmd="${progpath}${progname}.bin"
${skypecmd} ${progopts} >> ${logfile} 2>&1
fi
exit $?

View file

@ -0,0 +1,83 @@
#!/bin/sh
SKYPE="skype"
DBUS_SEND="dbus-send"
BUS="--system"
SKYPE_BUS=""
ID=`id -u`
print_help()
{
cat << EOF
Skype "callto://" handler
Usage: skype-callto-handler [BUS] callto://user
Where BUS can be either "--system" (default) or "--session"
EOF
}
if [ -z "$1" -o "$1" = "--help" ]; then
print_help
exit 1
fi
if [ "--system" = "$1" -o "--session" = "$1" ];then
BUS="$1"
shift 1
fi
if [ "--session" = "$BUS" ]; then
SKYPE_BUS="--use-session-dbus"
fi
if [ -z "$1" ];then
print_help
exit 1
fi
CALLTO=`echo $1 | sed 's/callto:\/\///'`
PING=`$DBUS_SEND $BUS --type=method_call --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ServiceExists string:com.Skype.API 2> /dev/null`; RESULT=$?
if [ $RESULT -ne 0 ]; then
echo "ERROR: Failed to connect to DBUS daemon!"
exit 1
fi
echo "$PING" | grep -q "boolean:true"; RESULT=$?
if [ $RESULT -ne 0 ]; then
echo "Running Skype instance not found, launching"
$SKYPE $SKYPE_BUS --callto "$CALLTO" &
exit 0
fi
SKYPE_ID=`$DBUS_SEND $BUS --type=method_call --print-reply --dest=com.Skype.API /com/Skype com.Skype.API.Ping 2> /dev/null`;RESULT=$?
if [ $RESULT -ne 0 ]; then
echo "ERROR: Skype is running on specified bus, but is misbehaving!"
exit 1
fi
TEMP=`echo "$SKYPE_ID" | grep -o "int32:[0-9]*"`
SKYPE_ID=`echo "$TEMP" | cut -f2 -d':'`
if [ $ID -ne $SKYPE_ID ]; then
echo "ERROR: Skype is running on specified bus, but for different UNIX user!"
exit 1
fi
REPLY=`$DBUS_SEND $BUS --type=method_call --print-reply --dest=com.Skype.API /com/Skype com.Skype.API.Invoke string:CALL\ $CALLTO 2> /dev/null`;RESULT=$?
if [ $RESULT -ne 0 ]; then
echo "ERROR: Error when communicating with Skype!"
exit 1
fi
TEMP=`echo "$REPLY" | grep -o "string:.*"`
REPLY=`echo "$TEMP" | cut -f2 -d':'`
echo $REPLY
exit 0

View file

@ -0,0 +1,10 @@
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- ../system.conf have denied everything, so we just punch some holes -->
<policy context="default">
<allow own="com.Skype.API"/>
<allow send_destination="com.Skype.API"/>
<allow receive_sender="com.Skype.API"/>
<allow send_path="/com/Skype"/>
</policy>
</busconfig>

View file

@ -0,0 +1,11 @@
#!/bin/bash
#
progname="skype"
progpath="/opt/${progname}/"
progopts="--resources-path ${progpath}"
#Going to "homedir"
cd ${progpath}
skypecmd="${progpath}${progname}"
XMODIFIERS=@im=none QT_IM_MODULE=simple exec ${skypecmd} ${progopts} $@