diff -rupN seafile-3.1.7-server.orig/fileserver/Makefile.am seafile-3.1.7-server/fileserver/Makefile.am
--- seafile-3.1.7-server.orig/fileserver/Makefile.am	2014-10-16 05:30:04.000000000 +0200
+++ seafile-3.1.7-server/fileserver/Makefile.am	2014-12-08 00:16:44.289364980 +0100
@@ -6,7 +6,7 @@ AM_CFLAGS = -DPKGDATADIR=\"$(pkgdatadir)
 	-I$(top_srcdir)/lib \
 	-I$(top_builddir)/lib \
 	-I$(top_srcdir)/common \
-	-I$(includedir) \
+	-I$(STAGING_DIR)$(includedir) \
 	@CCNET_CFLAGS@ \
 	@SEARPC_CFLAGS@ \
 	@GLIB2_CFLAGS@ \
