aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2022-02-10 16:03:44 +0000
committerr <r@freesoftwareextremist.com>2022-02-10 16:03:44 +0000
commitc2f237e9019a4fb31cd7d969bf59670c144592c8 (patch)
tree4862c3674d0e051b39b3dd2a5ea0f2a57d9ddae6
parent4ef5e0daf285f41850c9ac53b0322d85fbf5eaec (diff)
downloadbloat-c2f237e9019a4fb31cd7d969bf59670c144592c8.tar.gz
bloat-c2f237e9019a4fb31cd7d969bf59670c144592c8.zip
Don't overwrite global config file on make install
-rw-r--r--.gitignore1
-rw-r--r--INSTALL1
-rw-r--r--Makefile9
3 files changed, 7 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 516f77b..79904fc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
bloat
database
+bloat.gen.conf
diff --git a/INSTALL b/INSTALL
index c73fd78..8f8c6d4 100644
--- a/INSTALL
+++ b/INSTALL
@@ -20,6 +20,7 @@ bloat looks for a file named bloat.conf in the working directory and
/etc/bloat in that order. You can also specify another file by using the -f
flag. Comments in the config file describe what each config value does. For
most cases, you only need to change the value of "client_website".
+# cp bloat.gen.conf /etc/bloat.conf
# $EDITOR /etc/bloat.conf
4. Create database directory
diff --git a/Makefile b/Makefile
index 1b32268..c38de6b 100644
--- a/Makefile
+++ b/Makefile
@@ -18,6 +18,10 @@ all: bloat
bloat: $(SRC) $(TMPL)
$(GO) build $(GOFLAGS) -o bloat main.go
+ sed -e "s%=database%=/var/bloat%g" \
+ -e "s%=templates%=$(SHAREPATH)/templates%g" \
+ -e "s%=static%=$(SHAREPATH)/static%g" \
+ < bloat.conf > bloat.gen.conf
install: bloat
mkdir -p $(DESTDIR)$(BINPATH) \
@@ -29,10 +33,6 @@ install: bloat
chmod 0644 $(DESTDIR)$(SHAREPATH)/templates/*
cp -r static/* $(DESTDIR)$(SHAREPATH)/static
chmod 0644 $(DESTDIR)$(SHAREPATH)/static/*
- sed -e "s%=database%=/var/bloat%g" \
- -e "s%=templates%=$(SHAREPATH)/templates%g" \
- -e "s%=static%=$(SHAREPATH)/static%g" \
- < bloat.conf > /etc/bloat.conf
uninstall:
rm -f $(DESTDIR)$(BINPATH)/bloat
@@ -40,3 +40,4 @@ uninstall:
clean:
rm -f bloat
+ rm -f bloat.gen.conf