summaryrefslogtreecommitdiffabout
path: root/tests/atlocal.in
blob: b4679606579c45461f2be343d20f5c0dbd9a159b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# @configure_input@                                     -*- shell-script -*-
# Configurable variable values for tar test suite.
# Copyright (C) 2007 Sergey Poznyakoff

PATH=@abs_builddir@:@abs_top_builddir@/src:@abs_top_srcdir@/build-aux:$top_srcdir:$srcdir:$PATH

XFAILFILE=$abs_builddir/.badversion

STATEDIR=/tmp/mailfromd-$$

checkstatedir() {
  if test ! -d $STATEDIR; then
    mkdir $STATEDIR || exit 1
    sed "s,STATEDIR,$STATEDIR," @abs_top_srcdir@/tests/etc/config.in > \
        @abs_top_builddir@/tests/etc/config.rc
  fi
}

cleanup() {
  rm -rf $STATEDIR
}

trap "cleanup; test -r $XFAILFILE && cat $XFAILFILE; exit $?" 1 2 13 15

MFOPTS="-I@abs_builddir@/etc -I@abs_top_srcdir@/tests/etc -I@abs_top_srcdir@/src -I@abs_top_srcdir@/mflib --no-preprocess"
ETCDIR=@abs_top_srcdir@/tests/etc

PORT="unix:$STATEDIR/socket"
MTAOPTS="-X$PORT --stdio"
PIDFILE=$STATEDIR/pid

mailfromd_start() {
  checkstatedir
  mailfromd $MFOPTS \
    --port=$PORT \
    --pidfile=$PIDFILE \
    --debug=100\
    --remove \
    --daemon \
    $ETCDIR/$1  
}

mailfromd_stop() {
  if test -r $PIDFILE; then
	kill -TERM `head -n 1 $PIDFILE`
  fi
  cleanup
}

cleardb() {
  checkstatedir
}

puszcza_addr() {
  host puszcza.gnu.org.ua |\
    sed -n '1s/puszcza.gnu.org.ua has address \(.*\)/\1/p'
}

Return to:

Send suggestions and report system problems to the System administrator.