diff --git a/Makefile b/Makefile index 7afe9df3..2c3be7ee 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ DESC=Polls a UniFi controller and stores metrics in InfluxDB GOLANGCI_LINT_ARGS=--enable-all -D gochecknoglobals BINARY:=$(shell basename $$(pwd)) URL:=https://github.com/$(GHUSER)/$(BINARY) +CONFIG_FILE=up.conf # These don't generally need to be changed. @@ -115,6 +116,7 @@ $(BINARY)_$(VERSION)-$(ITERATION)_amd64.deb: check_fpm package_build_linux @echo "Building 'deb' package for $(BINARY) version '$(VERSION)-$(ITERATION)'." fpm -s dir -t deb \ --name $(BINARY) \ + --deb-no-default-config-files \ --version $(VERSION) \ --iteration $(ITERATION) \ --after-install scripts/after-install.sh \ @@ -137,8 +139,8 @@ package_build_linux: readme man linux # Copying the binary, config file, unit file, and man page into the env. cp $(BINARY).linux $@/usr/bin/$(BINARY) cp *.1.gz $@/usr/share/man/man1 - cp examples/up.conf.example $@/etc/$(BINARY)/ - cp examples/up.conf.example $@/etc/$(BINARY)/up.conf + cp examples/$(CONFIG_FILE).example $@/etc/$(BINARY)/ + cp examples/$(CONFIG_FILE).example $@/etc/$(BINARY)/$(CONFIG_FILE) cp LICENSE *.html examples/* $@/usr/share/doc/$(BINARY)/ # These go to their own folder so the img src in the html pages continue to work. cp init/systemd/$(BINARY).service $@/lib/systemd/system/ @@ -192,8 +194,8 @@ install: man readme $(BINARY) /usr/bin/install -m 0755 -d $(PREFIX)/bin $(PREFIX)/share/man/man1 $(ETC)/$(BINARY) $(PREFIX)/share/doc/$(BINARY) /usr/bin/install -m 0755 -cp $(BINARY) $(PREFIX)/bin/$(BINARY) /usr/bin/install -m 0644 -cp $(BINARY).1.gz $(PREFIX)/share/man/man1 - /usr/bin/install -m 0644 -cp examples/up.conf.example $(ETC)/$(BINARY)/ - [ -f $(ETC)/$(BINARY)/up.conf ] || /usr/bin/install -m 0644 -cp examples/up.conf.example $(ETC)/$(BINARY)/up.conf + /usr/bin/install -m 0644 -cp examples/$(CONFIG_FILE).example $(ETC)/$(BINARY)/ + [ -f $(ETC)/$(BINARY)/$(CONFIG_FILE) ] || /usr/bin/install -m 0644 -cp examples/$(CONFIG_FILE).example $(ETC)/$(BINARY)/$(CONFIG_FILE) /usr/bin/install -m 0644 -cp LICENSE *.html examples/* $(PREFIX)/share/doc/$(BINARY)/ # These go to their own folder so the img src in the html pages continue to work.