~geb/tiles

a5e909412afd1bcca46918e5e1d5459844fe8f1c — John Gebbie a month ago ba23a7f dev
install: split out ./install-shell.sh
2 files changed, 15 insertions(+), 12 deletions(-)

A install-shell.sh
M install.sh
A install-shell.sh => install-shell.sh +15 -0
@@ 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

M install.sh => install.sh +0 -12
@@ 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