--- zabbix-2.2.2/configure.ac.orig
+++ zabbix-2.2.2/configure.ac
@@ -1362,22 +1362,6 @@
 
 dnl *****************************************************************
 dnl *                                                               *
-dnl *                         Other checks                          *
-dnl *                                                               *
-dnl *****************************************************************
-
-dnl Automake 1.8 to 1.9.6 sets mkdir_p macro (lower-cased).
-AC_MSG_CHECKING(for mkdir -p candidate)
-if test "x${MKDIR_P}" = "x"; then
-        if test "x${mkdir_p}" = "x"; then
-                AC_MSG_ERROR([No suitable "mkdir -p" candidate found.])
-        fi
-        AC_SUBST([MKDIR_P], ${mkdir_p})
-fi
-AC_MSG_RESULT([ok (${MKDIR_P})])
-
-dnl *****************************************************************
-dnl *                                                               *
 dnl *                 Output configuration results                  *
 dnl *                                                               *
 dnl *****************************************************************
--- zabbix-2.2.0/src/zabbix_server/Makefile.am.orig	2013-11-12 06:07:24.000000000 +0000
+++ zabbix-2.2.0/src/zabbix_server/Makefile.am	2013-11-18 18:48:17.430570137 +0000
@@ -87,14 +87,10 @@
 	-I@top_srcdir@/src/libs/zbxdbcache
 
 SERVER_CONFIG = zabbix_server.conf
-INCLUDE_DIR = $(DESTDIR)@sysconfdir@/$(SERVER_CONFIG).d
-EXSCRIPTS_DIR = $(DESTDIR)@datadir@/zabbix/externalscripts
-ALSCRIPTS_DIR = $(DESTDIR)@datadir@/zabbix/alertscripts
-MODULES_DIR = $(DESTDIR)@libdir@
 
 install-data-hook:
-	$(MKDIR_P) "$(INCLUDE_DIR)"
-	$(MKDIR_P) "$(EXSCRIPTS_DIR)"
-	$(MKDIR_P) "$(ALSCRIPTS_DIR)"
-	$(MKDIR_P) "$(MODULES_DIR)"
+	$(mkinstalldirs) $(DESTDIR)@sysconfdir@/$(SERVER_CONFIG).d
+	$(mkinstalldirs) $(DESTDIR)@datadir@/zabbix/externalscripts
+	$(mkinstalldirs) $(DESTDIR)@datadir@/zabbix/alertscripts
+	$(mkinstalldirs) $(DESTDIR)@libdir@
 	test -f "$(DESTDIR)@sysconfdir@/$(SERVER_CONFIG)" || cp "../../conf/$(SERVER_CONFIG)" "$(DESTDIR)@sysconfdir@"
--- zabbix-2.2.0/src/zabbix_proxy/Makefile.am.orig	2013-11-18 18:51:21.413681404 +0000
+++ zabbix-2.2.0/src/zabbix_proxy/Makefile.am	2013-11-18 18:52:23.234062723 +0000
@@ -71,7 +71,7 @@
 MODULES_DIR = $(DESTDIR)@libdir@
 
 install-data-hook:
-	$(MKDIR_P) "$(INCLUDE_DIR)"
-	$(MKDIR_P) "$(EXSCRIPTS_DIR)"
-	$(MKDIR_P) "$(MODULES_DIR)"
+	$(mkinstalldirs) $(DESTDIR)@sysconfdir@/$(PROXY_CONFIG).d
+	$(mkinstalldirs) $(DESTDIR)@datadir@/zabbix/externalscripts
+	$(mkinstalldirs) $(DESTDIR)@libdir@
 	test -f "$(DESTDIR)@sysconfdir@/$(PROXY_CONFIG)" || cp "../../conf/$(PROXY_CONFIG)" "$(DESTDIR)@sysconfdir@"
--- zabbix-2.2.0/src/zabbix_java/Makefile.am.orig	2013-11-18 18:52:53.972747864 +0000
+++ zabbix-2.2.0/src/zabbix_java/Makefile.am	2013-11-18 18:54:08.096401596 +0000
@@ -26,12 +26,12 @@
 	java -classpath class/tests:$(LIB):$(ZJG):$(JUNIT) com.zabbix.gateway.AllTestRunner
 
 class:
-	$(MKDIR_P) class/src
-	$(MKDIR_P) class/tests
+	$(mkinstalldirs) class/src
+	$(mkinstalldirs) class/tests
 
 install: all
-	$(MKDIR_P) "$(ZJG_DEST)/bin"
-	$(MKDIR_P) "$(ZJG_DEST)/lib"
+	$(mkinstalldirs) "$(ZJG_DEST)/bin"
+	$(mkinstalldirs) "$(ZJG_DEST)/lib"
 	cp startup.sh shutdown.sh "$(ZJG_DEST)"
 	if test ! -f "$(ZJG_DEST)/settings.sh"; then cp settings.sh "$(ZJG_DEST)"; fi
 	cp $(ZJG) "$(ZJG_DEST)/bin"
--- zabbix-2.2.0/src/zabbix_agent/Makefile.am.orig	2013-11-18 18:55:41.105466459 +0000
+++ zabbix-2.2.0/src/zabbix_agent/Makefile.am	2013-11-18 18:59:49.834988638 +0000
@@ -66,13 +66,10 @@
 
 AGENT_CONFIG = zabbix_agent.conf
 AGENTD_CONFIG = zabbix_agentd.conf
-AGENT_INCLUDE_DIR = $(DESTDIR)@sysconfdir@/$(AGENT_CONFIG).d
-AGENTD_INCLUDE_DIR = $(DESTDIR)@sysconfdir@/$(AGENTD_CONFIG).d
-MODULES_DIR = $(DESTDIR)@libdir@
 
 install-data-hook:
-	$(MKDIR_P) "$(AGENT_INCLUDE_DIR)"
-	$(MKDIR_P) "$(AGENTD_INCLUDE_DIR)"
-	$(MKDIR_P) "$(MODULES_DIR)"
+	$(mkinstalldirs) $(DESTDIR)@sysconfdir@/$(AGENT_CONFIG).d
+	$(mkinstalldirs) $(DESTDIR)@sysconfdir@/$(AGENTD_CONFIG).d
+	$(mkinstalldirs) $(DESTDIR)@libdir@
 	test -f "$(DESTDIR)@sysconfdir@/$(AGENT_CONFIG)" || cp "../../conf/$(AGENT_CONFIG)" "$(DESTDIR)@sysconfdir@"
 	test -f "$(DESTDIR)@sysconfdir@/$(AGENTD_CONFIG)" || cp "../../conf/$(AGENTD_CONFIG)" "$(DESTDIR)@sysconfdir@"
