diff --git a/install.sh b/install.sh index 9b22c49..b1f656d 100755 --- a/install.sh +++ b/install.sh @@ -2,15 +2,22 @@ set -e -DESTDIR=$1 -BINDIR=$DESTDIR/usr/bin -LIBDIR=$DESTDIR/usr/share/grc -MANDIR=$DESTDIR/usr/share/man/man1 -CONFDIR=$DESTDIR/etc +PREFIX=$1 +if [ -z $PREFIX ]; then + PREFIX=/usr/local +fi + +BINDIR=$PREFIX/bin +LIBDIR=$PREFIX/share/grc +MANDIR=$PREFIX/share/man +CONFDIR=/etc +PROFILEDIR=$CONFDIR/profile.d mkdir -p $BINDIR || true cp -fv grc grcat $BINDIR mkdir -p $LIBDIR || true cp -fv conf.* $LIBDIR -mkdir -p $CONFDIR || true +cp -fv $MANDIR/man1/grc.1 $MANDIR +cp -fv $MANDIR/man1/grcat.1 $MANDIR cp -fv grc.conf $CONFDIR +cp -fv grc.bashrc $PROFILEDIR