4656f8
diff -up ypserv-2.32/acinclude.m4.aliases ypserv-2.32/acinclude.m4
4656f8
--- ypserv-2.32/acinclude.m4.aliases	2005-04-07 14:38:44.000000000 +0200
4656f8
+++ ypserv-2.32/acinclude.m4	2013-11-18 09:57:05.082162773 +0100
4656f8
@@ -92,3 +92,18 @@ AC_DEFUN([TYPE_SOCKLEN_T],
4656f8
 fi
4656f8
 AC_MSG_RESULT($ac_cv___attribute__)
4656f8
 ])
4656f8
+
4656f8
+
4656f8
+dnl
4656f8
+dnl Find where aliases file is located
4656f8
+dnl It can be in /etc/aliases or /etc/mail/aliases
4656f8
+dnl If file path is specified in argument and file path exists, it is used.
4656f8
+dnl 
4656f8
+AC_DEFUN([FIND_ALIASES_PATH], [
4656f8
+AC_MSG_CHECKING(for aliases file path)
4656f8
+tmp_aliases="$1"
4656f8
+test -f /etc/mail/aliases && tmp_aliases="/etc/mail/aliases"
4656f8
+test -f /etc/aliases && tmp_aliases="/etc/aliases"
4656f8
+AC_MSG_RESULT($tmp_aliases)
4656f8
+AC_SUBST(ALIASES, $tmp_aliases)
4656f8
+])
4656f8
diff -up ypserv-2.32/configure.ac.aliases ypserv-2.32/configure.ac
4656f8
--- ypserv-2.32/configure.ac.aliases	2013-11-18 09:51:17.094758957 +0100
4656f8
+++ ypserv-2.32/configure.ac	2013-11-18 09:52:07.859844276 +0100
4656f8
@@ -151,7 +151,7 @@ fi
4656f8
 AC_SUBST(MAKE)
4656f8
 
4656f8
 dnl Check for aliases path
4656f8
-AC_PATH_PROG(ALIASES, aliases, /etc/mail/aliases, /etc/mail:/etc)
4656f8
+FIND_ALIASES_PATH(/etc/aliases)
4656f8
 
4656f8
 dnl Should we use a gethostbyname after gethostname to use FQDN ? default yes
4656f8
 AC_ARG_ENABLE(fqdn, AS_HELP_STRING([--disable-fqdn],