summaryrefslogtreecommitdiff
path: root/package/libcap
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-02-26 20:43:47 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2015-03-02 18:55:23 +0100
commitdac409cf8e7792d666138448e22eb7146d6c2a0c (patch)
tree7e80aec31f6958f457d73abbb0800a74e672de3e /package/libcap
parent8e97e219a36a7dfa33eae5986e9ae650eaab244d (diff)
update to latest, fix build when static library build s choosen
Diffstat (limited to 'package/libcap')
-rw-r--r--package/libcap/Makefile18
-rw-r--r--package/libcap/patches/patch-Make_Rules60
-rw-r--r--package/libcap/patches/patch-Makefile25
-rw-r--r--package/libcap/patches/patch-libcap_Makefile39
-rw-r--r--package/libcap/patches/patch-pam_cap_Makefile10
5 files changed, 103 insertions, 49 deletions
diff --git a/package/libcap/Makefile b/package/libcap/Makefile
index c7227abf3..a0d982b14 100644
--- a/package/libcap/Makefile
+++ b/package/libcap/Makefile
@@ -4,25 +4,31 @@
include $(ADK_TOPDIR)/rules.mk
PKG_NAME:= libcap
-PKG_VERSION:= 2.22
-PKG_RELEASE:= 3
+PKG_VERSION:= 2.24
+PKG_RELEASE:= 1
PKG_HASH:= 73ebbd4877b5f69dd28b72098e510c5b318bc480f8201c4061ac98b78c04050f
PKG_DESCR:= capabilities library
PKG_SECTION:= libs/misc
-PKG_BUILDDEP:= pam
PKG_URL:= http://www.friedhoff.org/posixfilecaps.html
-PKG_SITES:= http://openadk.org/distfiles/
+PKG_SITES:= https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/
PKG_OPTS:= dev
-DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
-
include $(ADK_TOPDIR)/mk/package.mk
$(eval $(call PKG_template,LIBCAP,libcap,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
+# for Darwin hosts
CPPFLAGS_FOR_BUILD+= -I$(STAGING_TARGET_DIR)/usr/include
CONFIG_STYLE:= manual
+ifeq ($(ADK_TARGET_USE_STATIC_LIBS),y)
+ALL_TARGET:= static progs
+INSTALL_TARGET:= install-static
+else
+ALL_TARGET:= shared progs
+INSTALL_TARGET:= install-shared
+endif
+
libcap-install:
$(INSTALL_DIR) $(IDIR_LIBCAP)/usr/lib
$(CP) $(WRKINST)/usr/lib/libcap*.so* \
diff --git a/package/libcap/patches/patch-Make_Rules b/package/libcap/patches/patch-Make_Rules
index 09f31b3b4..a6a637d3b 100644
--- a/package/libcap/patches/patch-Make_Rules
+++ b/package/libcap/patches/patch-Make_Rules
@@ -1,59 +1,61 @@
---- libcap-2.22.orig/Make.Rules 2011-07-25 04:18:23.000000000 +0200
-+++ libcap-2.22/Make.Rules 2013-11-08 16:22:41.000000000 +0100
-@@ -12,10 +12,6 @@ FAKEROOT=$(DESTDIR)
+--- libcap-2.24.orig/Make.Rules 2014-01-06 02:16:21.000000000 +0100
++++ libcap-2.24/Make.Rules 2015-02-26 14:01:28.000000000 +0100
+@@ -12,22 +12,12 @@ FAKEROOT=$(DESTDIR)
# These choices are motivated by the fact that getcap and setcap are
# administrative operations that could be needed to recover a system.
-ifndef lib
--lib=$(shell ldd /usr/bin/ld|fgrep ld-linux|cut -d/ -f2)
+-lib=$(shell ldd /usr/bin/ld|egrep "ld-linux|ld.so"|cut -d/ -f2)
-endif
-
- ifdef prefix
- exec_prefix=$(prefix)
- lib_prefix=$(exec_prefix)
-@@ -23,7 +19,7 @@ inc_prefix=$(lib_prefix)
- man_prefix=$(prefix)/share
- else
+-ifdef prefix
+-exec_prefix=$(prefix)
+-lib_prefix=$(exec_prefix)
+-inc_prefix=$(lib_prefix)
+-man_prefix=$(prefix)/share
+-else
++lib=lib
prefix=/usr
-exec_prefix=
-+exec_prefix=/usr
++exec_prefix=$(prefix)
lib_prefix=$(exec_prefix)
inc_prefix=$(prefix)
man_prefix=$(prefix)/share
-@@ -34,7 +30,7 @@ endif
- MANDIR=$(FAKEROOT)$(man_prefix)/man
- SBINDIR=$(FAKEROOT)$(exec_prefix)/sbin
- INCDIR=$(FAKEROOT)$(inc_prefix)/include
--LIBDIR=$(FAKEROOT)$(lib_prefix)/$(lib)
-+LIBDIR=$(FAKEROOT)$(lib_prefix)/lib
+-endif
- # common defines for libcap
- LIBTITLE=libcap
-@@ -47,12 +43,13 @@ MINOR=22
- KERNEL_HEADERS := $(topdir)/libcap/include
- IPATH += -fPIC -I$(topdir)/libcap/include -I$(KERNEL_HEADERS)
+ # Target directories
+
+@@ -48,28 +38,28 @@ MINOR=24
+ KERNEL_HEADERS := $(topdir)/libcap/include/uapi
+ IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
-CC := gcc
-CFLAGS := -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+CC ?= gcc
-+CFLAGS ?= -O2
-+CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
++CFLAGS ?= -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
BUILD_CC := $(CC)
BUILD_CFLAGS := $(CFLAGS) $(IPATH)
-AR := ar
-RANLIB := ranlib
+-DEBUG = -g #-DDEBUG
+AR ?= ar
+RANLIB ?= ranlib
- DEBUG = -g #-DDEBUG
++DEBUG =
WARNINGS=-Wall -Wwrite-strings \
-Wpointer-arith -Wcast-qual -Wcast-align \
-@@ -64,11 +61,11 @@ LDFLAGS := #-g
+ -Wstrict-prototypes -Wmissing-prototypes \
+ -Wnested-externs -Winline -Wshadow
+-LD=$(CC) -Wl,-x -shared
+-LDFLAGS := #-g
++LD=$(CC) -shared
++LDFLAGS ?= #-g
+
SYSTEM_HEADERS = /usr/include
INCS=$(topdir)/libcap/include/sys/capability.h
LDFLAGS += -L$(topdir)/libcap
--CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
-+CFLAGS += -Dlinux $(WARNINGS)
- PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
+ 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/patches/patch-Makefile b/package/libcap/patches/patch-Makefile
new file mode 100644
index 000000000..8e2f8415b
--- /dev/null
+++ b/package/libcap/patches/patch-Makefile
@@ -0,0 +1,25 @@
+--- libcap-2.24.orig/Makefile 2013-12-27 19:17:17.000000000 +0100
++++ libcap-2.24/Makefile 2015-02-26 20:36:58.000000000 +0100
+@@ -16,6 +16,22 @@ endif
+ $(MAKE) -C progs $@
+ $(MAKE) -C doc $@
+
++progs:
++ $(MAKE) -C progs all
++
++shared:
++ $(MAKE) -C libcap shared
++
++static:
++ $(MAKE) -C libcap static
++
++install-shared:
++ $(MAKE) -C libcap install-shared
++
++install-static:
++ $(MAKE) -C libcap install-static
++
++
+ all-here:
+
+ install-here:
diff --git a/package/libcap/patches/patch-libcap_Makefile b/package/libcap/patches/patch-libcap_Makefile
index f45b642c9..cf7703a43 100644
--- a/package/libcap/patches/patch-libcap_Makefile
+++ b/package/libcap/patches/patch-libcap_Makefile
@@ -1,7 +1,17 @@
---- libcap-2.22.orig/libcap/Makefile 2010-08-09 00:26:04.000000000 +0200
-+++ libcap-2.22/libcap/Makefile 2013-10-28 10:46:10.000000000 +0100
-@@ -33,7 +33,7 @@ INCLUDE_GPERF_OUTPUT = -include $(GPERF_
- endif
+--- libcap-2.24.orig/libcap/Makefile 2014-01-06 01:55:03.000000000 +0100
++++ libcap-2.24/libcap/Makefile 2015-02-26 20:34:47.000000000 +0100
+@@ -28,6 +28,9 @@ GPERF_OUTPUT = _caps_output.gperf
+
+ all: $(MINLIBNAME) $(STALIBNAME) libcap.pc
+
++static: $(STALIBNAME)
++shared: $(MINLIBNAME)
++
+ ifeq ($(shell gperf --version > /dev/null 2>&1 && echo yes),yes)
+ USE_GPERF_OUTPUT = $(GPERF_OUTPUT)
+ INCLUDE_GPERF_OUTPUT = -include $(GPERF_OUTPUT)
+@@ -43,7 +46,7 @@ libcap.pc: libcap.pc.in
+ $< >$@
_makenames: _makenames.c cap_names.list.h
- $(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
@@ -9,3 +19,24 @@
cap_names.h: _makenames
./_makenames > cap_names.h
+@@ -70,6 +73,20 @@ $(MINLIBNAME): $(OBJS)
+ cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
+ $(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
+
++install-shared: install-headers
++ mkdir -p -m 0755 $(LIBDIR)
++ install -m 0644 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME)
++ ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME)
++ ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME)
++
++install-static: install-headers
++ mkdir -p -m 0755 $(LIBDIR)
++ install -m 0644 $(STALIBNAME) $(LIBDIR)/$(STALIBNAME)
++
++install-headers:
++ mkdir -p -m 0755 $(INCDIR)/sys
++ install -m 0644 include/sys/capability.h $(INCDIR)/sys
++
+ install: all
+ mkdir -p -m 0755 $(INCDIR)/sys
+ install -m 0644 include/sys/capability.h $(INCDIR)/sys
diff --git a/package/libcap/patches/patch-pam_cap_Makefile b/package/libcap/patches/patch-pam_cap_Makefile
deleted file mode 100644
index 5608fece5..000000000
--- a/package/libcap/patches/patch-pam_cap_Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
---- libcap-2.22.orig/pam_cap/Makefile 2010-08-09 02:08:01.000000000 +0200
-+++ libcap-2.22/pam_cap/Makefile 2013-11-08 16:29:05.000000000 +0100
-@@ -10,7 +10,6 @@ include ../Make.Rules
- LDLIBS += -L../libcap -lcap
-
- all: pam_cap.so
-- $(MAKE) testcompile
-
- install: all
- mkdir -p -m 0755 $(LIBDIR)/security