aboutsummaryrefslogtreecommitdiff
path: root/configure.in
blob: 3cddf61609cb394ffbe293324672ebf3ed45fc28 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

# The maintainer mode is causing me grief with newest versions of autotools
#AM_MAINTAINER_MODE
AC_INIT([backupninja],[1.0-rc1],[backupninja@lists.riseup.net])
AC_CONFIG_SRCDIR([src/backupninja.in])
AM_INIT_AUTOMAKE

# Checks for programs.

# BASH may already be set in the shell, if the admin then changes the
# the /bin/sh symlink to a non-bash shell, all hell will break lose.
unset BASH
AC_PATH_PROGS(BASH, bash, "no", [$PATH:/bin:/usr/bin:/usr/sbin])
if test x$BASH = "xno"; then
    AC_MSG_ERROR([bash is required])
fi

AC_PATH_PROGS(SED, sed, "no")
if test x$SED = "xno"; then
    AC_MSG_ERROR([sed is required])
else
   export SED
fi

AC_PATH_PROGS(AWK, awk, "no")
if test x$AWK = "xno"; then
    AC_MSG_ERROR([awk is required])
else
   export AWK
fi

AC_PATH_PROGS(MKTEMP, mktemp, "no")
if test x$MKTEMPT = "xno"; then
    AC_MSG_ERROR([mktemp is required])
fi

AC_PATH_PROGS(STAT, stat, "no")
if test x$STAT = "xno"; then
    AC_MSG_ERROR([stat is required])
else
   export STAT
fi

AC_CHECK_PROG(ac_cv_have_rpm, rpm, "yes", "no")
if test "x$ac_cv_have_rpm" = "xyes"; then
        rpm --define '_topdir /tmp' > /dev/null 2>&1
        AC_MSG_CHECKING(to see if we can redefine _topdir)
        if test $? -eq 0 ; then
                AC_MSG_RESULT(yes)
                HAVE_RPM=yes
        else
                AC_MSG_RESULT(no.  You'll have to build packages manually.)
                HAVE_RPM=no
        fi
fi
AC_SUBST(HAVE_RPM)

AC_CHECK_PROG(ac_cv_have_rpm, rpm, "yes", "no")
if test "x$ac_cv_have_rpm" = "xyes"; then
        rpm --define '_topdir /tmp' > /dev/null 2>&1
        AC_MSG_CHECKING(to see if we can redefine _topdir)
        if test $? -eq 0 ; then
                AC_MSG_RESULT(yes)
                HAVE_RPM=yes
        else
                AC_MSG_RESULT(no.  You'll have to build packages manually.)
                HAVE_RPM=no
        fi
fi
AC_SUBST(HAVE_RPM)

AC_PROG_LN_S

AC_SUBST([CFGDIR], "${sysconfdir}")

AC_CONFIG_FILES([Makefile
                etc/Makefile
                examples/Makefile
                handlers/Makefile
                lib/Makefile
                man/Makefile
                src/Makefile])

AC_OUTPUT([ backupninja.spec])