diff -Naur attr-2.4.47.orig/Makefile attr-2.4.47/Makefile
--- attr-2.4.47.orig/Makefile	2013-05-19 04:53:54.000000000 +0000
+++ attr-2.4.47/Makefile	2015-09-27 00:59:46.161333975 +0000
@@ -35,7 +35,7 @@
 LDIRT = config.log .dep config.status config.cache confdefs.h conftest* \
 	Logs/* built .census install.* install-dev.* install-lib.* *.gz
 
-LIB_SUBDIRS = include libmisc libattr
+LIB_SUBDIRS = include libmisc
 TOOL_SUBDIRS = attr getfattr setfattr examples test m4 man doc po debian package
 
 SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
diff -Naur attr-2.4.47.orig/attr/Makefile attr-2.4.47/attr/Makefile
--- attr-2.4.47.orig/attr/Makefile	2013-05-19 04:53:54.000000000 +0000
+++ attr-2.4.47/attr/Makefile	2015-09-27 00:59:31.477334206 +0000
@@ -20,9 +20,7 @@
 include $(TOPDIR)/include/builddefs
 
 LTCOMMAND = attr
-CFILES = attr.c
-LLDLIBS = $(LIBATTR)
-LTDEPENDENCIES = $(LIBATTR)
+CFILES = attr.c ../libattr/libattr.o
 
 default: $(LTCOMMAND)
 
diff -Naur attr-2.4.47.orig/getfattr/Makefile attr-2.4.47/getfattr/Makefile
--- attr-2.4.47.orig/getfattr/Makefile	2013-05-19 04:53:54.000000000 +0000
+++ attr-2.4.47/getfattr/Makefile	2015-09-27 00:59:31.477334206 +0000
@@ -22,8 +22,8 @@
 LTCOMMAND = getfattr
 CFILES = getfattr.c
 
-LLDLIBS = $(LIBMISC) $(LIBATTR)
-LTDEPENDENCIES = $(LIBMISC) $(LIBATTR)
+LLDLIBS = $(LIBMISC)
+LTDEPENDENCIES = $(LIBMISC)
 
 default: $(LTCOMMAND)
 
diff -Naur attr-2.4.47.orig/getfattr/getfattr.c attr-2.4.47/getfattr/getfattr.c
--- attr-2.4.47.orig/getfattr/getfattr.c	2013-05-19 04:53:54.000000000 +0000
+++ attr-2.4.47/getfattr/getfattr.c	2015-09-27 00:59:31.477334206 +0000
@@ -29,7 +29,7 @@
 #include <locale.h>
 #include <libgen.h>
 
-#include <attr/xattr.h>
+#include <sys/xattr.h>
 #include "config.h"
 #include "walk_tree.h"
 #include "misc.h"
diff -Naur attr-2.4.47.orig/libattr/attr_copy_fd.c attr-2.4.47/libattr/attr_copy_fd.c
--- attr-2.4.47.orig/libattr/attr_copy_fd.c	2013-05-19 04:53:54.000000000 +0000
+++ attr-2.4.47/libattr/attr_copy_fd.c	2015-09-27 00:59:31.477334206 +0000
@@ -31,7 +31,7 @@
 #endif
 
 #if defined(HAVE_ATTR_XATTR_H)
-# include <attr/xattr.h>
+# include <sys/xattr.h>
 #endif
 
 #if defined(HAVE_ATTR_LIBATTR_H)
diff -Naur attr-2.4.47.orig/libattr/attr_copy_file.c attr-2.4.47/libattr/attr_copy_file.c
--- attr-2.4.47.orig/libattr/attr_copy_file.c	2013-05-19 04:53:54.000000000 +0000
+++ attr-2.4.47/libattr/attr_copy_file.c	2015-09-27 00:59:31.477334206 +0000
@@ -31,7 +31,7 @@
 #endif
 
 #if defined(HAVE_ATTR_XATTR_H)
-# include <attr/xattr.h>
+# include <sys/xattr.h>
 #endif
 
 #if defined(HAVE_ATTR_LIBATTR_H)
diff -Naur attr-2.4.47.orig/libattr/libattr.c attr-2.4.47/libattr/libattr.c
--- attr-2.4.47.orig/libattr/libattr.c	2013-05-19 04:53:54.000000000 +0000
+++ attr-2.4.47/libattr/libattr.c	2015-09-27 00:59:31.477334206 +0000
@@ -17,12 +17,15 @@
  */
 
 #include <errno.h>
+#ifndef ENOATTR
+# define ENOATTR ENODATA        /* No such attribute */
+#endif
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <sys/types.h>
 
-#include <attr/xattr.h>
+#include <sys/xattr.h>
 #include <attr/attributes.h>
 
 #undef MAXNAMELEN
diff -Naur attr-2.4.47.orig/man/Makefile attr-2.4.47/man/Makefile
--- attr-2.4.47.orig/man/Makefile	2013-05-19 04:53:54.000000000 +0000
+++ attr-2.4.47/man/Makefile	2015-09-27 00:59:31.477334206 +0000
@@ -19,7 +19,7 @@
 TOPDIR = ..
 include $(TOPDIR)/include/builddefs
 
-SUBDIRS = man1 man2 man3 man5
+SUBDIRS = man1
 
 default : $(SUBDIRS)
 
diff -Naur attr-2.4.47.orig/setfattr/Makefile attr-2.4.47/setfattr/Makefile
--- attr-2.4.47.orig/setfattr/Makefile	2013-05-19 04:53:54.000000000 +0000
+++ attr-2.4.47/setfattr/Makefile	2015-09-27 00:59:31.477334206 +0000
@@ -22,8 +22,8 @@
 LTCOMMAND = setfattr
 CFILES = setfattr.c
 
-LLDLIBS = $(LIBMISC) $(LIBATTR)
-LTDEPENDENCIES = $(LIBMISC) $(LIBATTR)
+LLDLIBS = $(LIBMISC)
+LTDEPENDENCIES = $(LIBMISC)
 
 default: $(LTCOMMAND)
 
diff -Naur attr-2.4.47.orig/setfattr/setfattr.c attr-2.4.47/setfattr/setfattr.c
--- attr-2.4.47.orig/setfattr/setfattr.c	2013-05-19 04:53:54.000000000 +0000
+++ attr-2.4.47/setfattr/setfattr.c	2015-09-27 00:59:31.477334206 +0000
@@ -19,6 +19,7 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include <errno.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -28,7 +29,7 @@
 #include <ctype.h>
 #include <libgen.h>
 
-#include <attr/xattr.h>
+#include <sys/xattr.h>
 #include "config.h"
 #include "misc.h"
 
