diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | Makefile.in | 26 | ||||
-rw-r--r-- | aclocal.m4 | 284 | ||||
-rw-r--r-- | backupninja.spec.in | 1 | ||||
-rwxr-xr-x | configure | 16 | ||||
-rw-r--r-- | configure.in | 1 | ||||
-rw-r--r-- | etc/Makefile.am | 1 | ||||
-rw-r--r-- | etc/Makefile.in | 5 | ||||
-rw-r--r-- | etc/backupninja.conf.in | 3 | ||||
-rw-r--r-- | examples/Makefile.in | 4 | ||||
-rw-r--r-- | handlers/Makefile.am | 3 | ||||
-rw-r--r-- | handlers/Makefile.in | 7 | ||||
-rw-r--r-- | handlers/dup.helper | 426 | ||||
-rw-r--r-- | lib/Makefile.am | 6 | ||||
-rw-r--r-- | lib/Makefile.in | 290 | ||||
-rw-r--r-- | lib/easydialog.sh | 255 | ||||
-rw-r--r-- | man/Makefile.in | 4 | ||||
-rw-r--r-- | src/Makefile.in | 4 | ||||
-rwxr-xr-x | src/ninjahelper.in | 11 |
19 files changed, 1116 insertions, 233 deletions
diff --git a/Makefile.am b/Makefile.am index 2a947e1..8f706df 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,4 +4,4 @@ EXTRA_DIST = README COPYING AUTHORS INSTALL NEWS ChangeLog \ backupninja.spec backupninja.spec.in autogen.sh -SUBDIRS = etc examples handlers man src +SUBDIRS = etc examples handlers lib man src diff --git a/Makefile.in b/Makefile.in index 366d466..a0eb9ab 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -129,7 +129,7 @@ target_alias = @target_alias@ EXTRA_DIST = README COPYING AUTHORS INSTALL NEWS ChangeLog \ backupninja.spec backupninja.spec.in autogen.sh -SUBDIRS = etc examples handlers man src +SUBDIRS = etc examples handlers lib man src all: all-recursive .SUFFIXES: @@ -177,7 +177,13 @@ uninstall-info-am: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -189,7 +195,7 @@ $(RECURSIVE_TARGETS): local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ @@ -197,7 +203,13 @@ $(RECURSIVE_TARGETS): mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ @@ -218,7 +230,7 @@ maintainer-clean-recursive: local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.9.2 -*- Autoconf -*- +# generated automatically by aclocal 1.9.5 -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,23 +11,11 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -# -*- Autoconf -*- -# Copyright (C) 2002, 2003 Free Software Foundation, Inc. -# Generated from amversion.in; do not edit by hand. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- @@ -40,26 +28,15 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.2])]) - -# AM_AUX_DIR_EXPAND + [AM_AUTOMAKE_VERSION([1.9.5])]) -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. +# AM_AUX_DIR_EXPAND -*- Autoconf -*- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to @@ -106,30 +83,19 @@ AC_PREREQ([2.50])dnl am_aux_dir=`cd $ac_aux_dir && pwd` ]) -# Do all the work for Automake. -*- Autoconf -*- - -# This macro actually does too much some checks are only needed if -# your package does certain things. But this isn't really a big deal. +# Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# serial 12 -# serial 11 +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) @@ -231,51 +197,27 @@ for _am_header in $config_headers :; do done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) -# -*- Autoconf -*- -# Copyright (C) 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# serial 1 +# serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. @@ -290,27 +232,16 @@ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) -# -*- Autoconf -*- - - -# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 3 +# serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -336,27 +267,16 @@ else fi ]) +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. - -# Copyright (C) 2003, 2004 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - +# # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). @@ -410,26 +330,15 @@ else fi AC_SUBST([mkdir_p])]) -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +# Helper functions for option handling. -*- Autoconf -*- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -454,28 +363,16 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# -# Check to make sure that the build environment is sane. -# - -# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# Check to make sure that the build environment is sane. -*- Autoconf -*- -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 4 # AM_SANITY_CHECK # --------------- @@ -518,25 +415,14 @@ Check your system clock]) fi AC_MSG_RESULT(yes)]) -# AM_PROG_INSTALL_STRIP - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# AM_PROG_INSTALL_STRIP +# --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip @@ -559,25 +445,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 1 +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- diff --git a/backupninja.spec.in b/backupninja.spec.in index a7f820b..ed84520 100644 --- a/backupninja.spec.in +++ b/backupninja.spec.in @@ -41,6 +41,7 @@ touch "%{buildroot}%{_localstatedir}/log/backupninja.log" %defattr(0750,root,root) %{_sbindir}/* %{_datadir}/backupninja/* +%{_libdir}/backupninja/* %{_sysconfdir}/cron.d/backupninja %{_sysconfdir}/logrotate.d/backupninja @@ -878,7 +878,7 @@ esac else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd $ac_popdir + cd "$ac_popdir" done fi @@ -1736,7 +1736,7 @@ CFGDIR="${sysconfdir}" # Checks for library functions. - ac_config_files="$ac_config_files Makefile etc/Makefile examples/Makefile handlers/Makefile man/Makefile src/Makefile" + ac_config_files="$ac_config_files Makefile etc/Makefile examples/Makefile handlers/Makefile lib/Makefile man/Makefile src/Makefile" ac_config_files="$ac_config_files backupninja.spec" @@ -2295,6 +2295,7 @@ do "etc/Makefile" ) CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; "examples/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "handlers/Makefile" ) CONFIG_FILES="$CONFIG_FILES handlers/Makefile" ;; + "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "backupninja.spec" ) CONFIG_FILES="$CONFIG_FILES backupninja.spec" ;; @@ -2573,11 +2574,6 @@ esac *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ @@ -2616,6 +2612,12 @@ echo "$as_me: error: cannot find input file: $f" >&2;} fi;; esac done` || { (exit 1); exit 1; } + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub diff --git a/configure.in b/configure.in index 64b72d0..9f0ee60 100644 --- a/configure.in +++ b/configure.in @@ -27,6 +27,7 @@ AC_CONFIG_FILES([Makefile etc/Makefile examples/Makefile handlers/Makefile + lib/Makefile man/Makefile src/Makefile]) diff --git a/etc/Makefile.am b/etc/Makefile.am index ed3ce94..31a3e13 100644 --- a/etc/Makefile.am +++ b/etc/Makefile.am @@ -14,6 +14,7 @@ edit = sed \ -e "s,@sysconfdir\@,$(sysconfdir),g" \ -e "s,@localstatedir\@,$(localstatedir),g" \ -e "s,@pkgdatadir\@,$(pkgdatadir),g" \ + -e "s,@pkglibdir\@,$(pkglibdir),g" \ -e "s,@sbindir\@,$(sbindir),g" \ -e "s,@exec_prefix\@,$(exec_prefix),g" \ -e "s,@prefix\@,$(prefix),g" diff --git a/etc/Makefile.in b/etc/Makefile.in index 4a9f9bf..449f533 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -122,6 +122,7 @@ edit = sed \ -e "s,@sysconfdir\@,$(sysconfdir),g" \ -e "s,@localstatedir\@,$(localstatedir),g" \ -e "s,@pkgdatadir\@,$(pkgdatadir),g" \ + -e "s,@pkglibdir\@,$(pkglibdir),g" \ -e "s,@sbindir\@,$(sbindir),g" \ -e "s,@exec_prefix\@,$(exec_prefix),g" \ -e "s,@prefix\@,$(prefix),g" diff --git a/etc/backupninja.conf.in b/etc/backupninja.conf.in index f64e16f..da2bfa1 100644 --- a/etc/backupninja.conf.in +++ b/etc/backupninja.conf.in @@ -38,6 +38,9 @@ configdirectory = @CFGDIR@/backup.d # where backupninja helper scripts are found scriptdirectory = @pkgdatadir@ +# where backupninja libs are found +libdirectory = @pkglibdir@ + # whether to use colors in the log file usecolors = yes diff --git a/examples/Makefile.in b/examples/Makefile.in index e08a81f..0c17a70 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/handlers/Makefile.am b/handlers/Makefile.am index ae3ac04..dbe453d 100644 --- a/handlers/Makefile.am +++ b/handlers/Makefile.am @@ -1,5 +1,6 @@ -HANDLERS = dup maildir mysql.helper rdiff sys easydialog.sh makecd makecd.helper \ +HANDLERS = dup dup.helper maildir mysql.helper rdiff sys \ + makecd makecd.helper \ parseini rdiff.helper sys.helper ldap pgsql sh trac \ ldap.helper mysql pgsql.helper svn diff --git a/handlers/Makefile.in b/handlers/Makefile.in index a13a25a..df6dd3e 100644 --- a/handlers/Makefile.in +++ b/handlers/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -111,7 +111,8 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -HANDLERS = dup maildir mysql.helper rdiff sys easydialog.sh makecd makecd.helper \ +HANDLERS = dup dup.helper maildir mysql.helper rdiff sys \ + makecd makecd.helper \ parseini rdiff.helper sys.helper ldap pgsql sh trac \ ldap.helper mysql pgsql.helper svn diff --git a/handlers/dup.helper b/handlers/dup.helper new file mode 100644 index 0000000..7c172f0 --- /dev/null +++ b/handlers/dup.helper @@ -0,0 +1,426 @@ +HELPERS="$HELPERS dup:incremental_encrypted_remote_filesystem_backup" + +### Functions + +do_dup_host_includes() { + set -o noglob + # choose the files to backup + REPLY= + while [ -z "$REPLY" ]; do + formBegin "$dup_title - host system: includes" + for ((i=0; i < ${#dup_default_includes[@]} ; i++)); do + formItem include ${dup_default_includes[$i]} + done + formItem include "" + formItem include "" + formItem include "" + formDisplay + [ $? = 0 ] || return 1 + dup_includes=($REPLY) + done + set +o noglob +} + +do_dup_vserver() { + # choose the vservers to backup + vservers_chooser "$dup_title" + [ $? = 0 ] || return 1 + dup_vsnames="$vservers_chooser_vsnames" + + set -o noglob + # choose the files to backup + REPLY= + while [ -z "$REPLY" ]; do + formBegin "$dup_title - vservers: includes" + for ((i=0; i < ${#dup_default_includes[@]} ; i++)); do + formItem include ${dup_default_includes[$i]} + done + formItem include "" + formItem include "" + formItem include "" + formDisplay + [ $? = 0 ] || return 1 + dup_vsincludes=($REPLY) + done + set +o noglob +} + +do_dup_excludes() { + set -o noglob + formBegin "$dup_title: excludes" + for ((i=0; i < ${#dup_default_excludes[@]} ; i++)); do + formItem exclude ${dup_default_excludes[$i]} + done + formItem exclude "" + formItem exclude "" + formItem exclude "" + formDisplay + [ $? = 0 ] || return 1 + dup_excludes=($REPLY) + set +o noglob +} + +do_dup_src() { + host_or_vservers_chooser + [ $? = 0 ] || return 1 + case $host_or_vservers in + 'host') + do_dup_host_includes + [ $? = 0 ] || return 1 + ;; + 'vservers') + do_dup_vserver + [ $? = 0 ] || return 1 + ;; + 'both') + do_dup_host_includes + [ $? = 0 ] || return 1 + do_dup_vserver + [ $? = 0 ] || return 1 + ;; + *) + return 1 + ;; + esac + do_dup_excludes + [ $? = 0 ] || return 1 + + _src_done="(DONE)" + setDefault dest +} + +do_dup_dest() { + + local replyconverted + local thereply + + set -o noglob + REPLY= + while [ -z "$REPLY" -o -z "$dup_destdir" -o -z "$dup_desthost" -o -z "$dup_destuser" ]; do + formBegin "$dup_title - destination: last three items are compulsory" + formItem "desthost" "$dup_desthost" + formItem "destuser" "$dup_destuser" + formItem "destdir" "$dup_destdir" + formItem "keep" "$dup_keep" + formItem "incremental" "$dup_incremental" + formItem "bandwidthlimit" "$dup_bandwidth" + formItem "sshoptions" "$dup_sshoptions" + formDisplay + [ $? = 0 ] || return 1 + + IFS=$'' + replyconverted=`echo $REPLY | tr '\n' :` + IFS=$':' + thereply=($replyconverted) + IFS=$' \t\n' + + dup_desthost=${thereply[0]} + dup_destuser=${thereply[1]} + dup_destdir=${thereply[2]} + dup_keep=${thereply[3]} + dup_incremental=${thereply[4]} + dup_bandwidth=${thereply[5]} + dup_sshoptions=${thereply[6]} + + done + set +o noglob + + _dest_done="(DONE)" + setDefault gpg +} + +do_dup_gpg() { + + set -o noglob + + # encryptkey ? + REPLY= + while [ -z "$REPLY" -o -z "$dup_gpg_encryptkey" ]; do + inputBox "$dup_title - GnuPG" "Enter the GnuPG key ID to be used to encrypt the backups:" "$dup_gpg_encryptkey" + [ $? = 0 ] || return 1 + dup_gpg_encryptkey="$REPLY" + done + + # passphrase ? + REPLY= + while [ -z "$REPLY" -o -z "$dup_gpg_password" ]; do + passwordBox "$dup_title - GnuPG" "Enter the passphrase needed to unlock the key 0x$dup_gpg_encryptkey" + [ $? = 0 ] || return 1 + dup_gpg_password="$REPLY" + done + + # sign ? + booleanBox "$dup_title - GnuPG" "Sign the backups?" "$dup_gpg_sign" + if [ $? = 0 ]; then + dup_gpg_sign=yes + else + dup_gpg_sign=no + fi + + set +o noglob + _gpg_done="(DONE)" + setDefault conn +} + +do_dup_conn() { + _con_done="(DONE)" + setDefault adv +} + +do_dup_misc_options() { + + set -o noglob + local replyconverted + local thereply + + formBegin "$dup_title - misc. options" + formItem "nicelevel" "$dup_nicelevel" + formItem "testconnect" "$dup_testconnect" + formItem "options" "$dup_options" + formDisplay + [ $? = 0 ] || return 1 + + IFS=$'' + replyconverted=`echo $REPLY | tr '\n' :` + IFS=$':' + thereply=($replyconverted) + IFS=$' \t\n' + + dup_nicelevel=${thereply[0]} + dup_testconnect=${thereply[1]} + dup_options=${thereply[2]} + + set +o noglob +} + +# (rdiff.helper compatible interface... there could be some sode to share, hmmm.) +do_dup_adv() { + do_dup_misc_options + [ $? = 0 ] || return 1 + _adv_done="(DONE)" + setDefault finish +} + +do_dup_finish() { + get_next_filename $configdirectory/90.dup + cat > $next_filename <<EOF +# passed directly to duplicity +#options = --verbosity 8 +options = $dup_options + +# default is 0, but set to 19 if you want to lower the priority. +nicelevel = $dup_nicelevel + +# default is yes. set to no to skip the test if the remote host is alive +testconnect = $dup_testconnect + +###################################################### +## gpg section +## (how to encrypt and optionnally sign the backups) + +[gpg] + +# passphrase needed to unlock the GnuPG key +# NB: do not quote it, and it should not contain any quote +password = $dup_gpg_password + +# default is no, for backward compatibility with backupninja <= 0.5. +# when set to yes, encryptkey option must be set below. +sign = $dup_gpg_sign + +# key ID used for data encryption and, optionnally, signing. +# if not set, local root's default gpg key is used. +encryptkey = $dup_gpg_encryptkey + +###################################################### +## source section +## (where the files to be backed up are coming from) + +[source] + +# files to include in the backup +# (supports globbing with '*') +# BIG FAT WARNING +# Symlinks are not dereferenced. Moreover, an include line whose path +# contains, at any level, a symlink to a directory, will only have the +# symlink backed-up, not the target directory's content. Yes, you have +# to dereference yourself the symlinks, or to use 'mount --bind' +# instead. +# EXAMPLE +# Let's say /home is a symlink to /mnt/crypt/home ; the following line +# will only backup a "/home" symlink ; neither /home/user nor +# /home/user/Mail will be backed-up : +# include = /home/user/Mail +# A workaround is to 'mount --bind /mnt/crypt/home /home' ; another +# one is to write : +# include = /mnt/crypt/home/user/Mail +EOF + + if [ "$host_or_vservers" == 'host' -o "$host_or_vservers" == 'both' ]; then + set -o noglob + for ((i=0; i < ${#dup_includes[@]} ; i++)); do + echo "include = ${dup_includes[$i]}" >> $next_filename + done + set +o noglob + fi + + cat >> $next_filename <<EOF + +# If vservers = yes in /etc/backupninja.conf then the following variables can +# be used: +# vsnames = all | <vserver1> <vserver2> ... (default = all) +# vsinclude = <path> +# Any path specified in vsinclude is added to the include list for each vserver +# listed in vsnames (or all if vsnames = all). +# E.g. vsinclude = /home will backup the /home partition in every vserver +# listed in vsnames. If you have vsnames = "foo bar baz", this vsinclude will +# add to the include list /vservers/foo/home, /vservers/bar/home and +# /vservers/baz/home. +# Vservers paths are derived from $VROOTDIR. + +EOF + + if [ "$host_or_vservers" == 'vservers' -o "$host_or_vservers" == 'both' ]; then + set -o noglob + echo "vsnames = \"$dup_vsnames\"\n" >> $next_filename + for ((i=0; i < ${#dup_vsincludes[@]} ; i++)); do + echo "vsinclude = ${dup_vsincludes[$i]}" >> $next_filename + done + set +o noglob + fi + + # excludes + cat >> $next_filename <<EOF + +# rdiff-backup specific comment, TO ADAPT +# files to exclude from the backup +# (supports globbing with '*') +EOF + set -o noglob + for ((i=0; i < ${#dup_excludes[@]} ; i++)); do + echo exclude = ${dup_excludes[$i]} >> $next_filename + done + set +o noglob + + cat >> $next_filename <<EOF + +###################################################### +## destination section +## (where the files are copied to) + +[dest] + +# perform an incremental backup? (default = yes) +# if incremental = no, perform a full backup in order to start a new backup set +incremental = $dup_incremental + +# how many days of data to keep ; default is 60 days. +# (you can also use the time format of duplicity) +# 'keep = yes' means : do not delete old data, the remote host will take care of this +#keep = 60 +#keep = yes +keep = $dup_keep + +# bandwith limit, in kbit/s ; default is 0, i.e. no limit +#bandwidthlimit = 128 +bandwidthlimit = $dup_bandwidth + +# passed directly to ssh and scp +#sshoptions = -i /root/.ssh/id_dsa_duplicity +sshoptions = $dup_sshoptions + +# put the backups under this directory +destdir = $dup_destdir + +# the machine which will receive the backups +desthost = $dup_desthost + +# make the files owned by this user +# note: you must be able to ssh backupuser@backhost +# without specifying a password (if type = remote). +destuser = $dup_destuser + +EOF + + chmod 600 $next_filename + +} + +dup_main_menu() { + + while true; do + srcitem="choose files to include & exclude $_src_done" + destitem="configure backup destination $_dest_done" + gpgitem="configure GnuPG encryption/signing $_gpg_done" + conitem="set up ssh keys and test remote connection $_con_done" + advitem="edit advanced settings $_adv_done" + menuBox "$dup_title" "choose a step:" \ + src "$srcitem" \ + dest "$destitem" \ + gpg "$gpgitem" \ + conn "$conitem" \ + adv "$advitem" \ + finish "finish and create config file" + [ $? = 0 ] || return 1 + result="$REPLY" + + case "$result" in + "src") do_dup_src;; + "dest") do_dup_dest;; + "gpg") do_dup_gpg;; + "conn") do_dup_conn;; + "adv") do_dup_adv;; + "finish") + if [[ "$_con_done$_dest_done$_gpg_done$_src_done" != "(DONE)(DONE)(DONE)(DONE)" ]]; then + msgBox "$dup_title" "You cannot create the configuration file until the four first steps are completed." + else + do_dup_finish + break + fi + ;; + esac + + done +} + +### Main function + +dup_wizard() { + + require_packages duplicity + + # Global variables + dup_title="Duplicity action wizard" + _src_done= + _dest_done= + _con_done= + _gpg_done= + _adv_done= + declare -a dup_default_includes + declare -a dup_default_excludes + declare -a dup_includes + declare -a dup_excludes + declare -a dup_vsincludes + dup_vsnames= + dup_incremental=yes + dup_keep=60 + dup_bandwidth= + dup_sshoptions= + dup_destdir="/backups/`hostname`" + dup_desthost= + dup_destuser= + dup_gpg_sign="yes" + dup_gpg_encryptkey="" + dup_gpg_password="" + dup_nicelevel=19 + dup_testconnect=yes + dup_options= + + # Global variables whose '*' shall not be expanded + set -o noglob + dup_default_includes=(/var/spool/cron/crontabs /var/backups /etc /root /home /usr/local/*bin /var/lib/dpkg/status*) + dup_default_excludes=(/home/*/.gnupg) + set +o noglob + + dup_main_menu +} diff --git a/lib/Makefile.am b/lib/Makefile.am new file mode 100644 index 0000000..1a8ed4c --- /dev/null +++ b/lib/Makefile.am @@ -0,0 +1,6 @@ + +EXTRALIBRARIES = easydialog.sh + +EXTRA_DIST = Makefile.am $(EXTRALIBRARIES) + +dist_pkglib_DATA = $(EXTRALIBRARIES) diff --git a/lib/Makefile.in b/lib/Makefile.in new file mode 100644 index 0000000..d462ea8 --- /dev/null +++ b/lib/Makefile.in @@ -0,0 +1,290 @@ +# Makefile.in generated by automake 1.9.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = lib +DIST_COMMON = $(dist_pkglib_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +dist_pkglibDATA_INSTALL = $(INSTALL_DATA) +DATA = $(dist_pkglib_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASH = @BASH@ +CFGDIR = @CFGDIR@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +EXTRALIBRARIES = easydialog.sh +EXTRA_DIST = Makefile.am $(EXTRALIBRARIES) +dist_pkglib_DATA = $(EXTRALIBRARIES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +uninstall-info-am: +install-dist_pkglibDATA: $(dist_pkglib_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(dist_pkglib_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(dist_pkglibDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(dist_pkglibDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + done + +uninstall-dist_pkglibDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_pkglib_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-dist_pkglibDATA + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_pkglibDATA uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_pkglibDATA install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am \ + uninstall-dist_pkglibDATA uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/lib/easydialog.sh b/lib/easydialog.sh new file mode 100644 index 0000000..0113d9c --- /dev/null +++ b/lib/easydialog.sh @@ -0,0 +1,255 @@ +#!/bin/bash + +# copyright 2002 lmoore@tump.com under the terms of the GNU LGPL. +# additions 2005 collective@riseup.net + +# whiptail has trouble being called in the foo=$(whiptail ...) fashion for +# some reason. this is very annoying. this means that we need to use +# temporary files to store the answers from the input and list based boxes +# and then read the answers into a REPLY variable. that just really +# stinks, oh well, that's what you get when you have a weak link +# implementation... +# +# inputBox and passwordBox could be refactored to use a common function + +test -z "$WIDTH" && WIDTH=0 +test -z "$HEIGHT" && HEIGHT=0 +BACKTITLE="" +DIALOG=dialog +HELP= + +setApplicationTitle() { + BACKTITLE=$* +} + +setHelp() { + HELP="$@" +} + +setDimension() { + WIDTH=$1 + HEIGHT=$2 +} + +booleanBox() { + $DIALOG --backtitle "$BACKTITLE" --title "$1" \ + `[ "$3" == no ] && echo '--defaultno'` --yesno "$2" $HEIGHT $WIDTH +} + +msgBox() { + $DIALOG --backtitle "$BACKTITLE" --title "$1" \ + --msgbox "$2" $HEIGHT $WIDTH +} + +gaugeBox() { + $DIALOG --backtitle "$BACKTITLE" --title "$1" \ + --gauge "$2" $HEIGHT $WIDTH 0 +} + +inputBox() { + local temp=$(mktemp -t) || exit 1 + trap "rm -f $temp" 0 + REPLY= + $DIALOG --backtitle "$BACKTITLE" --title "$1" \ + --inputbox "$2" $HEIGHT $WIDTH "$3" 2> $temp + local status=$? + [ $status = 0 ] && REPLY=$(cat $temp) + rm -f $temp + return $status +} + +# Xdialog and {dialog,whiptail} use different mechanism to "qoute" the +# values from a checklist. {dialog,whiptail} uses standard double quoting +# while Xdialog uses a "/" as the separator. the slash is arguably better, +# but the double quoting is more standard. anyway, this function can be +# overridden to allow a derived implementation to change it's quoting +# mechanism to the standard double-quoting one. it receives two +# arguements, the file that has the data and the box type. +_listReplyHook() { + cat $1 +} + +# this is the base implementation of all the list based boxes, it works +# out nicely that way. the real function just passes it's arguments to +# this function with an extra argument specifying the actual box that +# needs to be rendered. +_genericListBox() { + local box=$1 + shift 1 + local title=$1 + local text=$2 + shift 2 + local temp=$(mktemp -t) || exit 1 + trap "rm -f $temp" 0 + REPLY= + $DIALOG $HELP $_DEFAULT --backtitle "$BACKTITLE" --title "$title" \ + $box "$text" $HEIGHT $WIDTH 10 \ + "$@" 2> $temp + local status=$? + [ $status = 0 ] && REPLY=$(_listReplyHook $temp $box) + rm -f $temp + _DEFAULT= + return $status +} + +setDefault() { + _DEFAULT="--default-item $1" +} + +menuBox() { + _genericListBox --menu "$@" +} + +## a menu box with additional help info displayed +## at the bottom of the window when an item is selected +menuBoxHelp() { + HELP="--item-help" + _genericListBox --menu "$@" + status=$? + HELP= + return $status +} + +## a menu box with an addition button 'help' +menuBoxHelpFile() { + HELP="--help-button" + _genericListBox --menu "$@" + status=$? + HELP= + return $status +} + +checkBox() { + _genericListBox --checklist "$@" +} + +radioBox() { + _genericListBox --radiolist "$@" +} + +textBox() { + $DIALOG --backtitle "$BACKTITLE" --title "$1" --textbox "$2" $HEIGHT $WIDTH +} + +passwordBox() { + local temp=$(mktemp -t) || exit 1 + trap "rm -f $temp" 0 + REPLY= + $DIALOG --backtitle "$BACKTITLE" --title "$1" \ + --passwordbox "$2" $HEIGHT $WIDTH 2> $temp + local status=$? + [ $status = 0 ] && REPLY=$(cat $temp) + rm -f $temp + return $status +} + + +######################################################### +## begin-item-display style lists +## +## these lists are built by calling fuctions multiple times. +## this can make it easier to build your list in a loop +## + +listBegin() { + _menu_title=$1 + _menu_msg=$2 + _menu_items=0 + _menu_text= + _menu_labels= + _menu_status= +} + +listItem() { + _menu_labels[$_menu_items]=$1 + _menu_text[$_menu_items]=$2 + _menu_status[$_menu_items]=$3 # available only for checklist + let "_menu_items += 1" +} + + +## +## takes one of: +## menu, checklist, radiolist +## +listDisplay() { + boxtype=$1 + local temp=$(mktemp -t) || exit 1 + trap "rm -f $temp" 0 + + local label + local text + local status + ( + echo -ne " $HELP $_DEFAULT " + echo -ne " --backtitle '$BACKTITLE' " + echo -ne " --title '$_menu_title' " + echo -ne " --$boxtype '$_menu_msg' " + echo -ne " $HEIGHT $WIDTH 10 " + for ((i=0; i < $_menu_items ; i++)); do + label=${_menu_labels[$i]} + text=${_menu_text[$i]} + status=${_menu_status[$i]} + echo -ne " $label '$text' $status " + done + ) | xargs $DIALOG 2> $temp + + local status=$? + REPLY="" + [ $status = 0 ] && REPLY=`cat $temp` + rm -f $temp + _DEFAULT= + return $status +} + +#################################################### +## FORM + +_form_gap=2 +formBegin() { + _form_title=$1 + _form_items=0 + _form_labels= + _form_text= +} + +formItem() { + _form_labels[$_form_items]=$1 + _form_text[$_form_items]=$2 + let "_form_items += 1" +} + +formDisplay() { + local temp=$(mktemp -t) || exit 1 + + max_length=0 + for ((i=0; i < ${#_form_labels[@]} ; i++)); do + label=${_form_labels[$i]} + length=`expr length $label` + if [ $length -gt $max_length ]; then + max_length=$length + fi + done + let "max_length += 2" + + local xpos=1 + ( + echo -n -e "--form '$_form_title' 0 0 20" + for ((i=0; i < $_form_items ; i++)); do + label=${_form_labels[$i]} + text=${_form_text[$i]} + echo -n -e " $label $xpos 1 '$text' $xpos $max_length 30 30" + let "xpos += _form_gap" + done + ) | xargs $DIALOG 2> $temp + local status=$? + + REPLY= + if [ $status = 0 ]; then + IFS=$'' + REPLY=`cat $temp` + IFS=$' \t\n' + fi + rm -f $temp + return $status +} diff --git a/man/Makefile.in b/man/Makefile.in index d6f635b..e6f58cc 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/src/Makefile.in b/src/Makefile.in index 8a67513..912026e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/src/ninjahelper.in b/src/ninjahelper.in index 0f5af82..7497b69 100755 --- a/src/ninjahelper.in +++ b/src/ninjahelper.in @@ -196,6 +196,15 @@ if [ ! -d "$scriptdir" ]; then echo "Script directory $scriptdir not found." exit 1 fi +libdir=`grep libdirectory $conffile | awk '{print $3}'` +if [ ! -n "$libdir" ]; then + echo "Cound not find entry 'libdirectory' in $conffile" + exit 1 +fi +if [ ! -d "$libdir" ]; then + echo "Script directory $libdir not found." + exit 1 +fi configdirectory=`grep configdirectory $conffile | awk '{print $3}'` if [ ! -n "$configdirectory" ]; then echo "Cound not find entry 'configdirectory' in $conffile" @@ -206,7 +215,7 @@ if [ ! -d "$configdirectory" ]; then exit 1 fi -. $scriptdir/easydialog.sh +. $libdir/easydialog.sh if [ "$UID" != "0" ]; then msgBox "warning" "ninjahelper must be run by root!" |