Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

73 lines (56 sloc) 1.788 kB
#!/bin/sh
prefix=$1
installprefix=$2
erl=$3
werl=$4
etcdir=$5
. ../vsn.mk
y=yaws-${YAWS_VSN}
p=${prefix}
# sed mangler
mangle ()
{
d=$1
e=$2
w=$3
from=$4
to=$5
install -d `dirname $to`
sed -e "s;%yawsdir%;$d;g" -e "s;%erl%;$e;" -e "s;%werl%;$w;" $from > $to
}
mangle ${prefix}/lib/yaws "${erl}" "${werl}" yaws.ss ${installprefix}/bin/yaws
install -d ${installprefix}/lib/yaws/examples/ebin
install -d ${installprefix}/lib/yaws/examples/include
chmod +x ${installprefix}/bin/yaws
if [ -f ${etcdir}/yaws.conf ]; then
t=${etcdir}/yaws.conf.template
else
t=${etcdir}/yaws.conf
fi
mangle ${prefix}/lib/yaws "${erl}" "${werl}" yaws.conf.template ${t}
if [ -f /etc/gentoo-release ]; then
install -d ${etcdir}/init.d/
install -d ${etcdir}/conf.d/
cp gentoo/init.d.yaws ${etcdir}/init.d/yaws
chmod +x ${etcdir}/init.d/yaws
sed -e "s;%prefix%;$p;g" gentoo/conf.d.yaws > ${etcdir}/conf.d/yaws
elif [ -f /etc/redhat-release ]; then
install -d ${etcdir}/init.d
sed -e "s;%prefix%;$p;g" redhat/yaws.init.d > ${etcdir}/init.d/yaws
chmod +x ${etcdir}/init.d/yaws
elif [ -f /etc/suseservers ]; then
install -d ${etcdir}/init.d
sed -e "s;%prefix%;$p;g" suse/yaws.init.d > ${etcdir}/init.d/yaws
chmod +x ${etcdir}/init.d/yaws
elif [ "`uname -s`" = "Darwin" ]; then
startupdir="/Library/StartupItems/Yaws"
if [ ! -d ${startupdir} ]; then
mkdir ${startupdir};
fi
sed -e "s;%prefix%;$p;g" darwin/Yaws.StartupItem > ${startupdir}/Yaws
chmod +x ${startupdir}/Yaws
cp darwin/Yaws.plist ${startupdir}/StartupParameters.plist
else
echo "Don't know how to make /etc/init scrips for this system"
echo "possibly add $1/bin/yaws -D -heart to your /etc/rc.local manually"
fi
Jump to Line
Something went wrong with that request. Please try again.