Better installer and fixed bug regarding build

This commit is contained in:
Emil 2023-08-02 11:07:35 -06:00
parent df424c4c45
commit c6316ac586
3 changed files with 15 additions and 7 deletions

View File

@ -14,11 +14,13 @@ LDFLAGS='-lircclient'
mkdir -p $PREFIX && echo "Made directory: $PREFIX"
if [ ! -z ${DEBUG} ] ; then CFLAG="$CFLAGS -Og -g3";
else CFLAG="$CFLAGS -O2 -flto=auto -fomit-frame-pointer"; fi
if [ ! -z ${DEBUG} ]; then CFLAG="$CFLAGS -Og -g3";
else CFLAG="$CFLAGS -O2 -flto=auto -fomit-frame-pointer -s"; fi
[ ! -z ${SAN} ] && CFLAG="$CFLAGS -fsanitize=$SAN"
[ ! -e $DIR/include/config.h ] && cp $DIR/include/config.mk.h $DIR/include/config.h
echo "$CC $CFLAGS -pipe $DIR/src/unity.c -o $PREFIX/$PROGN $CPPFLAGS $LDFLAGS"
$CC $CFLAGS -pipe $DIR/src/unity.c -o $PREFIX/$PROGN $CPPFLAGS $LDFLAGS
echo "\nStatus: $?"

View File

@ -5,11 +5,10 @@ cd $DIR
&& return
# run bootstrapper
[ ! -e $DIR/bootstrap/ ] && $DIR/bootstrap/bootstrap.sh
# generate directories and prepare for install
# generate directories and install
TARGET=${TARGET-/opt/probotic}
useradd probotic -r -s /sbin/nologin -d $TARGET
mkdir -p $TARGET
useradd -r -s /sbin/nologin probotic -d $TARGET
cp $DIR/bootstrap/probotic_data.sqlite $TARGET
install -g probotic -o probotic -m 744 \
$DIR/bootstrap/probotic_data.sqlite probotic -v $TARGET
chown probotic:probotic $TARGET -R
# install files
install -g=probotic -o=probotic -m 744 probotic -sv $TARGET

7
uninstall.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# doubles as a cleanup script
DIR=$(dirname $(readlink -f "$0"))
cd $DIR
TARGET=${TARGET-/opt/probotic}
userdel probotic
rm -rf $TARGET $DIR/bootstrap/probotic_data.sqlite probotic