summaryrefslogtreecommitdiff
path: root/package/libcap
diff options
context:
space:
mode:
Diffstat (limited to 'package/libcap')
-rw-r--r--package/libcap/Makefile43
-rw-r--r--package/libcap/patches/patch-Make_Rules11
-rw-r--r--package/libcap/patches/patch-libcap_Makefile11
-rw-r--r--package/libcap/patches/patch-libcap_libcap_pc_in13
4 files changed, 78 insertions, 0 deletions
diff --git a/package/libcap/Makefile b/package/libcap/Makefile
new file mode 100644
index 000000000..dcf979717
--- /dev/null
+++ b/package/libcap/Makefile
@@ -0,0 +1,43 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(ADK_TOPDIR)/rules.mk
+
+PKG_NAME:= libcap
+PKG_VERSION:= 2.59
+PKG_RELEASE:= 1
+PKG_HASH:= 49f64ae40b113e53cbc161e22af7094e3bb4a0611fa33ef5a4257b011779f034
+PKG_DESCR:= capabilities library
+PKG_SECTION:= libs/misc
+PKG_URL:= http://www.friedhoff.org/posixfilecaps.html
+PKG_SITES:= https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/
+PKG_OPTS:= dev
+
+include $(ADK_TOPDIR)/mk/host.mk
+include $(ADK_TOPDIR)/mk/package.mk
+
+$(eval $(call HOST_template,LIBCAP,libcap,$(PKG_VERSION)-$(PKG_RELEASE)))
+$(eval $(call PKG_template,LIBCAP,libcap,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION),$(PKG_OPTS)))
+
+HOST_STYLE:= manual
+CONFIG_STYLE:= manual
+MAKE_ENV+= BUILD_CC="${HOST_CC}"
+ifeq ($(ADK_PACKAGE_PAM),)
+MAKE_ENV+= PAM_CAP=no
+endif
+
+host-build:
+ (cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
+ ${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET}) $(MAKE_TRACE)
+
+libcap-hostinstall:
+ cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
+ ${HOST_FAKE_FLAGS} DESTDIR='${STAGING_HOST_DIR}' ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
+
+libcap-install:
+ $(INSTALL_DIR) $(IDIR_LIBCAP)/usr/lib
+ $(CP) $(WRKINST)/usr/lib/libcap*.so* \
+ $(IDIR_LIBCAP)/usr/lib
+
+include $(ADK_TOPDIR)/mk/host-bottom.mk
+include $(ADK_TOPDIR)/mk/pkg-bottom.mk
diff --git a/package/libcap/patches/patch-Make_Rules b/package/libcap/patches/patch-Make_Rules
new file mode 100644
index 000000000..b40545b48
--- /dev/null
+++ b/package/libcap/patches/patch-Make_Rules
@@ -0,0 +1,11 @@
+--- libcap-2.59.orig/Make.Rules 2021-09-27 03:18:19.000000000 +0200
++++ libcap-2.59/Make.Rules 2021-10-12 14:15:43.966424789 +0200
+@@ -18,7 +18,7 @@ FAKEROOT=$(DESTDIR)
+ # administrative operations that could be needed to recover a system.
+
+ ifndef lib
+-lib=$(shell ldd /usr/bin/ld|egrep "ld-linux|ld.so"|cut -d/ -f2)
++lib=/usr/lib
+ endif
+
+ ifndef sbin
diff --git a/package/libcap/patches/patch-libcap_Makefile b/package/libcap/patches/patch-libcap_Makefile
new file mode 100644
index 000000000..6dcb3e073
--- /dev/null
+++ b/package/libcap/patches/patch-libcap_Makefile
@@ -0,0 +1,11 @@
+--- libcap-2.59.orig/libcap/Makefile 2021-09-18 05:56:21.000000000 +0200
++++ libcap-2.59/libcap/Makefile 2021-10-12 14:20:14.254434411 +0200
+@@ -76,7 +76,7 @@ $(PSXTITLE).pc: $(PSXTITLE).pc.in
+ $< >$@
+
+ _makenames: _makenames.c cap_names.list.h
+- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
++ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $< -o $@
+
+ cap_names.h: _makenames
+ ./_makenames > cap_names.h
diff --git a/package/libcap/patches/patch-libcap_libcap_pc_in b/package/libcap/patches/patch-libcap_libcap_pc_in
new file mode 100644
index 000000000..0d61c60a8
--- /dev/null
+++ b/package/libcap/patches/patch-libcap_libcap_pc_in
@@ -0,0 +1,13 @@
+--- libcap-2.59.orig/libcap/libcap.pc.in 2020-07-01 04:43:01.000000000 +0200
++++ libcap-2.59/libcap/libcap.pc.in 2021-10-12 14:15:43.958424789 +0200
+@@ -1,7 +1,7 @@
+ prefix=@prefix@
+-exec_prefix=@exec_prefix@
+-libdir=@libdir@
+-includedir=@includedir@
++exec_prefix=${prefix}
++libdir=${prefix}/lib
++includedir=${prefix}/include
+
+ Name: libcap
+ Description: libcap - linux capabilities library