Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 97 lines (81 sloc) 3.169 kb
#!/bin/sh
#set -x
prefix=$1
erl=$2
werl=$3
etcdir=$4
vardir=$5
bindir=$6
destdir=$7
libdir=$8
. ../vsn.mk
y=yaws-${YAWS_VSN}
p=${prefix}
e=${etcdir}
v=${vardir}
install -d ${destdir}${prefix}/bin
install -d ${destdir}${prefix}/etc
install -d ${destdir}${vardir}/log/yaws
cat yaws.template | \
./Subst %yawsdir% ${libdir}/yaws | \
./Subst %vardir% ${vardir} | \
./Subst %erl% "${erl}" | \
./Subst %run_erl% "${bindir}/run_erl" | \
./Subst %to_erl% "${bindir}/to_erl" | \
./Subst %werl% "${werl}" > ${destdir}${prefix}/bin/yaws
chmod +x ${destdir}${prefix}/bin/yaws
install -d ${destdir}${libdir}/yaws/examples/ebin
install -d ${destdir}${libdir}/yaws/examples/include
## seems gentoo don't like to be installed in /usr/local/etc
## since /sbin/runscript still reads /etc/conf.d
if [ -f /etc/gentoo-release ]; then
install -d ${destdir}${etcdir}/init.d/
install -d ${destdir}${etcdir}/conf.d/
install -d ${destdir}${vardir}/run/yaws
chmod a+rwx ${destdir}${vardir}/run/yaws
sed -e "s;%prefix%;$p;g" \
-e "s;%etcdir%;$e;g" gentoo/init.d.yaws > ${destdir}${etcdir}/init.d/yaws
chmod +x ${destdir}${etcdir}/init.d/yaws
elif [ -f /etc/redhat-release ]; then
install -d ${destdir}${etcdir}/init.d
sed -e "s;%prefix%;$p;g" \
-e "s;%etcdir%;$e;g" redhat/yaws.init.d > ${destdir}${etcdir}/init.d/yaws
chmod +x ${destdir}${etcdir}/init.d/yaws
install -d ${destdir}${vardir}/run/yaws
chmod a+rwx ${destdir}${vardir}/run/yaws
elif [ -f /etc/suseservers ]; then
install -d ${destdir}${etcdir}/init.d
sed -e "s;%prefix%;$p;g" \
-e "s;%etcdir%;$e;g" suse/yaws.init.d/ > ${destdir}${etcdir}/init.d/yaws
chmod +x ${destdir}${etcdir}/init.d/yaws
install -d ${destdir}${vardir}/run/yaws
chmod a+rwx ${destdir}${vardir}/run/yaws
elif [ -f /etc/debian_version ]; then
install -d ${destdir}${etcdir}/init.d
sed -e "s;%prefix%;$p;g" \
-e "s;%etcdir%;$e;g" debian/yaws.init.d > ${destdir}${etcdir}/init.d/yaws
chmod +x ${destdir}${etcdir}/init.d/yaws
install -d ${destdir}${vardir}/run/yaws
chmod a+rwx ${destdir}${vardir}/run/yaws
elif [ "`uname -s`" = "Darwin" -a `id -u` = 0 ]; then
startupdir="/Library/StartupItems/Yaws"
if [ ! -e ${startupdir} ]; then
mkdir ${startupdir};
elif [ ! -d ${startupdir} ]; then
echo "${startupdir} exists but is not a directory, bailing out ..."
exit 1
fi
sed -e "s;%prefix%;$p;g" darwin/Yaws.StartupItem > ${startupdir}/Yaws
chmod +x ${startupdir}/Yaws
cp darwin/Yaws.plist ${startupdir}/StartupParameters.plist
# MacOS is particular about the ownership of startup items.
chown -R root:wheel ${startupdir}
elif [ "`uname -s`" = "FreeBSD" ]; then
sed -e "s;%prefix%;$p;g" -e "s;%etcdir%;$e;g" freebsd/yaws.sh > ${destdir}${etcdir}/rc.d/yaws.sh
elif [ "`uname -s`" = "NetBSD" ]; then
sed -e "s;%prefix%;$p;g" -e "s;%etcdir%;$e;g" netbsd/yaws.sh > /etc/rc.d/yaws
else
install -d ${destdir}${etcdir}
echo "Don't know how to make /etc/init scripts for this system"
echo "possibly add ${prefix}/bin/yaws --daemon --heart to your /etc/rc.local manually"
fi
Jump to Line
Something went wrong with that request. Please try again.