File rsnapshot-configure_check-lvm-cmds_1.4.2.patch of Package rsnapshot

--- configure.ac.orig	2015-12-12 00:55:44.000000000 +0100
+++ configure.ac	2017-01-09 11:33:44.702360544 +0100
@@ -1,3 +1,8 @@
+m4_define([m4_chomp_all],
+[m4_format([[%.*s]], m4_bregexp(m4_translit([[$1]], [
+/], [/ ]), [/*$]), [$1])])  
+m4_define([m4_esyscmd_s], [m4_chomp_all(m4_esyscmd([$1]))])    
+ 
 AC_INIT([rsnapshot],[m4_esyscmd_s([git describe --tags --always --dirty])],[rsnapshot-discuss@lists.sourceforge.net])
 AM_INIT_AUTOMAKE([foreign])
 AC_PROG_MAKE_SET
@@ -237,7 +242,170 @@
 dnl either way, set the cmd_logger var
 AC_SUBST(CMD_LOGGER, "cmd_logger	$LOGGER")
 
+dnl
+dnl LVCREATE CHECK (optional program)
+dnl
+dnl if the user specified a path, try that first
+AC_ARG_WITH(lvcreate,
+        [  --with-lvcreate=PATH          Specify the path to lvcreate ],
+        [
+                if test "x$withval" != "xno"; then
+                        if test -x "$withval"; then
+                                LVCREATE=$withval
+                        else
+                                AC_MSG_ERROR(lvcreate not found)
+                        fi
+                else
+                        LVCREATE=no
+                fi
+        ]
+)
+dnl save the program for testing
+AC_SUBST(TEST_LVCREATE, "$LVCREATE")
+dnl if the user didn't specify a path, hunt for it
+if test "$LVCREATE" != "no"; then
+        if test "$LVCREATE" = ""; then
+                AC_PATH_PROG(LVCREATE, lvcreate, no)
+        fi
+fi
+dnl if we couldn't find it, provide an example
+if test "$LVCREATE" = "no"; then
+        LVCREATE=/sbin/lvcreate
+fi
+dnl either way, set the cmd_lvcreate var
+AC_SUBST(CMD_LVCREATE, "linux_lvm_cmd_lvcreate		$LVCREATE")
+
+dnl
+dnl LVREMOVE CHECK (optional program)
+dnl
+dnl if the user specified a path, try that first
+AC_ARG_WITH(lvremove,
+        [  --with-lvremove=PATH          Specify the path to lvremove ],
+        [
+                if test "x$withval" != "xno"; then
+                        if test -x "$withval"; then
+                                LVREMOVE=$withval
+                        else
+                                AC_MSG_ERROR(lvremove not found)
+                        fi
+                else
+                        LVREMOVE=no
+                fi
+        ]
+)
+dnl save the program for testing
+AC_SUBST(TEST_LVREMOVE, "$LVREMOVE")
+dnl if the user didn't specify a path, hunt for it
+if test "$LVREMOVE" != "no"; then
+        if test "$LVREMOVE" = ""; then
+                AC_PATH_PROG(LVREMOVE, lvremove, no)
+        fi
+fi
+dnl if we couldn't find it, provide an example
+if test "$LVREMOVE" = "no"; then
+        LVREMOVE=/sbin/lvremove
+fi
+dnl either way, set the cmd_lvremove var
+AC_SUBST(CMD_LVREMOVE, "linux_lvm_cmd_lvremove		$LVREMOVE")
+
+dnl
+dnl MOUNT CHECK (optional program)
+dnl
+dnl if the user specified a path, try that first
+AC_ARG_WITH(mount,
+        [  --with-mount=PATH          Specify the path to mount ],
+        [
+                if test "x$withval" != "xno"; then
+                        if test -x "$withval"; then
+                                MOUNT=$withval
+                        else
+                                AC_MSG_ERROR(mount not found)
+                        fi
+                else
+                        MOUNT=no
+                fi
+        ]
+)
+dnl save the program for testing
+AC_SUBST(TEST_MOUNT, "$MOUNT")
+dnl if the user didn't specify a path, hunt for it
+if test "$MOUNT" != "no"; then
+        if test "$MOUNT" = ""; then
+                AC_PATH_PROG(MOUNT, mount, no)
+        fi
+fi
+dnl if we couldn't find it, provide an example
+if test "$MOUNT" = "no"; then
+        MOUNT=/bin/mount
+fi
+dnl either way, set the cmd_mount var
+AC_SUBST(CMD_MOUNT, "linux_lvm_cmd_mount		$MOUNT")
+
+dnl
+dnl UMOUNT CHECK (optional program)
+dnl
+dnl if the user specified a path, try that first
+AC_ARG_WITH(umount,
+        [  --with-umount=PATH          Specify the path to umount ],
+        [
+                if test "x$withval" != "xno"; then
+                        if test -x "$withval"; then
+                                UMOUNT=$withval
+                        else
+                                AC_MSG_ERROR(umount not found)
+                        fi
+                else
+                        UMOUNT=no
+                fi
+        ]
+)
+dnl save the program for testing
+AC_SUBST(TEST_UMOUNT, "$UMOUNT")
+dnl if the user didn't specify a path, hunt for it
+if test "$UMOUNT" != "no"; then
+        if test "$UMOUNT" = ""; then
+                AC_PATH_PROG(UMOUNT, umount, no)
+        fi
+fi
+dnl if we couldn't find it, provide an example
+if test "$UMOUNT" = "no"; then
+        UMOUNT=/bin/umount
+fi
+dnl either way, set the cmd_umount var
+AC_SUBST(CMD_UMOUNT, "linux_lvm_cmd_umount		$UMOUNT")
 
+dnl
+dnl KPARTX CHECK (optional program)
+dnl
+dnl if the user specified a path, try that first
+AC_ARG_WITH(kpartx,
+        [  --with-kpartx=PATH          Specify the path to kpartx ],
+        [
+                if test "x$withval" != "xno"; then
+                        if test -x "$withval"; then
+                                KPARTX=$withval
+                        else
+                                AC_MSG_ERROR(kpartx not found)
+                        fi
+                else
+                        KPARTX=no
+                fi
+        ]
+)
+dnl save the program for testing
+AC_SUBST(TEST_KPARTX, "$KPARTX")
+dnl if the user didn't specify a path, hunt for it
+if test "$KPARTX" != "no"; then
+        if test "$KPARTX" = ""; then
+                AC_PATH_PROG(KPARTX, kpartx, no)
+        fi
+fi
+dnl if we couldn't find it, provide an example
+if test "$KPARTX" = "no"; then
+        KPARTX=/sbin/kpartx
+fi
+dnl either way, set the cmd_kpartx var
+AC_SUBST(CMD_KPARTX, "linux_lvm_cmd_kpartx		$KPARTX")
 
 dnl
 dnl DU CHECK (optional program)
openSUSE Build Service is sponsored by