#!/bin/sh -e

echo "daemontools is not released under any specific"
echo "license, and therefore is not freely"
echo "redistributable.  You must download the source"
echo "from an FTP site before installation can begin."
echo ""
echo "This program will attempt to download the source"
echo "automatically.  If the source cannot be downloaded"
echo "at this time, installation will abort."
echo ""
echo "If installation fails at this time, you can attempt"
echo "to download daemontools at a later time by running"
echo ""
echo "         get-daemontools"

if [ -e /usr/src/daemontools-installer/daemontools_0.70.orig.tar.gz ]; then
	SUM=`cat /usr/src/daemontools-installer/daemontools_0.70.orig.tar.gz | md5sum`
fi

if [ "$SUM" != "c88e8c5e4453b4df41571f60eaa0baf3" ]; then
	echo ""
	echo "Trying to download daemontools..."
	get-daemontools
else
	echo ""
	echo "Looks like the daemontools source is already on your system!"
fi

echo ""
echo "To build daemontools binary package, you have to run"
echo ""
echo "         build-daemontools"
echo ""

#DEBHELPER#

exit 0
