From c60e48ffb964a5f7282f70474443e00d10772d31 Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Thu, 12 Mar 2020 19:29:03 +0100 Subject: [PATCH] Host files in data directory --- Makefile | 13 ++++++++----- SGSXLThread.cpp | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 3dcd970..c9fe99f 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,12 @@ # if you change these locations, make sure the sgs-xl.service file is updated! BINDIR=/usr/sbin CFGDIR=/etc/sgs-xl +DATADIR=/etc/sgs-xl/data # choose this if you want debugging help #CPPFLAGS=-g -ggdb -W -Wall -std=c++11 -DCFG_DIR=\"$(CFGDIR)\" # or, you can choose this for a much smaller executable without debugging help -CPPFLAGS=-W -Wall -std=c++11 -DCFG_DIR=\"$(CFGDIR)\" +CPPFLAGS= -g -W -Wall -std=c++11 -DCFG_DIR=\"$(CFGDIR)\" -DDATA_DIR=\"$(DATADIR)\" SRCS = $(wildcard *.cpp) OBJS = $(SRCS:.cpp=.o) @@ -29,8 +30,9 @@ clean: .PHONY: newhostfiles newhostfiles : mkdir -p $(CFGDIR) - wget -O $(CFGDIR)/DExtra_Hosts.txt http://www.pistar.uk/downloads/DExtra_Hosts.txt - wget -O $(CFGDIR)/DCS_Hosts.txt http://www.pistar.uk/downloads/DCS_Hosts.txt + mkdir -p $(DATADIR) + wget -O $(DATADIR)/DExtra_Hosts.txt http://www.pistar.uk/downloads/DExtra_Hosts.txt + wget -O $(DATADIR)/DCS_Hosts.txt http://www.pistar.uk/downloads/DCS_Hosts.txt .PHONY: install install : newhostfiles sgs-xl @@ -51,11 +53,12 @@ uninstall : systemctl daemon-reload rm -f $(BINDIR)/sgs-xl rm -rf $(CFGDIR) + rm -rf $(DATADIR) .PHONY: removehostfiles removehostfiles : - rm -f $(CFGDIR)/DExtra_Hosts.txt - rm -f $(CFGDIR)/DCS_Hosts.txt + rm -f $(DATADIR)/DExtra_Hosts.txt + rm -f $(DATADIR)/DCS_Hosts.txt .PHONY: GitVersion.h GitVersion.h: force diff --git a/SGSXLThread.cpp b/SGSXLThread.cpp index a4abfff..4d84197 100644 --- a/SGSXLThread.cpp +++ b/SGSXLThread.cpp @@ -435,7 +435,7 @@ void CSGSXLThread::processG2() void CSGSXLThread::loadReflectors(const std::string fname, DSTAR_PROTOCOL dstarProtocol) { - std::string filepath(CFG_DIR); + std::string filepath(DATA_DIR); filepath += std::string("/") + fname; struct stat sbuf;