From a5e909412afd1bcca46918e5e1d5459844fe8f1c Mon Sep 17 00:00:00 2001 From: John Gebbie Date: Wed, 8 Feb 2023 15:18:34 +0000 Subject: [PATCH] install: split out ./install-shell.sh --- install-shell.sh | 15 +++++++++++++++ install.sh | 12 ------------ 2 files changed, 15 insertions(+), 12 deletions(-) create mode 100755 install-shell.sh diff --git a/install-shell.sh b/install-shell.sh new file mode 100755 index 0000000..6ccb2f5 --- /dev/null +++ b/install-shell.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# ./install-shell.sh [DESTDIR] [BINDIR] + +bin="$1/${2:-usr/local/bin}" +cc -o "$bin/tiles-shell" tiles-shell.c || exit +ln -sf "$bin/tiles-shell" "$1/usr/bin/tiles-shell" 2>/dev/null +mkdir -p "$1/etc" && touch "$1/etc/shells" || exit +shells="$(sed ' +$ a \ +/usr/bin/tiles-shell +$ a \ +/bin/tiles-shell +\:^/usr/bin/tiles-shell$: d +\:^/bin/tiles-shell$: d' "$1/etc/shells")" || exit +printf %s\\n "$shells" > "$1/etc/shells" || exit diff --git a/install.sh b/install.sh index 4af1c55..058dbed 100755 --- a/install.sh +++ b/install.sh @@ -12,18 +12,6 @@ mkdir -p "$bin" || exit cp bin/* "$bin" || exit sed "s/^version=PLACEHOLDER$/version=$TILES_VERSION/" bin/tiles > "$bin/tiles" || exit -cc -o "$bin/tiles-shell" tiles-shell.c || exit -ln -sf "$bin/tiles-shell" "$1/usr/bin/tiles-shell" 2>/dev/null -mkdir -p "$1/etc" && touch "$1/etc/shells" || exit -shells="$(sed ' -$ a \ -/usr/bin/tiles-shell -$ a \ -/bin/tiles-shell -\:^/usr/bin/tiles-shell$: d -\:^/bin/tiles-shell$: d' "$1/etc/shells")" || exit -printf %s\\n "$shells" > "$1/etc/shells" || exit - mkdir -p "$1/usr/libexec/tiles" || exit cp -r libexec/* "$1/usr/libexec/tiles" || exit -- 2.38.5