LogSQL/buildLogSQLite

42 lines
948 B
Bash
Executable File

#!/bin/bash
ZNCBUILD=`which znc-buildmod`
if [ -f logSQLite.buildconfig ]; then
. ./logSQLite.buildconfig
fi
if [ "$ZNCBUILD" = "" ]; then
echo "Where is znc-buildmod:"
read ZNCBUILD
if [ "$ZNCBUILD" = "" ]; then
exit
fi
fi
if [ "$SQLITE" = "" ]; then
echo "Where is SQLite path [/usr]:"
read SQLITE
if [ "$SQLITE" = "" ]; then
SQLITE="/usr"
fi
fi
if [ "$ZNCCONFIG" = "" ]; then
echo "Where is ZNC configuration path [$HOME/.znc]:"
read ZNCCONFIG
if [ "$ZNCCONFIG" = "" ]; then
ZNCCONFIG="$HOME/.znc"
fi
fi
if [ ! -f logSQLite.buildconfig ]; then
echo "#!/bin/bash" > logSQLite.buildconfig
echo "ZNCBUILD=\"$ZNCBUILD\"" >> logSQLite.buildconfig
echo "SQLITE=\"$SQLITE\"" >> logSQLite.buildconfig
echo "ZNCCONFIG=\"$ZNCCONFIG\"" >> logSQLite.buildconfig
chmod 755 logSQLite.buildconfig
fi
LDFLAGS="-L $SQLITE/lib -lsqlite3 -I $SQLITE/include" "$ZNCBUILD" logsqlite.cpp
cp logsqlite.so "$ZNCCONFIG/modules/logsqlite.so"