mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-06 03:48:45 +00:00
Change config file lookup
- Look for both local and global config file - Directly generate the global config file with make install
This commit is contained in:
parent
21ef7a6610
commit
003233d60d
6 changed files with 40 additions and 35 deletions
13
Makefile
13
Makefile
|
@ -14,17 +14,11 @@ SRC=main.go \
|
|||
service/*.go \
|
||||
util/*.go \
|
||||
|
||||
all: bloat bloat.def.conf
|
||||
all: bloat
|
||||
|
||||
bloat: $(SRC) $(TMPL)
|
||||
$(GO) build $(GOFLAGS) -o bloat main.go
|
||||
|
||||
bloat.def.conf:
|
||||
sed -e "s%=database%=/var/bloat%g" \
|
||||
-e "s%=templates%=$(SHAREPATH)/templates%g" \
|
||||
-e "s%=static%=$(SHAREPATH)/static%g" \
|
||||
< bloat.conf > bloat.def.conf
|
||||
|
||||
install: bloat
|
||||
mkdir -p $(DESTDIR)$(BINPATH) \
|
||||
$(DESTDIR)$(SHAREPATH)/templates \
|
||||
|
@ -35,6 +29,10 @@ 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
|
||||
|
@ -42,4 +40,3 @@ uninstall:
|
|||
|
||||
clean:
|
||||
rm -f bloat
|
||||
rm -f bloat.def.conf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue