Intergrate install/uninstall files into Makefile
This commit is contained in:
parent
fde8555687
commit
d7693263ee
22
Makefile
22
Makefile
@ -1,8 +1,8 @@
|
|||||||
# note that this file does not properly handle options
|
|
||||||
|
|
||||||
|
|
||||||
PROGN:=probotic
|
PROGN:=probotic
|
||||||
|
|
||||||
|
USER := probotic
|
||||||
|
PREFIX = /opt/${USER}/
|
||||||
|
|
||||||
CFLAGS:=-std=c99 -Wall -Wextra -Wpedantic -Wvla -Wshadow -Wundef
|
CFLAGS:=-std=c99 -Wall -Wextra -Wpedantic -Wvla -Wshadow -Wundef
|
||||||
CPPFLAGS:=-I./lib/libircclient/include/ -Iinclude -D_GNU_SOURCE -DPROGN=\"${PROGN}\" -D_FORTIFY_SOURCE=2
|
CPPFLAGS:=-I./lib/libircclient/include/ -Iinclude -D_GNU_SOURCE -DPROGN=\"${PROGN}\" -D_FORTIFY_SOURCE=2
|
||||||
|
|
||||||
@ -40,4 +40,18 @@ include/config.h: config.mk.h
|
|||||||
clean:
|
clean:
|
||||||
-rm ${OBJ}
|
-rm ${OBJ}
|
||||||
|
|
||||||
.PHONY: clean
|
${PREFIX}:
|
||||||
|
mkdir $@
|
||||||
|
|
||||||
|
bootstrap:
|
||||||
|
make -C bootstrap
|
||||||
|
|
||||||
|
install: bootstrap ${PREFIX}
|
||||||
|
useradd ${USER} -r -s /sbin/nologin -d ${PREFIX} || true
|
||||||
|
install -v -g ${USER} -o ${USER} -m 744 ./bootstrap/data.sqlite ${PROGN} ${PREFIX}
|
||||||
|
chown ${USER}:${USER} ${PREFIX} -R
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
userdel -rf ${USER}
|
||||||
|
|
||||||
|
.PHONY: clean bootstrap install uninstall
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
DBFILE=probotic_data.sqlite
|
DBFILE=data.sqlite
|
||||||
|
|
||||||
rm -f "$DBFILE"
|
rm -f "$DBFILE"
|
||||||
sqlite3 "$DBFILE" -init bootstrap.sql -line '.quit'
|
sqlite3 "$DBFILE" -init bootstrap.sql -line '.quit'
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#define DBFILE "probotic_data.sqlite"
|
#define DBFILE "data.sqlite"
|
||||||
|
|
||||||
/* Disables vulnerable commands */
|
/* Disables vulnerable commands */
|
||||||
/* #define NO_VULN_COMMANDS */
|
/* #define NO_VULN_COMMANDS */
|
||||||
|
21
install.sh
21
install.sh
@ -1,21 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo "./uninstall.sh will destroy to whatever TARGET is set to, be careful!"
|
|
||||||
|
|
||||||
# VARIABLES AND PATH
|
|
||||||
TARGET=${TARGET-/opt/probotic}
|
|
||||||
DIR=$(dirname $(readlink -f "$0"))
|
|
||||||
cd $DIR
|
|
||||||
|
|
||||||
# BOOTSTRAP
|
|
||||||
cd $DIR/bootstrap && ./bootstrap.sh || exit 1
|
|
||||||
cd ..;
|
|
||||||
[ "$BOOTSTRAP_ONLY" = 1 ] && exit 0
|
|
||||||
|
|
||||||
# INSTALL
|
|
||||||
mkdir -p $TARGET
|
|
||||||
useradd probotic -r -s /sbin/nologin -d $TARGET
|
|
||||||
install -v -g probotic -o probotic -m 744 \
|
|
||||||
$DIR/bootstrap/probotic_data.sqlite probotic \
|
|
||||||
$TARGET
|
|
||||||
chown probotic:probotic $TARGET -R
|
|
@ -1,2 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
userdel -rf probotic
|
|
Reference in New Issue
Block a user