CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
libcap: updated to 2.25-2
authorVictor Martinez <pitillo@ono.com>
Thu, 3 May 2018 20:16:42 +0000 (20:16 +0000)
committerVictor Martinez <pitillo@ono.com>
Thu, 3 May 2018 20:16:42 +0000 (20:16 +0000)
libcap/.md5sum
libcap/Pkgfile
libcap/libcap-2.25-gperf.patch [new file with mode: 0644]

index 457b8d3c533b41a6889e1494b9e6cb67dda31f94..86ef8c86d8f5f4177fd9604854d42b3860060b9f 100644 (file)
@@ -1 +1,2 @@
+82ae7790afc71abb2241d9ae3deea713  libcap-2.25-gperf.patch
 6666b839e5d46c2ad33fc8aa2ceb5f77  libcap-2.25.tar.xz
index d079f14df28981d48c91cf3289fa69d0acf0cbcb..3c5e714970e2c8df270d283b3a2cb4feb01aed38 100644 (file)
@@ -6,12 +6,14 @@
 
 name=libcap
 version=2.25
-release=1
-source=(https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/$name-$version.tar.xz)
+release=2
+source=(https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/$name-$version.tar.xz
+        $name-$version-gperf.patch)
 
 build () {
   cd libcap-$version
 
+  patch -p1 -i $SRC/$name-$version-gperf.patch
   sed -i "/^CFLAGS/s/-O2/$CFLAGS/" Make.Rules 
 
   make CC="$CC" BUILD_CC="gcc" BUILD_CFLAGS="-O2 -pipe" PAM_CAP=no
diff --git a/libcap/libcap-2.25-gperf.patch b/libcap/libcap-2.25-gperf.patch
new file mode 100644 (file)
index 0000000..45007a9
--- /dev/null
@@ -0,0 +1,31 @@
+From 13992f56d80c0ee20e08f99b8e8ff37d63e65f9d Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Mon, 16 Jan 2017 12:09:35 -0500
+Subject: [PATCH] Fix build with gperf-3.1
+
+gperf-3.1 lookup functions take a size_t instead of unsigned int.
+
+To resolve this:
+
+1. Pass --includes to gperf so that size_t is defined.
+2. Remove __cap_lookup_name declaration.
+---
+ libcap/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libcap/Makefile b/libcap/Makefile
+index d189777..634a042 100644
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -41,7 +41,7 @@ cap_names.h: _makenames
+       ./_makenames > cap_names.h
+ $(GPERF_OUTPUT): cap_names.list.h
+-      perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
++      perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --includes --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
+ cap_names.list.h: Makefile $(KERNEL_HEADERS)/linux/capability.h
+       @echo "=> making $@ from $(KERNEL_HEADERS)/linux/capability.h"
+-- 
+2.11.0
+