freebsd-ports/math/mprime/files/wrapper.sh.in
Philip M. Gollucci c07bd2d066 - use SUB_FILES appropriately instead of SED directly
PR:             ports/142812
Submitted by:   Sevan Janiyan <venture37@geeklan.co.uk>
Approved by:    maintainer timeout (nivit ; 231 days)
2010-09-08 22:04:45 +00:00

23 lines
492 B
Bash

#!/bin/sh
PREFIX="%%PREFIX%%"
PROGRAM="${0}"
DIRNAME=${HOME}/.mprime
if [ ! -d ${DIRNAME} ]
then
mkdir -p ${DIRNAME}
fi
if [ ! -h ${DIRNAME}/${PROGRAM##*/} ]
then
ln -sf ${PREFIX}/bin/${PROGRAM##*/}-real ${DIRNAME}/${PROGRAM##*/}
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
}