Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 56 lines (46 sloc) 1.133 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
#!/bin/sh
set -e

case "$1" in
"-i" | "-u")
;;
*)
echo "usage:"
echo "./install.sh -i [prefix] install FB into prefix directory"
echo "./install.sh -u [prefix] uninstall FB from prefix directory"
echo "(default prefix: /usr/local)"
exit 1
;;
esac

if [ -n "$2" ]; then
prefix="$2"
else
prefix=/usr/local
fi

if [ ! -d "$prefix" ]; then
echo "$prefix is not a valid directory"
exit 1
fi

if [ ! -w "$prefix" ]; then
echo "You need root priviledges to access $prefix"
exit 1
fi

case "$1" in
"-i")
mkdir -p -m 0755 "$prefix/bin"
install bin/fbc "$prefix/bin"

mkdir -p -m 0755 "$prefix/include/freebasic"
cp -r include/freebasic/* "$prefix/include/freebasic"

mkdir -p -m 0755 "$prefix/lib/freebasic"
cp -r lib/freebasic/* "$prefix/lib/freebasic"

mkdir -p -m 0755 "$prefix/man/man1"
gzip -c doc/fbc.1 > "$prefix/man/man1/fbc.1.gz"

echo "FreeBASIC compiler successfully installed in $prefix"
;;
"-u")
rm -f "$prefix/bin/fbc"
rm -rf "$prefix/include/freebasic"
rm -rf "$prefix/lib/freebasic"
rm -f "$prefix/man/man1/fbc.1.gz"
echo "FreeBASIC compiler successfully uninstalled from $prefix"
;;
esac
Something went wrong with that request. Please try again.