make new installs easier

Add make target and script option to install debs
This commit is contained in:
Eric House 2017-10-10 19:50:03 -07:00
parent 36aef059c1
commit 4717308c4d
2 changed files with 26 additions and 1 deletions

View file

@ -70,6 +70,24 @@ endif
memdebug all: xwrelay rq
REQUIRED_DEBS = libpq-dev \
.PHONY: debcheck debs_install
debs_install:
sudo apt-get install $(REQUIRED_DEBS)
debcheck:
@if which dpkg; then \
for DEB in $(REQUIRED_DEBS); do \
if ! dpkg -l $$DEB >/dev/null 2>&1; then \
echo "$$DEB not installed"; \
echo "try running 'make debs_install'"; \
break; \
fi \
done; \
fi
# Manual config in order to place -lpq after the .obj files as
# required by something Ubuntu did upgrading natty to oneiric
xwrelay: $(OBJ)

View file

@ -14,7 +14,7 @@ LOGFILE=/tmp/xwrelay_log_$$.txt
date > $LOGFILE
usage() {
echo "usage: $0 start | stop | restart | mkdb"
echo "usage: $0 start | stop | restart | mkdb | debs_install"
}
make_db() {
@ -114,6 +114,10 @@ do_start() {
fi
}
install_debs() {
sudo apt-get install postgresql-client postgresql
}
case $1 in
stop)
@ -149,6 +153,9 @@ case $1 in
make_db
;;
debs_install)
install_debs
;;
*)
usage
exit 0