From 3fbe7b67e71ded1b6dfba600bba87bcca5491f8b Mon Sep 17 00:00:00 2001 From: Gustavo Zacarias Date: Sun, 2 Nov 2014 09:50:40 -0300 Subject: libcap: add upstream xattr patch Add upstream patch for xattr include fix. Also rename patches to git naming convention. Fixes: http://autobuild.buildroot.net/results/2ef/2efb25356bc87ba0e1be08214eaa28ac064ad6c3/ Signed-off-by: Gustavo Zacarias Reviewed-by: "Yann E. MORIN" Signed-off-by: Peter Korsgaard --- package/libcap/0001-build-system.patch | 54 ++++++++++++++++++++++ .../libcap/0002-split-static-shared-install.patch | 30 ++++++++++++ ...nge-the-location-we-include-linux-xattr.h.patch | 46 ++++++++++++++++++ package/libcap/libcap-01-build-system.patch | 54 ---------------------- .../libcap-02-split-static-shared-install.patch | 30 ------------ 5 files changed, 130 insertions(+), 84 deletions(-) create mode 100644 package/libcap/0001-build-system.patch create mode 100644 package/libcap/0002-split-static-shared-install.patch create mode 100644 package/libcap/0003-Change-the-location-we-include-linux-xattr.h.patch delete mode 100644 package/libcap/libcap-01-build-system.patch delete mode 100644 package/libcap/libcap-02-split-static-shared-install.patch diff --git a/package/libcap/0001-build-system.patch b/package/libcap/0001-build-system.patch new file mode 100644 index 000000000..8915a69ec --- /dev/null +++ b/package/libcap/0001-build-system.patch @@ -0,0 +1,54 @@ +Avoid the libcap buildsys forcing CC/CFLAGS/LDFLAGS/AR/RANLIB +Also install the shared lib +x + +Signed-off-by: Gustavo Zacarias + +diff -Nura libcap-2.22.orig/libcap/Makefile libcap-2.22/libcap/Makefile +--- libcap-2.22.orig/libcap/Makefile 2010-08-08 19:26:04.000000000 -0300 ++++ libcap-2.22/libcap/Makefile 2011-12-14 11:33:51.761800334 -0300 +@@ -65,7 +65,7 @@ + install -m 0644 include/sys/capability.h $(INCDIR)/sys + mkdir -p -m 0755 $(LIBDIR) + install -m 0644 $(STALIBNAME) $(LIBDIR)/$(STALIBNAME) +- install -m 0644 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME) ++ install -m 0755 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME) + ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME) + ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME) + ifeq ($(FAKEROOT),) +diff -Nura libcap-2.22.orig/Make.Rules libcap-2.22/Make.Rules +--- libcap-2.22.orig/Make.Rules 2011-07-24 23:18:23.000000000 -0300 ++++ libcap-2.22/Make.Rules 2011-12-14 11:33:28.707278685 -0300 +@@ -47,25 +47,25 @@ + KERNEL_HEADERS := $(topdir)/libcap/include + IPATH += -fPIC -I$(topdir)/libcap/include -I$(KERNEL_HEADERS) + +-CC := gcc +-CFLAGS := -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 +-BUILD_CC := $(CC) +-BUILD_CFLAGS := $(CFLAGS) $(IPATH) +-AR := ar +-RANLIB := ranlib ++CC ?= gcc ++CFLAGS ?= -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 ++BUILD_CC ?= $(CC) ++BUILD_CFLAGS ?= $(CFLAGS) $(IPATH) ++AR ?= ar ++RANLIB ?= ranlib + DEBUG = -g #-DDEBUG + WARNINGS=-Wall -Wwrite-strings \ + -Wpointer-arith -Wcast-qual -Wcast-align \ + -Wstrict-prototypes -Wmissing-prototypes \ + -Wnested-externs -Winline -Wshadow + LD=$(CC) -Wl,-x -shared +-LDFLAGS := #-g ++LDFLAGS ?= #-g + + SYSTEM_HEADERS = /usr/include + INCS=$(topdir)/libcap/include/sys/capability.h + LDFLAGS += -L$(topdir)/libcap + CFLAGS += -Dlinux $(WARNINGS) $(DEBUG) +-PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi) ++PAM_CAP = no + INDENT := $(shell if [ -n "$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi) + DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi) + LIBATTR := yes diff --git a/package/libcap/0002-split-static-shared-install.patch b/package/libcap/0002-split-static-shared-install.patch new file mode 100644 index 000000000..21e7f2afc --- /dev/null +++ b/package/libcap/0002-split-static-shared-install.patch @@ -0,0 +1,30 @@ +libcap: split install into install-shared/install-static + +In order to support static only builds, split the install target into +install-shared and install-static targets. + +Signed-off-by: Thomas Petazzoni + +Index: b/libcap/Makefile +=================================================================== +--- a/libcap/Makefile ++++ b/libcap/Makefile +@@ -60,11 +60,17 @@ + cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS) + $(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@ + +-install: all ++install: install-shared install-static ++ ++install-common: + mkdir -p -m 0755 $(INCDIR)/sys + install -m 0644 include/sys/capability.h $(INCDIR)/sys + mkdir -p -m 0755 $(LIBDIR) ++ ++install-static: install-common + install -m 0644 $(STALIBNAME) $(LIBDIR)/$(STALIBNAME) ++ ++install-shared: install-common + install -m 0755 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME) + ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME) + ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME) diff --git a/package/libcap/0003-Change-the-location-we-include-linux-xattr.h.patch b/package/libcap/0003-Change-the-location-we-include-linux-xattr.h.patch new file mode 100644 index 000000000..78587802a --- /dev/null +++ b/package/libcap/0003-Change-the-location-we-include-linux-xattr.h.patch @@ -0,0 +1,46 @@ +From 84fb6007dcc7f6b6da9f6dab77a487c22b6c7beb Mon Sep 17 00:00:00 2001 +From: Andrew G Morgan +Date: Sun, 9 Mar 2014 16:33:15 -0700 +Subject: [PATCH] Change the location we include linux/xattr.h + +This header stuff seems a bit fragile, but Serge reports including +it in sys/capability.h was causing a lot of trouble building dependent +app packages. + +From the perspective of libcap, this API is only needed internally in +cap_file.c so we put an include there. + +Status: upstream. + +Signed-off-by: Andrew G Morgan +Signed-off-by: Gustavo Zacarias +--- + +diff --git a/libcap/cap_file.c b/libcap/cap_file.c +index d3dc1d0..553c2d2 100644 +--- a/libcap/cap_file.c ++++ b/libcap/cap_file.c +@@ -10,6 +10,8 @@ + #include + #include + ++#include ++ + #define XATTR_SECURITY_PREFIX "security." + + #include "libcap.h" +diff --git a/libcap/include/sys/capability.h b/libcap/include/sys/capability.h +index 64ac50e..dddc75b 100644 +--- a/libcap/include/sys/capability.h ++++ b/libcap/include/sys/capability.h +@@ -27,7 +27,6 @@ extern "C" { + #define __user + #endif + #include +-#include + + /* + * POSIX capability types +-- +2.0.4 + diff --git a/package/libcap/libcap-01-build-system.patch b/package/libcap/libcap-01-build-system.patch deleted file mode 100644 index 8915a69ec..000000000 --- a/package/libcap/libcap-01-build-system.patch +++ /dev/null @@ -1,54 +0,0 @@ -Avoid the libcap buildsys forcing CC/CFLAGS/LDFLAGS/AR/RANLIB -Also install the shared lib +x - -Signed-off-by: Gustavo Zacarias - -diff -Nura libcap-2.22.orig/libcap/Makefile libcap-2.22/libcap/Makefile ---- libcap-2.22.orig/libcap/Makefile 2010-08-08 19:26:04.000000000 -0300 -+++ libcap-2.22/libcap/Makefile 2011-12-14 11:33:51.761800334 -0300 -@@ -65,7 +65,7 @@ - install -m 0644 include/sys/capability.h $(INCDIR)/sys - mkdir -p -m 0755 $(LIBDIR) - install -m 0644 $(STALIBNAME) $(LIBDIR)/$(STALIBNAME) -- install -m 0644 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME) -+ install -m 0755 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME) - ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME) - ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME) - ifeq ($(FAKEROOT),) -diff -Nura libcap-2.22.orig/Make.Rules libcap-2.22/Make.Rules ---- libcap-2.22.orig/Make.Rules 2011-07-24 23:18:23.000000000 -0300 -+++ libcap-2.22/Make.Rules 2011-12-14 11:33:28.707278685 -0300 -@@ -47,25 +47,25 @@ - KERNEL_HEADERS := $(topdir)/libcap/include - IPATH += -fPIC -I$(topdir)/libcap/include -I$(KERNEL_HEADERS) - --CC := gcc --CFLAGS := -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 --BUILD_CC := $(CC) --BUILD_CFLAGS := $(CFLAGS) $(IPATH) --AR := ar --RANLIB := ranlib -+CC ?= gcc -+CFLAGS ?= -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -+BUILD_CC ?= $(CC) -+BUILD_CFLAGS ?= $(CFLAGS) $(IPATH) -+AR ?= ar -+RANLIB ?= ranlib - DEBUG = -g #-DDEBUG - WARNINGS=-Wall -Wwrite-strings \ - -Wpointer-arith -Wcast-qual -Wcast-align \ - -Wstrict-prototypes -Wmissing-prototypes \ - -Wnested-externs -Winline -Wshadow - LD=$(CC) -Wl,-x -shared --LDFLAGS := #-g -+LDFLAGS ?= #-g - - SYSTEM_HEADERS = /usr/include - INCS=$(topdir)/libcap/include/sys/capability.h - LDFLAGS += -L$(topdir)/libcap - CFLAGS += -Dlinux $(WARNINGS) $(DEBUG) --PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi) -+PAM_CAP = no - INDENT := $(shell if [ -n "$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi) - DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi) - LIBATTR := yes diff --git a/package/libcap/libcap-02-split-static-shared-install.patch b/package/libcap/libcap-02-split-static-shared-install.patch deleted file mode 100644 index 21e7f2afc..000000000 --- a/package/libcap/libcap-02-split-static-shared-install.patch +++ /dev/null @@ -1,30 +0,0 @@ -libcap: split install into install-shared/install-static - -In order to support static only builds, split the install target into -install-shared and install-static targets. - -Signed-off-by: Thomas Petazzoni - -Index: b/libcap/Makefile -=================================================================== ---- a/libcap/Makefile -+++ b/libcap/Makefile -@@ -60,11 +60,17 @@ - cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS) - $(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@ - --install: all -+install: install-shared install-static -+ -+install-common: - mkdir -p -m 0755 $(INCDIR)/sys - install -m 0644 include/sys/capability.h $(INCDIR)/sys - mkdir -p -m 0755 $(LIBDIR) -+ -+install-static: install-common - install -m 0644 $(STALIBNAME) $(LIBDIR)/$(STALIBNAME) -+ -+install-shared: install-common - install -m 0755 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME) - ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME) - ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME) -- cgit v1.2.3