From 4336ab7615a01d4b2d426353ec996bb5bad07c23 Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Fri, 26 Oct 2018 16:25:40 +0300 Subject: [PATCH] new package: libcap - needed by QEMU for VirtFS --- x11-packages/libcap/build.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 x11-packages/libcap/build.sh diff --git a/x11-packages/libcap/build.sh b/x11-packages/libcap/build.sh new file mode 100644 index 000000000..0b52ec970 --- /dev/null +++ b/x11-packages/libcap/build.sh @@ -0,0 +1,29 @@ +TERMUX_PKG_MAINTAINER="Leonid Plyushch @xeffyr" + +TERMUX_PKG_HOMEPAGE=http://sites.google.com/site/fullycapable/ +TERMUX_PKG_DESCRIPTION="POSIX 1003.1e capabilities" +TERMUX_PKG_VERSION=2.25 +TERMUX_PKG_SRCURL=https://kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-${TERMUX_PKG_VERSION}.tar.xz +TERMUX_PKG_SHA256=693c8ac51e983ee678205571ef272439d83afe62dd8e424ea14ad9790bc35162 +TERMUX_PKG_DEPENDS="attr" +TERMUX_PKG_BUILD_IN_SRC=true + +termux_step_make() { + cd libcap + + perl -e 'while ($l=<>) { if ($l =~ /^\#define[ \t](CAP[_A-Z]+)[ \t]+([0-9]+)\s+$/) { $tok=$1; $val=$2; $tok =~ tr/A-Z/a-z/; print "{\"$tok\",$val},\n"; } }' ./include/uapi/linux/capability.h | fgrep -v 0x > ./cap_names.list.h + gcc -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -I./include/uapi -I./include _makenames.c -o _makenames + touch -d "next hour" _makenames + + 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; }' < cap_names.list.h | 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 > _caps_output.gperf + sed 's@^@#include @' _caps_output.gperf > _caps_output.gperf + touch -d "next hour" _caps_output.gperf + + cd - + make CC=${CC} PREFIX=${TERMUX_PREFIX} +} + +termux_step_make_install() { + make CC=${CC} prefix=${TERMUX_PREFIX} RAISE_SETFCAP=no lib=/lib install + #rm -f ${TERMUX_PREFIX}/lib/libcap.so* +}