From d6993000ed2f37f0a683c67a75efb5255b2eaef2 Mon Sep 17 00:00:00 2001 From: edef Date: Wed, 26 May 2021 15:30:32 +0000 Subject: ripple/fakefakeroot: a fakeroot shim Package managers and build systems love running install phases under fakeroot, which generates a lot of spurious syscalls for us. This shim takes care of that without patching build systems. The included Arch Linux PKGBUILD provides it as a replacement package for fakeroot itself. It does not attempt to fully comply with packaging guidelines, nor does it need to, since it isn't intended to be upstreamable anyway. Reviewed-by: V Change-Id: Ie9bf87d066f9bb2de7624d705b1e4527cca14d9a --- ripple/fakefakeroot/.gitignore | 5 +++++ ripple/fakefakeroot/PKGBUILD | 17 +++++++++++++++++ ripple/fakefakeroot/fakefakeroot.sh | 17 +++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 ripple/fakefakeroot/.gitignore create mode 100644 ripple/fakefakeroot/PKGBUILD create mode 100755 ripple/fakefakeroot/fakefakeroot.sh diff --git a/ripple/fakefakeroot/.gitignore b/ripple/fakefakeroot/.gitignore new file mode 100644 index 0000000..b91c0cb --- /dev/null +++ b/ripple/fakefakeroot/.gitignore @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: edef +# SPDX-License-Identifier: OSL-3.0 +/*.pkg.tar.* +/src/ +/pkg/ diff --git a/ripple/fakefakeroot/PKGBUILD b/ripple/fakefakeroot/PKGBUILD new file mode 100644 index 0000000..22cdb41 --- /dev/null +++ b/ripple/fakefakeroot/PKGBUILD @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: edef +# SPDX-License-Identifier: OSL-3.0 +pkgname=fakefakeroot +pkgver=0 +pkgrel=0 +pkgdesc='fakeroot shim' +arch=('any') +license=('OSL-3.0') +depends=('bash') +provides=('fakeroot') +conflicts=('fakeroot') +source=('./fakefakeroot.sh') +b2sums=('SKIP') + +package() { + install -Dm 0755 fakefakeroot.sh $pkgdir/usr/bin/fakeroot +} diff --git a/ripple/fakefakeroot/fakefakeroot.sh b/ripple/fakefakeroot/fakefakeroot.sh new file mode 100755 index 0000000..0f6ca7c --- /dev/null +++ b/ripple/fakefakeroot/fakefakeroot.sh @@ -0,0 +1,17 @@ +#! /bin/bash +# SPDX-FileCopyrightText: edef +# SPDX-License-Identifier: OSL-3.0 + +if [ "$*" = "-v" ]; then + echo fakefakeroot + exit 0 +fi + +if [ "$1" != "--" ]; then + echo "usage: $0 -- PROGRAM [ARG]..." >&2 + exit 255 +fi + +export FAKEROOTKEY="double-fake-root" + +shift; exec "$@" -- cgit 1.4.1