From 814d04d255b9beddef6391f5bf67401fcfcfa2ab Mon Sep 17 00:00:00 2001 From: Leonid Plyushch Date: Mon, 18 Mar 2019 22:01:25 +0200 Subject: [PATCH] move libcap from unstable-packages --- packages/libcap/build.sh | 18 ++++++++++++++++++ packages/libcap/libcap-makefile.patch | 12 ++++++++++++ packages/libcap/progs-capsh.patch | 25 +++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 packages/libcap/build.sh create mode 100644 packages/libcap/libcap-makefile.patch create mode 100644 packages/libcap/progs-capsh.patch diff --git a/packages/libcap/build.sh b/packages/libcap/build.sh new file mode 100644 index 000000000..b2ad5ab70 --- /dev/null +++ b/packages/libcap/build.sh @@ -0,0 +1,18 @@ +TERMUX_PKG_HOMEPAGE=https://sites.google.com/site/fullycapable/ +TERMUX_PKG_DESCRIPTION="POSIX 1003.1e capabilities" +TERMUX_PKG_LICENSE="GPL-2.0" +TERMUX_PKG_MAINTAINER="Leonid Plyushch @xeffyr" +TERMUX_PKG_VERSION=2.26 +TERMUX_PKG_REVISION=3 +TERMUX_PKG_SRCURL=https://kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-${TERMUX_PKG_VERSION}.tar.xz +TERMUX_PKG_SHA256=b630b7c484271b3ba867680d6a14b10a86cfa67247a14631b14c06731d5a458b +TERMUX_PKG_DEPENDS="attr" +TERMUX_PKG_BUILD_IN_SRC=true + +termux_step_make() { + make CC="$CC" PREFIX="$TERMUX_PREFIX" +} + +termux_step_make_install() { + make CC="$CC" prefix="$TERMUX_PREFIX" RAISE_SETFCAP=no lib=/lib install +} diff --git a/packages/libcap/libcap-makefile.patch b/packages/libcap/libcap-makefile.patch new file mode 100644 index 000000000..917fbbe56 --- /dev/null +++ b/packages/libcap/libcap-makefile.patch @@ -0,0 +1,12 @@ +diff -uNr libcap-2.26/libcap/Makefile libcap-2.26.mod/libcap/Makefile +--- libcap-2.26/libcap/Makefile 2018-09-11 06:02:10.000000000 +0300 ++++ libcap-2.26.mod/libcap/Makefile 2019-03-18 21:53:27.413691421 +0200 +@@ -35,7 +35,7 @@ + $< >$@ + + _makenames: _makenames.c cap_names.list.h +- $(BUILD_CC) $(BUILD_CFLAGS) $< -o $@ ++ gcc $(BUILD_CFLAGS) $< -o $@ + + cap_names.h: _makenames + ./_makenames > cap_names.h diff --git a/packages/libcap/progs-capsh.patch b/packages/libcap/progs-capsh.patch new file mode 100644 index 000000000..64912eaf3 --- /dev/null +++ b/packages/libcap/progs-capsh.patch @@ -0,0 +1,25 @@ +diff -uNr libcap-2.26/progs/capsh.c libcap-2.26.mod/progs/capsh.c +--- libcap-2.26/progs/capsh.c 2018-09-08 23:07:52.000000000 +0300 ++++ libcap-2.26.mod/progs/capsh.c 2019-03-05 19:42:47.917246690 +0200 +@@ -692,10 +692,10 @@ + } else if (!strcmp("--print", argv[i])) { + arg_print(); + } else if ((!strcmp("--", argv[i])) || (!strcmp("==", argv[i]))) { +- argv[i] = strdup(argv[i][0] == '-' ? "/bin/bash" : argv[0]); ++ argv[i] = strdup(argv[i][0] == '-' ? "@TERMUX_PREFIX@/bin/bash" : argv[0]); + argv[argc] = NULL; + execve(argv[i], argv+i, envp); +- fprintf(stderr, "execve /bin/bash failed!\n"); ++ fprintf(stderr, "execve @TERMUX_PREFIX@/bin/bash failed!\n"); + exit(1); + } else { + usage: +@@ -720,7 +720,7 @@ + " --killit= send signal(n) to child\n" + " --forkfor= fork and make child sleep for sec\n" + " == re-exec(capsh) with args as for --\n" +- " -- remaing arguments are for /bin/bash\n" ++ " -- remaing arguments are for $PREFIX/bin/bash\n" + " (without -- [%s] will simply exit(0))\n", + argv[0], argv[0]); +