From 62545902d86447014ac72b39f53f36aeba9c6bf8 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 28 Apr 2019 00:50:40 +0300 Subject: [PATCH] go.mod support --- .gitmodules | 40 +++++------ BSDmakefile | 1 - GNUmakefile | 1 - common.mk | 69 ++++--------------- doc/news.ru.texi | 2 + doc/news.texi | 2 + makedist.sh | 59 +++++++++------- src/cypherpunks.ru/balloon | 1 - src/cypherpunks.ru/nncp/go.mod | 15 ++++ src/cypherpunks.ru/nncp/go.sum | 25 +++++++ .../nncp/vendor/cypherpunks.ru/balloon | 1 + .../nncp/vendor}/github.com/davecgh/go-xdr | 0 .../vendor}/github.com/dustin/go-humanize | 0 .../nncp/vendor}/github.com/flynn/noise | 0 .../nncp/vendor}/github.com/gorhill/cronexpr | 0 .../nncp/vendor}/golang.org/x/crypto | 0 .../nncp/vendor}/golang.org/x/net | 0 .../nncp/vendor}/golang.org/x/sys | 0 .../nncp/vendor}/gopkg.in/check.v1 | 0 .../nncp/vendor}/gopkg.in/yaml.v2 | 0 20 files changed, 113 insertions(+), 103 deletions(-) delete mode 160000 src/cypherpunks.ru/balloon create mode 100644 src/cypherpunks.ru/nncp/go.mod create mode 100644 src/cypherpunks.ru/nncp/go.sum create mode 160000 src/cypherpunks.ru/nncp/vendor/cypherpunks.ru/balloon rename src/{ => cypherpunks.ru/nncp/vendor}/github.com/davecgh/go-xdr (100%) rename src/{ => cypherpunks.ru/nncp/vendor}/github.com/dustin/go-humanize (100%) rename src/{ => cypherpunks.ru/nncp/vendor}/github.com/flynn/noise (100%) rename src/{ => cypherpunks.ru/nncp/vendor}/github.com/gorhill/cronexpr (100%) rename src/{ => cypherpunks.ru/nncp/vendor}/golang.org/x/crypto (100%) rename src/{ => cypherpunks.ru/nncp/vendor}/golang.org/x/net (100%) rename src/{ => cypherpunks.ru/nncp/vendor}/golang.org/x/sys (100%) rename src/{ => cypherpunks.ru/nncp/vendor}/gopkg.in/check.v1 (100%) rename src/{ => cypherpunks.ru/nncp/vendor}/gopkg.in/yaml.v2 (100%) diff --git a/.gitmodules b/.gitmodules index fb795d9..12047c5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,32 +1,32 @@ -[submodule "src/github.com/davecgh/go-xdr"] - path = src/github.com/davecgh/go-xdr +[submodule "src/cypherpunks.ru/nncp/vendor/github.com/davecgh/go-xdr"] + path = src/cypherpunks.ru/nncp/vendor/github.com/davecgh/go-xdr url = https://github.com/davecgh/go-xdr.git -[submodule "src/github.com/dustin/go-humanize"] - path = src/github.com/dustin/go-humanize +[submodule "src/cypherpunks.ru/nncp/vendor/github.com/dustin/go-humanize"] + path = src/cypherpunks.ru/nncp/vendor/github.com/dustin/go-humanize url = https://github.com/dustin/go-humanize.git -[submodule "src/github.com/flynn/noise"] - path = src/github.com/flynn/noise +[submodule "src/cypherpunks.ru/nncp/vendor/github.com/flynn/noise"] + path = src/cypherpunks.ru/nncp/vendor/github.com/flynn/noise url = https://github.com/flynn/noise.git -[submodule "src/gopkg.in/check.v1"] - path = src/gopkg.in/check.v1 +[submodule "src/cypherpunks.ru/nncp/vendor/gopkg.in/check.v1"] + path = src/cypherpunks.ru/nncp/vendor/gopkg.in/check.v1 url = https://github.com/go-check/check.git branch = v1 -[submodule "src/gopkg.in/yaml.v2"] - path = src/gopkg.in/yaml.v2 +[submodule "src/cypherpunks.ru/nncp/vendor/gopkg.in/yaml.v2"] + path = src/cypherpunks.ru/nncp/vendor/gopkg.in/yaml.v2 url = https://github.com/go-yaml/yaml.git branch = v2 -[submodule "src/golang.org/x/crypto"] - path = src/golang.org/x/crypto +[submodule "src/cypherpunks.ru/nncp/vendor/golang.org/x/crypto"] + path = src/cypherpunks.ru/nncp/vendor/golang.org/x/crypto url = https://go.googlesource.com/crypto -[submodule "src/golang.org/x/sys"] - path = src/golang.org/x/sys +[submodule "src/cypherpunks.ru/nncp/vendor/golang.org/x/sys"] + path = src/cypherpunks.ru/nncp/vendor/golang.org/x/sys url = https://go.googlesource.com/sys -[submodule "src/golang.org/x/net"] - path = src/golang.org/x/net +[submodule "src/cypherpunks.ru/nncp/vendor/golang.org/x/net"] + path = src/cypherpunks.ru/nncp/vendor/golang.org/x/net url = https://go.googlesource.com/net -[submodule "src/github.com/gorhill/cronexpr"] - path = src/github.com/gorhill/cronexpr +[submodule "src/cypherpunks.ru/nncp/vendor/github.com/gorhill/cronexpr"] + path = src/cypherpunks.ru/nncp/vendor/github.com/gorhill/cronexpr url = https://github.com/gorhill/cronexpr.git -[submodule "src/cypherpunks.ru/balloon"] - path = src/cypherpunks.ru/balloon +[submodule "src/cypherpunks.ru/nncp/vendor/cypherpunks.ru/balloon"] + path = src/cypherpunks.ru/nncp/vendor/cypherpunks.ru/balloon url = git://git.cypherpunks.ru/balloon.git diff --git a/BSDmakefile b/BSDmakefile index b57abb4..63c724c 100644 --- a/BSDmakefile +++ b/BSDmakefile @@ -1,4 +1,3 @@ -GOPATH != pwd VERSION != cat VERSION include common.mk diff --git a/GNUmakefile b/GNUmakefile index 79efdfc..5af4eb0 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,4 +1,3 @@ -GOPATH = $(shell pwd) VERSION = $(shell cat VERSION) include common.mk diff --git a/common.mk b/common.mk index 145e843..602d754 100644 --- a/common.mk +++ b/common.mk @@ -1,4 +1,5 @@ PREFIX ?= /usr/local +GO ?= go SENDMAIL ?= /usr/sbin/sendmail CFGPATH ?= $(PREFIX)/etc/nncp.yaml @@ -15,6 +16,7 @@ LDFLAGS = \ -X cypherpunks.ru/nncp.DefaultSendmailPath=$(SENDMAIL) \ -X cypherpunks.ru/nncp.DefaultSpoolPath=$(SPOOLPATH) \ -X cypherpunks.ru/nncp.DefaultLogPath=$(LOGPATH) +BUILDMOD ?= -mod=vendor ALL = \ nncp-bundle \ @@ -36,67 +38,24 @@ ALL = \ nncp-toss \ nncp-xfer -all: $(ALL) - -nncp-bundle: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-bundle - -nncp-call: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-call - -nncp-caller: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-caller - -nncp-cfgenc: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-cfgenc - -nncp-cfgmin: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-cfgmin - -nncp-cfgnew: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-cfgnew - -nncp-check: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-check - -nncp-daemon: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-daemon +SRC := $(PWD)/src/cypherpunks.ru/nncp +BIN := $(PWD)/bin +GOPATH ?= $(PWD)/gopath -nncp-exec: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-exec - -nncp-file: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-file - -nncp-freq: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-freq - -nncp-log: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-log - -nncp-pkt: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-pkt - -nncp-reass: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-reass - -nncp-rm: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-rm - -nncp-stat: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-stat +all: $(ALL) -nncp-toss: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-toss +$(BIN): + mkdir -p $(BIN) -nncp-xfer: - GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/nncp-xfer +$(ALL): $(BIN) + cd $(SRC) ; GOPATH=$(GOPATH) $(GO) build $(BUILDMOD) -ldflags "$(LDFLAGS)" cypherpunks.ru/nncp/cmd/$@ + mv $(SRC)/$@ $(BIN) test: - GOPATH=$(GOPATH) go test -failfast cypherpunks.ru/nncp/... + cd $(SRC) ; GOPATH=$(GOPATH) $(GO) test $(BUILDMOD) -failfast cypherpunks.ru/nncp/... clean: - rm -f $(ALL) + rm -rf bin .PHONY: doc @@ -105,7 +64,7 @@ doc: install: all doc mkdir -p $(BINDIR) - cp -f $(ALL) $(BINDIR) + (cd bin ; cp -f $(ALL) $(BINDIR)) for e in $(ALL) ; do chmod 755 $(BINDIR)/$$e ; done mkdir -p $(INFODIR) cp -f doc/nncp.info $(INFODIR) diff --git a/doc/news.ru.texi b/doc/news.ru.texi index 832d30e..080333a 100644 --- a/doc/news.ru.texi +++ b/doc/news.ru.texi @@ -25,6 +25,8 @@ Зависимые библиотеки обновлены. @item Небольшие исправления ошибок. +@item +Начало использования @code{go.mod} подсистемы. @end itemize @node Релиз 3.4 diff --git a/doc/news.texi b/doc/news.texi index f087abe..80289c4 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -26,6 +26,8 @@ configuration file section. Dependant libraries are updated. @item Minor bugfixes. +@item +Begin using of @code{go.mod} subsystem. @end itemize @node Release 3.4 diff --git a/makedist.sh b/makedist.sh index f0ad227..7051f07 100755 --- a/makedist.sh +++ b/makedist.sh @@ -5,19 +5,23 @@ tmp=$(mktemp -d) release=$1 [ -n "$release" ] +vendor=src/cypherpunks.ru/nncp/vendor + git clone . $tmp/nncp-$release repos=" - src/github.com/davecgh/go-xdr - src/github.com/dustin/go-humanize - src/github.com/flynn/noise - src/golang.org/x/crypto - src/golang.org/x/net - src/golang.org/x/sys - src/gopkg.in/check.v1 - src/gopkg.in/yaml.v2 + cypherpunks.ru/balloon + github.com/davecgh/go-xdr + github.com/dustin/go-humanize + github.com/flynn/noise + github.com/gorhill/cronexpr + golang.org/x/crypto + golang.org/x/net + golang.org/x/sys + gopkg.in/check.v1 + gopkg.in/yaml.v2 " for repo in $repos; do - git clone $repo $tmp/nncp-$release/$repo + git clone $vendor/$repo $tmp/nncp-$release/$vendor/$repo done cd $tmp/nncp-$release git checkout $release @@ -25,43 +29,48 @@ git submodule update --init cat > $tmp/includes < git.cypherpunks.ru/balloon.git v0.0.0-20190427214838-0e07700b0279 diff --git a/src/cypherpunks.ru/nncp/go.sum b/src/cypherpunks.ru/nncp/go.sum new file mode 100644 index 0000000..cada0a9 --- /dev/null +++ b/src/cypherpunks.ru/nncp/go.sum @@ -0,0 +1,25 @@ +git.cypherpunks.ru/balloon.git v0.0.0-20190427214838-0e07700b0279 h1:UtJj64EdBav9c3gXvDzuVhfKv0dSOUu/8rA709WRyBg= +git.cypherpunks.ru/balloon.git v0.0.0-20190427214838-0e07700b0279/go.mod h1:MMNkZjNnjCkWMS+luQsSoSp6CCzhQiowH2uvfy5KgG8= +github.com/davecgh/go-xdr v0.0.0-20161123171359-e6a2ba005892 h1:qg9VbHo1TlL0KDM0vYvBG9EY0X0Yku5WYIPoFWt8f6o= +github.com/davecgh/go-xdr v0.0.0-20161123171359-e6a2ba005892/go.mod h1:CTDl0pzVzE5DEzZhPfvhY/9sPFMQIxaJ9VAMs9AagrE= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6 h1:u/UEqS66A5ckRmS4yNpjmVH56sVtS/RfclBAYocb4as= +github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ= +github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 h1:f0n1xnMSmBLzVfsMMvriDyA75NB/oBgILX2GcHXIQzY= +github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734 h1:p/H982KKEjUnLJkM3tt/LemDnOc1GiZL5FCVlORJ5zo= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6 h1:FP8hkuE6yUEaJnK7O2eTuejKWwW+Rhfj80dQ2JcKxCU= +golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190426135247-a129542de9ae h1:mQLHiymj/JXKnnjc62tb7nD5pZLs940/sXJu+Xp3DBA= +golang.org/x/sys v0.0.0-20190426135247-a129542de9ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/src/cypherpunks.ru/nncp/vendor/cypherpunks.ru/balloon b/src/cypherpunks.ru/nncp/vendor/cypherpunks.ru/balloon new file mode 160000 index 0000000..0e07700 --- /dev/null +++ b/src/cypherpunks.ru/nncp/vendor/cypherpunks.ru/balloon @@ -0,0 +1 @@ +Subproject commit 0e07700b027907d44e0060fc3f75c4590478452b diff --git a/src/github.com/davecgh/go-xdr b/src/cypherpunks.ru/nncp/vendor/github.com/davecgh/go-xdr similarity index 100% rename from src/github.com/davecgh/go-xdr rename to src/cypherpunks.ru/nncp/vendor/github.com/davecgh/go-xdr diff --git a/src/github.com/dustin/go-humanize b/src/cypherpunks.ru/nncp/vendor/github.com/dustin/go-humanize similarity index 100% rename from src/github.com/dustin/go-humanize rename to src/cypherpunks.ru/nncp/vendor/github.com/dustin/go-humanize diff --git a/src/github.com/flynn/noise b/src/cypherpunks.ru/nncp/vendor/github.com/flynn/noise similarity index 100% rename from src/github.com/flynn/noise rename to src/cypherpunks.ru/nncp/vendor/github.com/flynn/noise diff --git a/src/github.com/gorhill/cronexpr b/src/cypherpunks.ru/nncp/vendor/github.com/gorhill/cronexpr similarity index 100% rename from src/github.com/gorhill/cronexpr rename to src/cypherpunks.ru/nncp/vendor/github.com/gorhill/cronexpr diff --git a/src/golang.org/x/crypto b/src/cypherpunks.ru/nncp/vendor/golang.org/x/crypto similarity index 100% rename from src/golang.org/x/crypto rename to src/cypherpunks.ru/nncp/vendor/golang.org/x/crypto diff --git a/src/golang.org/x/net b/src/cypherpunks.ru/nncp/vendor/golang.org/x/net similarity index 100% rename from src/golang.org/x/net rename to src/cypherpunks.ru/nncp/vendor/golang.org/x/net diff --git a/src/golang.org/x/sys b/src/cypherpunks.ru/nncp/vendor/golang.org/x/sys similarity index 100% rename from src/golang.org/x/sys rename to src/cypherpunks.ru/nncp/vendor/golang.org/x/sys diff --git a/src/gopkg.in/check.v1 b/src/cypherpunks.ru/nncp/vendor/gopkg.in/check.v1 similarity index 100% rename from src/gopkg.in/check.v1 rename to src/cypherpunks.ru/nncp/vendor/gopkg.in/check.v1 diff --git a/src/gopkg.in/yaml.v2 b/src/cypherpunks.ru/nncp/vendor/gopkg.in/yaml.v2 similarity index 100% rename from src/gopkg.in/yaml.v2 rename to src/cypherpunks.ru/nncp/vendor/gopkg.in/yaml.v2 -- 2.44.0