-AC_CHECK_PROG(FAKEROOT,[fakeroot],[fakeroot],[no])
-if test "x$FAKEROOT" = "xno" ; then
- AC_MSG_FAILURE([fakeroot program not found])
+dnl For yum-rpm handler.
+AC_CHECK_PROG(YUM,[yum],[yum],[no])
+AC_CHECK_PROG(RPM,[rpm],[rpm],[no])
+AC_CHECK_PROG(YUMDOWNLOADER,[yumdownloader],[yumdownloader],[no])
+
+dnl For Debian handler.
+AC_CHECK_PROG(APTITUDE,[aptitude],[aptitude],[no])
+AC_CHECK_PROG(APT_CACHE,[apt-cache],[apt-cache],[no])
+AC_CHECK_PROG(DPKG,[dpkg],[dpkg],[no])
+
+dnl Include workaround for broken apt-cache depends --recurse (Ubuntu 10.04)?
+if test "x$APT_CACHE" != "xno"; then
+ AC_MSG_CHECKING([if apt-cache depends --recurse is broken])
+ if ! $APT_CACHE depends --recurse -i bash | grep -q '^libc6$'; then
+ AC_MSG_RESULT([yes])
+ APT_CACHE_DEPENDS_RECURSE_BROKEN=true
+ else
+ AC_MSG_RESULT([no])
+ APT_CACHE_DEPENDS_RECURSE_BROKEN=false
+ fi
+else
+ APT_CACHE_DEPENDS_RECURSE_BROKEN=false