Added RPM patches submitted by Robert Napier
[matthijs/upstream/backupninja.git] / configure.in
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 # The maintainer mode is causing me grief with newest versions of autotools
5 #AM_MAINTAINER_MODE
6 AC_INIT([backupninja],[0.9.3],[backupninja@lists.riseup.net])
7 AC_CONFIG_SRCDIR([src/backupninja.in])
8 AM_INIT_AUTOMAKE
9
10 # Checks for programs.
11
12 # BASH may already be set in the shell, if the admin then changes the
13 # the /bin/sh symlink to a non-bash shell, all hell will break lose.
14 unset BASH
15 AC_PATH_PROGS([BASH], [bash], [/bin/bash], [$PATH:/bin:/usr/bin:/usr/sbin])
16 if test x$BASH = "x"; then
17     AC_MSG_ERROR([bash is required])
18 fi
19
20 AC_CHECK_PROGS(SED, sed)
21 if test x$SED = "x"; then
22     AC_MSG_ERROR([sed is required])
23 fi
24
25 AC_CHECK_PROGS(AWK, awk)
26 if test x$AWK = "x"; then
27     AC_MSG_ERROR([awk is required])
28 fi
29 AC_CHECK_PROG(ac_cv_have_rpm, rpm, "yes", "no")
30 if test "x$ac_cv_have_rpm" = "xyes"; then
31         rpm --define '_topdir /tmp' > /dev/null 2>&1
32         AC_MSG_CHECKING(to see if we can redefine _topdir)
33         if test $? -eq 0 ; then
34                 AC_MSG_RESULT(yes)
35                 HAVE_RPM=yes
36         else
37                 AC_MSG_RESULT(no.  You'll have to build packages manually.)
38                 HAVE_RPM=no
39         fi
40 fi
41 AC_SUBST(HAVE_RPM)
42
43 AC_CHECK_PROG(ac_cv_have_rpm, rpm, "yes", "no")
44 if test "x$ac_cv_have_rpm" = "xyes"; then
45         rpm --define '_topdir /tmp' > /dev/null 2>&1
46         AC_MSG_CHECKING(to see if we can redefine _topdir)
47         if test $? -eq 0 ; then
48                 AC_MSG_RESULT(yes)
49                 HAVE_RPM=yes
50         else
51                 AC_MSG_RESULT(no.  You'll have to build packages manually.)
52                 HAVE_RPM=no
53         fi
54 fi
55 AC_SUBST(HAVE_RPM)
56
57 AC_PROG_LN_S
58
59 AC_SUBST([CFGDIR], "${sysconfdir}")
60
61 AC_CONFIG_FILES([Makefile
62                 etc/Makefile
63                 examples/Makefile
64                 handlers/Makefile
65                 lib/Makefile
66                 man/Makefile
67                 src/Makefile])
68
69 AC_OUTPUT([ backupninja.spec])