Correct paths in moxerverctl and adapt Makefiles

This commit is contained in:
Igor Socec 2017-01-25 10:59:49 +01:00
parent ee5aaa2690
commit ce8971eb2b
4 changed files with 16 additions and 23 deletions

View file

@ -2,10 +2,8 @@
SERVER = moxerver
TOOLS = tools
# ==============================================================================
# system install root directory
INSTALL_ROOT = ./install.dir
INSTALL_ROOT = $(abspath ./install.dir)
# prefix for /bin directory
BIN_PREFIX = /usr
@ -14,9 +12,8 @@ BIN_PREFIX = /usr
# directories used for local component builds
BUILDDIR = build.dir
INSTALLDIR = install.dir
# directory configuration for local component builds
DIR_CONFIG = BUILDDIR=$(BUILDDIR) INSTALLDIR=$(INSTALLDIR) BIN_PREFIX=$(BIN_PREFIX)
DIR_CONFIG = BUILDDIR=$(BUILDDIR) INSTALLDIR=$(INSTALL_ROOT) BIN_PREFIX=$(BIN_PREFIX)
# ==============================================================================
@ -34,12 +31,8 @@ default:
# install handles component installation
install: default
mkdir -p $(INSTALL_ROOT)
cd $(SERVER) && make install $(DIR_CONFIG)
cp -r $(SERVER)/$(INSTALLDIR)/* $(INSTALL_ROOT)/
cd $(TOOLS) && make install $(DIR_CONFIG)
cp -r $(TOOLS)/$(INSTALLDIR)/* $(INSTALL_ROOT)/
# clean removes build and install results
clean:

View file

@ -4,9 +4,9 @@ TARGET_BINARY = moxerver
# ==============================================================================
# directory for build results
BUILDDIR = build.dir
BUILDDIR = $(abspath build.dir)
# installation root
INSTALLDIR = install.dir
INSTALLDIR = $(abspath install.dir)
# prefix for /bin directory
BIN_PREFIX = /usr
@ -57,8 +57,7 @@ default: $(BUILDDIR)/$(TARGET_BINARY)
# install target binary
install: default
mkdir -p $(INSTALLDIR)/$(BIN_PREFIX)/bin
cp $(BUILDDIR)/$(TARGET_BINARY) $(INSTALLDIR)/$(BIN_PREFIX)/bin
install -Dm0755 $(BUILDDIR)/$(TARGET_BINARY) $(INSTALLDIR)/$(BIN_PREFIX)/bin/$(TARGET_BINARY)
# clean removes object files and target (ignore errors with "-" before commands)
clean:

View file

@ -5,9 +5,9 @@ TARGET_CONFIG = moxerver.cfg
# ==============================================================================
# directory for build results
BUILDDIR = build.dir
BUILDDIR = $(abspath build.dir)
# installation root
INSTALLDIR = install.dir
INSTALLDIR = $(abspath install.dir)
# prefix for /bin directory
BIN_PREFIX = /usr
@ -21,12 +21,11 @@ default:
# install targets
install:
# install control script
mkdir -p $(INSTALLDIR)/$(BIN_PREFIX)/bin
cp $(TARGET_CONTROL) $(INSTALLDIR)/$(BIN_PREFIX)/bin/
# install configuration file
mkdir -p $(INSTALLDIR)/etc
cp $(TARGET_CONFIG) $(INSTALLDIR)/etc/
install -Dm0644 $(TARGET_CONFIG) $(INSTALLDIR)/etc/$(TARGET_CONFIG)
# install control script, referring to the configuration file
install -Dm0755 $(TARGET_CONTROL) $(INSTALLDIR)/$(BIN_PREFIX)/bin/$(TARGET_CONTROL)
sed -i -e 's#ROOT=\"\"#ROOT=$(INSTALLDIR)#' $(INSTALLDIR)/$(BIN_PREFIX)/bin/$(TARGET_CONTROL)
# clean removes object files and target (ignore errors with "-" before commands)
clean:

8
tools/moxerverctl Executable file → Normal file
View file

@ -4,10 +4,12 @@
# setup
# =====
ROOT=""
# parameters
CONFIGURATION_FILE="./moxanix.cfg"
SERVER_BINARY="./moxerver"
LOG_DIRECTORY="./logs"
CONFIGURATION_FILE="$ROOT/etc/moxerver.cfg"
SERVER_BINARY="moxerver"
LOG_DIRECTORY="$ROOT/var/logs/moxerver"
# global variables for configuration