freebsd-ports/net-p2p/edonkey-gui-gtk/files/wrapper.sh
Mario Sergio Fujikawa Ferreira 305840f7d2 New port edonkey-gui-gtk version 0.1.0: GTK GUI to eDonkey2000
'core' command line client

Reviewed by:	pat
2002-01-22 15:55:17 +00:00

34 lines
672 B
Bash

#!/bin/sh
PREFIX="%%PREFIX%%"
PROGRAM="${0}"
DIRNAME=${HOME}/.edonkey2000-gui-gtk
DATADIR="%%DATADIR%%"
DATAFILES="%%DATAFILES%%"
if [ ${#} -gt 1 ]
then
shift
fi
if [ ! -d ${DIRNAME} ]
then
mkdir -p ${DIRNAME}
fi
if [ ! -h ${DIRNAME}/${PROGRAM##*/} ]
then
ln -sf ${PREFIX}/bin/${PROGRAM##*/}-real ${DIRNAME}/${PROGRAM##*/}
for file in ${DATAFILES}
do
ln -sf "${DATADIR}/${file}" "${DIRNAME}/${file}"
done
fi
echo " ${*} " | grep " \-createdironly " ||
{
cd ${DIRNAME} &&
echo Running under ${DIRNAME} &&
exec ./${PROGRAM##*/} ${*} ||
echo PROBLEM. Cannot create directory ${DIRNAME}, make sure you have the proper permissions to create it and try again
}