1998-09-17 10:32:57 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2004-11-30 10:27:01 +01:00
|
|
|
echo "#!/bin/sh" > customize.$$
|
|
|
|
echo "sed \\" > customize.$$
|
|
|
|
chmod +x customize.$$
|
1998-09-17 10:32:57 +02:00
|
|
|
|
|
|
|
################################################################
|
|
|
|
# find a working perl:
|
|
|
|
#
|
|
|
|
for i in /usr/bin/perl /usr/local/bin/perl /usr/bin/perl5 /usr/local/bin/perl5
|
|
|
|
do
|
|
|
|
if $i -e 'exit ($] < 5.000)'
|
|
|
|
then
|
|
|
|
echo $i works
|
|
|
|
perl="$i"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ -z "$perl" ]
|
|
|
|
then
|
2000-02-08 18:07:38 +01:00
|
|
|
echo could not find a working perl command, sorry.
|
1998-09-17 10:32:57 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2004-11-30 10:27:01 +01:00
|
|
|
echo " -e 's,@@@perl@@@,$perl,g' \\" >> customize.$$
|
1998-09-17 10:32:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
################################################################
|
|
|
|
# find a working df:
|
|
|
|
#
|
1999-07-09 20:06:17 +02:00
|
|
|
for i in /bin/df /usr/bin/df /usr/bin/bdf /usr/sbin/df /usr/local/bin/df
|
1998-09-17 10:32:57 +02:00
|
|
|
do
|
|
|
|
a=`$i | awk 'NR == 1 {print $2}'`
|
2005-03-29 12:03:14 +02:00
|
|
|
if [ "$a" = "kbytes" -o "$a" = "1024-blocks" -o "$a" = "1k-blocks" ]
|
1998-09-17 10:32:57 +02:00
|
|
|
then
|
|
|
|
echo $i works
|
|
|
|
df="$i"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
a=`$i -k | awk 'NR == 1 {print $2}'`
|
2005-03-29 12:03:14 +02:00
|
|
|
if [ "$a" = "kbytes" -o "$a" = "1024-blocks" -o "$a" = "1k-blocks" ]
|
1998-09-17 10:32:57 +02:00
|
|
|
then
|
|
|
|
echo $i -k works
|
|
|
|
df="$i -k"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ -z "$df" ]
|
|
|
|
then
|
2000-02-08 18:07:38 +01:00
|
|
|
echo could not find a working df command, sorry.
|
1998-09-17 10:32:57 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2004-11-30 10:27:01 +01:00
|
|
|
echo " -e 's,@@@df@@@,$df,g' \\" >> customize.$$
|
1998-09-17 10:32:57 +02:00
|
|
|
################################################################
|
|
|
|
# find repquota:
|
|
|
|
# We don't try to check whether the output is useful,
|
|
|
|
# just check whether we can call it. You may need root
|
|
|
|
# privileges for this to succeed.
|
|
|
|
#
|
|
|
|
for i in /usr/sbin/repquota
|
|
|
|
do
|
|
|
|
if $i -a
|
|
|
|
then
|
|
|
|
echo $i works
|
|
|
|
repquota="$i"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ -z "$repquota" ]
|
|
|
|
then
|
2000-02-08 18:07:38 +01:00
|
|
|
echo could not find a working repquota command, sorry.
|
1998-09-17 10:32:57 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2004-11-30 10:27:01 +01:00
|
|
|
echo " -e 's,@@@repquota@@@,$repquota,g' \\" >> customize.$$
|
1998-09-17 10:32:57 +02:00
|
|
|
|
|
|
|
################################################################
|
|
|
|
# find sendmail:
|
|
|
|
# We don't try to check whether the mail is actually delivered,
|
|
|
|
# just if sendmail accepts mail for a local user.
|
|
|
|
# This may not be a very useful test.
|
|
|
|
#
|
|
|
|
user=`whoami`
|
|
|
|
for i in /usr/sbin/sendmail /usr/lib/sendmail
|
|
|
|
do
|
|
|
|
if $i -t -i <<EOF
|
|
|
|
From: $user
|
|
|
|
To: $user
|
|
|
|
Subject: Testmail from configure (please ignore)
|
|
|
|
|
|
|
|
Test
|
|
|
|
EOF
|
|
|
|
then
|
|
|
|
echo $i works
|
|
|
|
sendmail="$i"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ -z "$sendmail" ]
|
|
|
|
then
|
2000-02-08 18:07:38 +01:00
|
|
|
echo could not find a working sendmail command, sorry.
|
1998-09-17 10:32:57 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2004-11-30 10:27:01 +01:00
|
|
|
echo " -e 's,@@@sendmail@@@,$sendmail,g' \\" >> customize.$$
|
1998-09-17 10:32:57 +02:00
|
|
|
|
2004-11-30 10:27:01 +01:00
|
|
|
################################################################
|
2005-03-29 12:03:14 +02:00
|
|
|
# $Id: configure,v 1.5 2005-03-29 10:03:14 hjp Exp $
|
2004-11-30 10:27:01 +01:00
|
|
|
# find scp command
|
|
|
|
#
|
|
|
|
touch scp.test.$$
|
|
|
|
for i in /usr/bin/scp /usr/local/bin/scp
|
|
|
|
do
|
2000-02-08 18:07:38 +01:00
|
|
|
|
2004-11-30 10:27:01 +01:00
|
|
|
rm -f scp.test.$$.new
|
|
|
|
if $i scp.test.$$ scp.test.$$.new
|
|
|
|
then
|
|
|
|
if [ -f scp.test.$$.new ]
|
|
|
|
then
|
|
|
|
echo $i works
|
|
|
|
scp="$i"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
rm -f scp.test.$$ scp.test.$$.new
|
|
|
|
if [ -z "$scp" ]
|
|
|
|
then
|
|
|
|
echo could not find a working find command, sorry.
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo " -e 's,@@@scp@@@,$scp,g' \\" >> customize.$$
|
2000-02-08 18:07:38 +01:00
|
|
|
|
2004-11-30 10:27:01 +01:00
|
|
|
# $Log: configure,v $
|
2005-03-29 12:03:14 +02:00
|
|
|
# Revision 1.5 2005-03-29 10:03:14 hjp
|
|
|
|
# check for df changed - rebuilt.
|
|
|
|
#
|
|
|
|
# Revision 1.1 2005/01/07 16:01:34 hjp
|
|
|
|
# Added test for scp.
|
2004-11-30 10:27:01 +01:00
|
|
|
#
|
2000-02-08 18:07:38 +01:00
|
|
|
################################################################
|
2004-11-30 10:27:01 +01:00
|
|
|
# finish
|
|
|
|
# Add trailing newline and rename temp file to final name
|
|
|
|
#
|
|
|
|
echo >> customize.$$
|
|
|
|
|
|
|
|
mv customize.$$ customize
|
|
|
|
|