#!/bin/sh # tiny configure script for qmqtool # we're in the major league now # Copyright Jeremy Kister 2009.01.23 # http://jeremy.kister.net/code/qmqtool/ VERSION=1.15 echo " " while test $# -gt 0 ; do case $1 in --*=*) arg=`echo $1 | sed 's/.*=//'` ;; *) arg= ;; esac case $1 in --help) cat </dev/null 2>&1 if [ $? -gt 0 ] ; then echo "$tool isn't in your path?? qmqtool will need that changed." exit 1 fi done if [ ! -x "$perl" ] ; then for dir in /usr/local/bin /usr/bin /bin ; do if test -f $dir/perl ; then perl=$dir/perl break fi done if [ ! -x "$perl" ] ; then echo "could not find perl: specify --perl=" exit 1 fi fi if [ ! -d "$qmaildir" ] ; then if test -d /var/qmail ; then qmaildir=/var/qmail else echo "could not find qmail directory: specify --qmaildir=" exit 1 fi fi if [ ! "$prefix" ] && [ ! "$scriptdir" ] && [ ! "$mandir" ] ; then exscr="`which qmqtool 2>/dev/null`" if [ -x "$exscr" ] ; then scriptdir="`echo $exscr | sed 's#/qmqtool$##'`" fi manpath="`echo $MANPATH | sed 's/:/ /g'`" for dir in $manpath ; do if [ -f "$dir/man8/qmqtool.8" ] ; then mandir=$dir fi done fi if [ ! "$prefix" ] ; then prefix="/usr/local" fi if [ ! "$scriptdir" ] ; then scriptdir="$prefix/script" fi if [ ! "$mandir" ] ; then mandir="$prefix/man" fi cat < qmqtool @cp src/qmqtool.8 qmqtool.8 install: qmqtool -mkdir -p $scriptdir cp qmqtool $scriptdir chown 0 $scriptdir/qmqtool chmod 755 $scriptdir/qmqtool -mkdir -p $mandir/man8/ cp qmqtool.8 $mandir/man8/ chown 0 $mandir/man8/qmqtool.8 chmod 744 $mandir/man8/qmqtool.8 clean: -rm Makefile qmqtool qmqtool.8 EOM ) > Makefile echo " " echo "now type 'make' and then 'make install'"