Add check for scp to configure. Added rules to makefile to automatically

rebuild configure.
This commit is contained in:
hjp 2004-11-30 09:27:01 +00:00
parent 0260bffa03
commit a7c1de55a7
3 changed files with 65 additions and 14 deletions

View File

@ -1,5 +1,9 @@
include GNUmakevars include GNUmakevars
CONFDIR=../../configure
CONFDIR_exists=$(shell [ -d $(CONFDIR) ] && echo ok)
TARGETS = quotacheck quotastat quotasanitycheck quotagraph TARGETS = quotacheck quotastat quotasanitycheck quotagraph
all: $(TARGETS) all: $(TARGETS)
@ -31,4 +35,17 @@ $(SBINDIR):
/usr/local/dfstat/%: % /usr/local/dfstat/%: %
$(INSTALL) -m 755 $^ $@ $(INSTALL) -m 755 $^ $@
ifeq ($(CONFDIR_exists),ok)
configure: $(CONFDIR)/start \
$(CONFDIR)/perl \
$(CONFDIR)/df \
$(CONFDIR)/repquota \
$(CONFDIR)/sendmail \
$(CONFDIR)/scp \
$(CONFDIR)/finish
cat $^ > $@
endif
include GNUmakerules include GNUmakerules

60
quotacheck/configure vendored
View File

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh
# #
echo "#!/bin/sh" > customize echo "#!/bin/sh" > customize.$$
echo "sed \\" > customize echo "sed \\" > customize.$$
chmod +x customize chmod +x customize.$$
################################################################ ################################################################
# find a working perl: # find a working perl:
@ -21,7 +21,7 @@ then
echo could not find a working perl command, sorry. echo could not find a working perl command, sorry.
exit 1 exit 1
fi fi
echo " -e 's,@@@perl@@@,$perl,g' \\" >> customize echo " -e 's,@@@perl@@@,$perl,g' \\" >> customize.$$
################################################################ ################################################################
@ -30,7 +30,7 @@ echo " -e 's,@@@perl@@@,$perl,g' \\" >> customize
for i in /bin/df /usr/bin/df /usr/bin/bdf /usr/sbin/df /usr/local/bin/df for i in /bin/df /usr/bin/df /usr/bin/bdf /usr/sbin/df /usr/local/bin/df
do do
a=`$i | awk 'NR == 1 {print $2}'` a=`$i | awk 'NR == 1 {print $2}'`
if [ "$a" = "kbytes" -o "$a" = "1024-blocks" -o "$a" = "1k-blocks" ] if [ "$a" = "kbytes" -o "$a" = "1024-blocks" ]
then then
echo $i works echo $i works
df="$i" df="$i"
@ -49,7 +49,7 @@ then
echo could not find a working df command, sorry. echo could not find a working df command, sorry.
exit 1 exit 1
fi fi
echo " -e 's,@@@df@@@,$df,g' \\" >> customize echo " -e 's,@@@df@@@,$df,g' \\" >> customize.$$
################################################################ ################################################################
@ -72,7 +72,7 @@ then
echo could not find a working repquota command, sorry. echo could not find a working repquota command, sorry.
exit 1 exit 1
fi fi
echo " -e 's,@@@repquota@@@,$repquota,g' \\" >> customize echo " -e 's,@@@repquota@@@,$repquota,g' \\" >> customize.$$
################################################################ ################################################################
# find sendmail: # find sendmail:
@ -101,11 +101,45 @@ then
echo could not find a working sendmail command, sorry. echo could not find a working sendmail command, sorry.
exit 1 exit 1
fi fi
echo " -e 's,@@@sendmail@@@,$sendmail,g' \\" >> customize echo " -e 's,@@@sendmail@@@,$sendmail,g' \\" >> customize.$$
################################################################ ################################################################
# finish: # $Id: configure,v 1.4 2004-11-30 09:27:01 hjp Exp $
# add a blank line to customize # find scp command
echo >> customize #
touch scp.test.$$
for i in /usr/bin/scp /usr/local/bin/scp
do
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.$$
# $Log: configure,v $
# Revision 1.4 2004-11-30 09:27:01 hjp
# Add check for scp to configure. Added rules to makefile to automatically
# rebuild configure.
#
################################################################
# finish
# Add trailing newline and rename temp file to final name
#
echo >> customize.$$
mv customize.$$ customize

View File

@ -161,7 +161,7 @@ for my $ln (@df) {
if (system (@startgraph) != 0) { if (system (@startgraph) != 0) {
die "cannot execute @startgraph"; die "cannot execute @startgraph";
} }
system("scp", "/usr/local/www/wsr/intranet/quotas/$user$mount_t.gif", "sww.wsr.ac.at:/usr/local/www/wsr/intranet/quotas/$user$mount_t.gif"); system("@@@scp@@@", "/usr/local/www/wsr/intranet/quotas/$user$mount_t.gif", "sww.wsr.ac.at:/usr/local/www/wsr/intranet/quotas/$user$mount_t.gif");
if (!-e $timestamp) { if (!-e $timestamp) {
sendmail($user, $msg, $mount); sendmail($user, $msg, $mount);