]> Cypherpunks.ru repositories - nncp.git/commitdiff
Configurable default paths to spool and log
authorSergey Matveev <stargrave@stargrave.org>
Sun, 15 Jan 2017 17:02:27 +0000 (20:02 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 15 Jan 2017 17:12:16 +0000 (20:12 +0300)
common.mk
src/cypherpunks.ru/nncp/cfg.go
src/cypherpunks.ru/nncp/cmd/nncp-newnode/main.go

index dee003fa21504f419d3120984a2615bbfcdf7ad3..4b1f43a112874f8fb08ca3a91b463ea39a335bed 100644 (file)
--- a/common.mk
+++ b/common.mk
@@ -1,15 +1,21 @@
-.PHONY: doc
+PREFIX ?= /usr/local
 
 SENDMAIL ?= /usr/sbin/sendmail
-PREFIX ?= /usr/local
 CFGPATH ?= $(PREFIX)/etc/nncp.yaml
+SPOOLPATH ?= /var/spool/nncp
+LOGPATH ?= /var/log/nncp.log
+
 BINDIR = $(DESTDIR)$(PREFIX)/bin
 INFODIR = $(DESTDIR)$(PREFIX)/info
 DOCDIR = $(DESTDIR)$(PREFIX)/share/doc/nncp
+
 LDFLAGS = \
        -X cypherpunks.ru/nncp.Version=$(VERSION) \
        -X cypherpunks.ru/nncp.DefaultCfgPath=$(CFGPATH) \
-       -X cypherpunks.ru/nncp.DefaultSendmailPath=$(SENDMAIL)
+       -X cypherpunks.ru/nncp.DefaultSendmailPath=$(SENDMAIL) \
+       -X cypherpunks.ru/nncp.DefaultSpoolPath=$(SPOOLPATH) \
+       -X cypherpunks.ru/nncp.DefaultLogPath=$(LOGPATH)
+
 ALL = \
        nncp-mail \
        nncp-call \
@@ -72,6 +78,8 @@ test:
 clean:
        rm -f $(ALL)
 
+.PHONY: doc
+
 doc:
        $(MAKE) -C doc
 
index 6083db97c2175ebaab0b469a71164b4fc12ee7f0..773cc15cceec850d87cf283a020702e08b6e60e9 100644 (file)
@@ -35,6 +35,8 @@ const (
 var (
        DefaultCfgPath      string = "/usr/local/etc/nncp.yaml"
        DefaultSendmailPath string = "/usr/sbin/sendmail"
+       DefaultSpoolPath    string = "/var/spool/nncp"
+       DefaultLogPath      string = "/var/log/nncp.log"
 )
 
 type NodeYAML struct {
index 5aeebf6c5dd18c96c19495b12c998efeb5edad13..b32a32d2264276bf0da10114ac4a62144d3e2e9b 100644 (file)
@@ -73,8 +73,8 @@ func main() {
                                Sendmail: []string{nncp.DefaultSendmailPath},
                        },
                },
-               Spool: "/path/to/spool",
-               Log:   "/path/to/log.file",
+               Spool: nncp.DefaultSpoolPath,
+               Log:   nncp.DefaultLogPath,
        }
        raw, err := yaml.Marshal(&cfg)
        if err != nil {