1
0
mirror of https://git.lain.church/bake/bake.git synced 2025-04-20 17:14:09 +00:00
bake/install.sh

48 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
# source install
cd "$(dirname "$(readlink -f $0)")" || exit
TARGET="${TARGET:-/usr/local}"
INSTALL="bake"
usage() {
echo "compiles and installs Bake into /usr/local (or TARGET) in bin/"
echo ""
echo "--alternatives Includes awake and shake into the build"
echo "--target=DIRECTORY Target directory like /usr or /usr/local"
echo "--prebuilt Program is prebuilt"
echo ""
exit 1
}
while [ ! -z $1 ]; do
case $(echo "$1" | cut -d= -f1) in
"--target")
TARGET=$(echo "$1" | cut -d= -f2)
;;
"--alternatives")
INSTALL="bake shake awake"
;;
"--help")
usage
;;
"--prebuilt")
BUILD=1
;;
*)
echo "Unknown option: " $1
usage
;;
esac
shift
done
if [ -z $BUILD ]; then
./awake bake.l
fi
mkdir -p "$TARGET/bin" "$TARGET/man/man1"
install -m 755 $INSTALL "$TARGET/bin"
gzip -c bake.1 > "$TARGET/man/man1/bake.1.gz"