.gitignore | 3 +++ Makefile | 87 ++++++++--------------------------------------------- README | 2 +- README.RU | 2 +- VERSION | 1 - VERSION.do | 2 ++ all.do | 1 + bin/.gitignore | 1 + bin/all.do | 2 ++ bin/clean.do | 1 + bin/cmd.list | 18 ++++++++++++++++++ bin/default.do | 12 ++++++++++++ clean.do | 2 ++ config | 14 ++++++++++++++ doc.do | 1 + doc/.gitignore | 2 +- doc/Makefile | 25 ------------------------- doc/all.do | 1 + doc/building.texi | 11 +++++++++-- doc/default.plantuml.txt.do | 5 +++++ doc/download.texi | 4 ++++ doc/index.texi | 2 +- doc/install.texi | 4 +--- doc/integration.texi | 2 +- doc/news.ru.texi | 14 ++++++++++++++ doc/news.texi | 14 ++++++++++++++ doc/nncp.html.do | 7 +++++++ doc/nncp.info.do | 9 +++++++++ doc/sources.texi | 18 ------------------ doc/sp.plantuml | 34 ++++++++++++++++++++++++++++++++++ doc/sp.texi | 2 +- doc/sp.txt | 19 ------------------- doc/style.css | 2 +- doc/thanks.texi | 3 +++ gopath.do | 1 + install-strip.do | 5 +++++ install.do | 16 ++++++++++++++++ makedist.sh | 39 ++++++++++++++++++++++++++++----------- module-name.do | 2 ++ ports/nncp/Makefile | 3 ++- ports/nncp/pkg-plist | 1 + src/go.mod | 12 ++++++------ src/go.sum | 25 ++++++++++++------------- src/log.go | 1 + src/nncp.go | 2 +- src/sp.go | 4 ++-- src/uilive/writer.go | 3 --- test.do | 6 ++++++ uninstall.do | 5 +++++ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..98819b53e8a61212445993ab92bb519f61e46901e26f47da0df330481b2f28f5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +gopath +module-name +VERSION diff --git a/Makefile b/Makefile index 7eecd2ca15f15a60680f950c170535a5913142c8d4a26b474ddfee384cf05923..feb7a2399a3473046e61ad6ed3f8821a8dfa393b2ab35faaa47070d79b9f5521 100644 --- a/Makefile +++ b/Makefile @@ -1,80 +1,19 @@ -GOPATH != pwd -VERSION != cat VERSION +REDO ?= contrib/do -c -GO ?= go -PREFIX ?= /usr/local +warning: + @echo WARNING: this is not real Makefile. Just proxying commands to redo command -SENDMAIL ?= /usr/sbin/sendmail -CFGPATH ?= $(PREFIX)/etc/nncp.hjson -SPOOLPATH ?= /var/spool/nncp -LOGPATH ?= /var/spool/nncp/log +all: warning + $(REDO) $@ -BINDIR = $(DESTDIR)$(PREFIX)/bin -INFODIR = $(DESTDIR)$(PREFIX)/info -DOCDIR = $(DESTDIR)$(PREFIX)/share/doc/nncp +clean: warning + $(REDO) $@ -MOD = go.cypherpunks.ru/nncp/v5 +install: warning + $(REDO) $@ -LDFLAGS = \ - -X $(MOD).Version=$(VERSION) \ - -X $(MOD).DefaultCfgPath=$(CFGPATH) \ - -X $(MOD).DefaultSendmailPath=$(SENDMAIL) \ - -X $(MOD).DefaultSpoolPath=$(SPOOLPATH) \ - -X $(MOD).DefaultLogPath=$(LOGPATH) +install-strip: warning + $(REDO) $@ -ALL = \ - $(BIN)/nncp-bundle \ - $(BIN)/nncp-call \ - $(BIN)/nncp-caller \ - $(BIN)/nncp-cfgenc \ - $(BIN)/nncp-cfgmin \ - $(BIN)/nncp-cfgnew \ - $(BIN)/nncp-check \ - $(BIN)/nncp-daemon \ - $(BIN)/nncp-exec \ - $(BIN)/nncp-file \ - $(BIN)/nncp-freq \ - $(BIN)/nncp-log \ - $(BIN)/nncp-pkt \ - $(BIN)/nncp-reass \ - $(BIN)/nncp-rm \ - $(BIN)/nncp-stat \ - $(BIN)/nncp-toss \ - $(BIN)/nncp-xfer - -SRC := $(PWD)/src -BIN := $(PWD)/bin - -all: $(ALL) - -$(ALL): - mkdir -p $(BIN) - cd $(SRC) ; GOPATH=$(GOPATH) $(GO) build \ - -o $(BIN)/$$(basename $@) \ - -ldflags "$(LDFLAGS)" \ - $(MOD)/cmd/$$(basename $@) - -test: - cd $(SRC) ; GOPATH=$(GOPATH) $(GO) test -failfast $(MOD)/... - -clean: - rm -rf $(BIN) - -.PHONY: doc - -doc: - $(MAKE) -C doc - -install: all doc - mkdir -p $(BINDIR) - cp -f $(ALL) $(BINDIR) - for e in $(ALL) ; do chmod 755 $(BINDIR)/$$(basename $$e) ; done - mkdir -p $(INFODIR) - cp -f doc/nncp.info $(INFODIR) - chmod 644 $(INFODIR)/nncp.info - mkdir -p $(DOCDIR) - cp -f -L AUTHORS NEWS NEWS.RU README README.RU THANKS $(DOCDIR) - chmod 644 $(DOCDIR)/* - -install-strip: install - for e in $(ALL) ; do strip $(BINDIR)/$$(basename $$e) ; done +uninstall: warning + $(REDO) $@ diff --git a/README b/README index 8952a9994d59687a98de1646953d1beeaad2c7e3414c1469fab012aeb1e2ae2f..9e016673d4953541d564b5a048bd52098942399f70414ea23eaf8c83ed3482e9 100644 --- a/README +++ b/README @@ -25,6 +25,6 @@ patches to nncp-devel mailing list: https://lists.cypherpunks.ru/pipermail/nncp-devel/ Development Git source code repository currently is located here: -https://git.cypherpunks.ru/cgit.cgi/nncp.git/ +http://git.cypherpunks.ru/cgit.cgi/nncp.git/ For further information please read either doc/nncp.info or doc/nncp.texi. diff --git a/README.RU b/README.RU index eec03dfffe775817f054a853bde4600f65b86eb634520995f78033831b92db70..5302e992d5da0e6a15e9bfcd389d65d046c71e23b2b83cc32731cda76c220130 100644 --- a/README.RU +++ b/README.RU @@ -30,7 +30,7 @@ и патчи отправляйте в nncp-devel почтовую рассылку: https://lists.cypherpunks.ru/pipermail/nncp-devel/ Исходный код для разработчика находится в Git репозитории: -https://git.cypherpunks.ru/cgit.cgi/nncp.git/ +http://git.cypherpunks.ru/cgit.cgi/nncp.git/ Для дополнительной информации пожалуйста читайте или doc/nncp.info или doc/nncp.texi. diff --git a/VERSION b/VERSION deleted file mode 100644 index 061d07537f6f50be6430d8baedb9b4418d5f210b44bc4463afc9ba43e1ac9b42..0000000000000000000000000000000000000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.3.3 diff --git a/VERSION.do b/VERSION.do new file mode 100644 index 0000000000000000000000000000000000000000..66a97a70bde2f941417ac5c1e74f4c51ad9711f55dab756053711b7575eed262 --- /dev/null +++ b/VERSION.do @@ -0,0 +1,2 @@ +redo-ifchange src/nncp.go +perl -ne 'print "$1\n" if /Version.* = "(.*)"$/' < src/nncp.go diff --git a/all.do b/all.do new file mode 100644 index 0000000000000000000000000000000000000000..3820e43dab50af214c261f55269a2fae28d6b3dcdc0e6c06a4a998610c8ac636 --- /dev/null +++ b/all.do @@ -0,0 +1 @@ +redo-ifchange bin/all diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..0ff98e802fedc6095a3d05a21f0a09e6e87cb853f455ab4bd7821f9162e872f1 --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1 @@ +nncp-* diff --git a/bin/all.do b/bin/all.do new file mode 100644 index 0000000000000000000000000000000000000000..f0c6d1a83e97e73f608e140d14d2668ad047b8d5d0b92148f87a6c3ccbfb4c57 --- /dev/null +++ b/bin/all.do @@ -0,0 +1,2 @@ +redo-ifchange cmd.list +redo-ifchange `cat cmd.list` diff --git a/bin/clean.do b/bin/clean.do new file mode 100644 index 0000000000000000000000000000000000000000..f128b8679a5e7c7a7dce4624f66f195e1d97113f5fbc23ad0bffc2643609b7e2 --- /dev/null +++ b/bin/clean.do @@ -0,0 +1 @@ +rm -f `cat cmd.list` diff --git a/bin/cmd.list b/bin/cmd.list new file mode 100644 index 0000000000000000000000000000000000000000..9c9ad5e5f76c3ed059906d62ba0247284900974cc63b523d4519611cb7abc4d5 --- /dev/null +++ b/bin/cmd.list @@ -0,0 +1,18 @@ +nncp-bundle +nncp-call +nncp-caller +nncp-cfgenc +nncp-cfgmin +nncp-cfgnew +nncp-check +nncp-daemon +nncp-exec +nncp-file +nncp-freq +nncp-log +nncp-pkt +nncp-reass +nncp-rm +nncp-stat +nncp-toss +nncp-xfer diff --git a/bin/default.do b/bin/default.do new file mode 100644 index 0000000000000000000000000000000000000000..27dcd489ca2873d6e872e4a8ded347fa277d6aadf6a41c1a9f7595924c73bf61 --- /dev/null +++ b/bin/default.do @@ -0,0 +1,12 @@ +cd .. +redo-ifchange config gopath module-name +. ./config +. ./gopath +mod=`cat module-name` +redo-ifchange src/*.go src/cmd/$1/*.go +GO_LDFLAGS="$GO_LDFLAGS -X $mod.DefaultCfgPath=$CFGPATH" +GO_LDFLAGS="$GO_LDFLAGS -X $mod.DefaultSpoolPath=$SENDMAIL" +GO_LDFLAGS="$GO_LDFLAGS -X $mod.DefaultSpoolPath=$SPOOLPATH" +GO_LDFLAGS="$GO_LDFLAGS -X $mod.DefaultLogPath=$LOGPATH" +cd src +GOPATH=$GOPATH ${GO:-go} build -o ../bin/$3 -ldflags "$GO_LDFLAGS" $mod/cmd/$1 diff --git a/clean.do b/clean.do new file mode 100644 index 0000000000000000000000000000000000000000..e861e3211e82568a837f71dddbd8da929444028f5ed6a320603226dfcd6e6522 --- /dev/null +++ b/clean.do @@ -0,0 +1,2 @@ +redo bin/clean +rm gopath module-name VERSION diff --git a/config b/config new file mode 100644 index 0000000000000000000000000000000000000000..f385f2b55ce7718e62266e42bb64dc50f32bb6d87aa7f5cfcdd73d25f09db866 --- /dev/null +++ b/config @@ -0,0 +1,14 @@ +GO=${GO:-go} +MAKEINFO=${MAKEINFO:-makeinfo} +PLANTUML=${PLANTUML:-plantuml} + +PREFIX=${PREFIX:-/usr/local} + +SENDMAIL=${SENDMAIL:-/usr/sbin/sendmail} +CFGPATH=${CFGPATH:-$PREFIX/etc/nncp.hjson} +SPOOLPATH=${SPOOLPATH:-/var/spool/nncp} +LOGPATH=${LOGPATH:-/var/spool/nncp/log} + +BINDIR=${DESTDIR}${PREFIX}/bin +INFODIR=${DESTDIR}${PREFIX}/info +DOCDIR=${DESTDIR}${PREFIX}/share/doc/nncp diff --git a/doc.do b/doc.do new file mode 100644 index 0000000000000000000000000000000000000000..3aea49c4191956e4e42ea35f7a4e5b4f424e969f32b2a972aefce6a79ba5879a --- /dev/null +++ b/doc.do @@ -0,0 +1 @@ +redo-ifchange doc/all diff --git a/doc/.gitignore b/doc/.gitignore index 71f790068b6e18ea1a7ef2428aa4741fb9943757e9eff5f0fd626e8a405f6b3a..3b0a1333c07f1a830d2cb91d4fb71d33f117db1a878619e13834598ef7fb7027 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,3 +1,3 @@ nncp.info nncp.html -sp.utxt +sp.plantuml.txt diff --git a/doc/Makefile b/doc/Makefile deleted file mode 100644 index a224bc4a3c5d2689942046ee0d5bbe797168fed8856caa42856f737c53842b96..0000000000000000000000000000000000000000 --- a/doc/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -MAKEINFO ?= makeinfo - -all: nncp.info nncp.html - -sp.utxt: sp.txt - plantuml -tutxt sp.txt - -nncp.info: *.texi sp.utxt pedro.txt - $(MAKEINFO) -o nncp.info index.texi - -CSS != cat style.css - -nncp.html: *.texi sp.utxt pedro.txt - rm -f nncp.html/*.html - $(MAKEINFO) --html \ - --set-customization-variable EXTRA_HEAD='' \ - --set-customization-variable CSS_LINES='$(CSS)' \ - --set-customization-variable SHOW_TITLE=0 \ - --set-customization-variable USE_ACCESSKEY=0 \ - --set-customization-variable DATE_IN_HEADER=1 \ - --set-customization-variable TOP_NODE_UP_URL=index.html \ - --set-customization-variable CLOSE_QUOTE_SYMBOL=\" \ - --set-customization-variable OPEN_QUOTE_SYMBOL=\" \ - -o nncp.html index.texi - cp -r .well-known nncp.html/ diff --git a/doc/all.do b/doc/all.do new file mode 100644 index 0000000000000000000000000000000000000000..3454841cfdcf8cefda09978ccb38192155e8c9d5e5db053e5b0d33551e0e0679 --- /dev/null +++ b/doc/all.do @@ -0,0 +1 @@ +redo-ifchange nncp.info nncp.html diff --git a/doc/building.texi b/doc/building.texi index a8d3ae2b87ac90ea9c7190d4dc5428b73ce106ff9bb3b9185589a8f2a9e9ac41..e4e0e0e1e1f4abbce4415016cd0b83aedbf5655dced275345b9b6a5284d42bbc 100644 --- a/doc/building.texi +++ b/doc/building.texi @@ -15,12 +15,19 @@ $ [fetch|wget] http://www.nncpgo.org/download/nncp-@value{VERSION}.tar.xz $ [fetch|wget] http://www.nncpgo.org/download/nncp-@value{VERSION}.tar.xz.sig $ gpg --verify nncp-@value{VERSION}.tar.xz.sig nncp-@value{VERSION}.tar.xz $ xz --decompress --stdout nncp-@value{VERSION}.tar.xz | tar xf - -$ make -C nncp-@value{VERSION} all +$ cd nncp-@value{VERSION} +$ redo all @end example +It uses @url{http://cr.yp.to/redo.html, redo} build system for that +examples. You can use either dozen of various implementations, or at +least minimalistic POSIX shell @command{contrib/do} (just replace +@command{redo} with @command{contrib/do} in the example above) included +in tarball. + There is @command{install} make-target respecting @env{DESTDIR}. It will install binaries and info-documentation: @example -# make -C nncp-@value{VERSION} install PREFIX=/usr/local +# PREFIX=/usr/local redo install @end example diff --git a/doc/default.plantuml.txt.do b/doc/default.plantuml.txt.do new file mode 100644 index 0000000000000000000000000000000000000000..b79a9d7198f17aa1b7a85a9353484ee31af49eb824449b29172bb22cdf90d1e9 --- /dev/null +++ b/doc/default.plantuml.txt.do @@ -0,0 +1,5 @@ +src=${1%.txt} +redo-ifchange $src ../config +. ../config +$PLANTUML -tutxt -pipe < $src + diff --git a/doc/download.texi b/doc/download.texi index 1f677b5647e5d5950a6924713f66f3b29f562c4c168d7ed63a333f42164b2d41..5d2f4c93df1a6745f4eb2478aeb991820ce84ee2783133a177f50a3556ca72ae 100644 --- a/doc/download.texi +++ b/doc/download.texi @@ -24,6 +24,10 @@ @multitable {XXXXX} {XXXX-XX-XX} {XXXX KiB} {link sign} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} @headitem Version @tab Date @tab Size @tab Tarball @tab SHA256 checksum +@item @ref{Release 5.3.3, 5.3.3} @tab 2020-01-23 @tab 1116 KiB +@tab @url{download/nncp-5.3.3.tar.xz, link} @url{download/nncp-5.3.3.tar.xz.sig, sign} +@tab @code{707CD852 4E424C24 BCB22D6B 4BC81709 71C42A5F E0062B93 A8D1DD9D 7FB365D0} + @item @ref{Release 5.3.2, 5.3.2} @tab 2019-12-28 @tab 1118 KiB @tab @url{download/nncp-5.3.2.tar.xz, link} @url{download/nncp-5.3.2.tar.xz.sig, sign} @tab @code{6E2D1B3C CA0DD462 A6F5F8DE 5CB8DE15 C3D33C74 238A2C52 373C7BD6 A126A834} diff --git a/doc/index.texi b/doc/index.texi index f1a647118ca69498f9d308bce8fab72288f5c94cd0654d92084aad68a3bdf54a..c813cdb6767a05d91455f74070eb7fa30c90cd3495e86c02267776395a4b0ba6 100644 --- a/doc/index.texi +++ b/doc/index.texi @@ -3,7 +3,7 @@ @documentencoding UTF-8 @settitle NNCP @copying -This manual is for NNCP (Node to Node copy) -- collection of utilities +This manual is for NNCP (Node to Node copy) -- collection of utilities simplifying secure store-and-forward files and mail exchanging. Copyright @copyright{} 2016-2020 @email{stargrave@@stargrave.org, Sergey Matveev} diff --git a/doc/install.texi b/doc/install.texi index f99f3be265db2195555fcd146bed1c4aff3cefb5c048827c6a1b305dbc96f7d9..e6225c09229d24fae882ba1916f01ee979ee2974349021cdf877997f9c6ae4b2 100644 --- a/doc/install.texi +++ b/doc/install.texi @@ -1,16 +1,14 @@ @node Installation @unnumbered Installation -@set VERSION 5.3.3 - Possibly NNCP package already exists for your distribution: @itemize @item @url{https://www.freshports.org/net/nncp/, FreeBSD ports} @item @url{https://github.com/DragonFlyBSD/DPorts/tree/master/net/nncp, DragonFly BSD ports} +@item @url{https://github.com/NixOS/nixpkgs/tree/master/pkgs/tools/misc/nncp, NixOS packages} @item @url{https://github.com/void-linux/void-packages/blob/master/srcpkgs/nncp/template, Void Linux} @item @url{https://qa.debian.org/developer.php?login=jgoerzen@@complete.org, Debian packages} (pending inclusion, maintainer's page) -@item @url{https://github.com/NixOS/nixpkgs/pull/75772, NixOS packages} (pending inclusion, maintainer's page) @end itemize NNCP should run on any POSIX-compatible operating system. diff --git a/doc/integration.texi b/doc/integration.texi index a4abbf5ba9f25bf0c9a7e8241b5f6e15892320e8bbc33151655ab9e25249e822..f0ac4b13ba206a64e8f50de9e77591d0f957bd3903af384e65406bf9415b4062 100644 --- a/doc/integration.texi +++ b/doc/integration.texi @@ -167,7 +167,7 @@ and add feeds you want to retrieve: @example -$ r2e add https://git.cypherpunks.ru/cgit.cgi/nncp.git/atom/?h=master +$ r2e add http://git.cypherpunks.ru/cgit.cgi/nncp.git/atom/?h=master @end example and run the process: diff --git a/doc/news.ru.texi b/doc/news.ru.texi index 6375a6ebfeb1c2a72e38260f1d1ff1f865a2f2b7295926702ea862584051ac40..63a24983b1a29714fa11f4f6ab03c96d31b508dc38cb19f1152f8d576299ee8c 100644 --- a/doc/news.ru.texi +++ b/doc/news.ru.texi @@ -1,6 +1,20 @@ @node Новости @section Новости +@node Релиз 5.4.0 +@subsection Релиз 5.4.0 +@itemize + +@item +Обновлены зависимые библиотеки. + +@item +Система сборки переведена с Makefile-ов на @url{http://cr.yp.to/redo.html, redo}. +Это не должно повлиять на мейнтейнеров пакетов, так как минимальная +реализация @command{redo} включена в tarball. + +@end itemize + @node Релиз 5.3.3 @subsection Релиз 5.3.3 @itemize diff --git a/doc/news.texi b/doc/news.texi index b3806783c076379c2bcb93788c58aafa2e81ac08d14e2400947aed5f660d7fc9..a49dd50a29ab733778c4ea5af9e16552471d533003416b1310c8690a8142ff80 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -3,6 +3,20 @@ @unnumbered News See also this page @ref{Новости, on russian}. +@node Release 5.4.0 +@section Release 5.4.0 +@itemize + +@item +Updated dependencies. + +@item +Build system is moved from Makefiles to @url{http://cr.yp.to/redo.html, redo}. +This should not influence package maintainers, because minimal @command{redo} +implementation is included in tarball. + +@end itemize + @node Release 5.3.3 @section Release 5.3.3 @itemize diff --git a/doc/nncp.html.do b/doc/nncp.html.do new file mode 100644 index 0000000000000000000000000000000000000000..12a30f3d66d111660b5eff73930a31a9cc225e8c6c6f6f54eff30cdf09aaaf8f --- /dev/null +++ b/doc/nncp.html.do @@ -0,0 +1,7 @@ +rm -fr nncp.html +MAKEINFO_OPTS="$MAKEINFO_OPTS --html" +MAKEINFO_OPTS="$MAKEINFO_OPTS --set-customization-variable SHOW_TITLE=0" +MAKEINFO_OPTS="$MAKEINFO_OPTS --set-customization-variable DATE_IN_HEADER=1" +MAKEINFO_OPTS="$MAKEINFO_OPTS --set-customization-variable TOP_NODE_UP_URL=index.html" +MAKEINFO_OPTS="$MAKEINFO_OPTS" . nncp.info.do +cp -r .well-known $3 diff --git a/doc/nncp.info.do b/doc/nncp.info.do new file mode 100644 index 0000000000000000000000000000000000000000..236ec9f5c2a79dd692b074159d89d1a2eb1c449ac2cdb1aec1bd739ec843352f --- /dev/null +++ b/doc/nncp.info.do @@ -0,0 +1,9 @@ +redo-ifchange ../config ../VERSION *.texi sp.plantuml.txt pedro.txt +. ../config +${MAKEINFO:-makeinfo} \ + -D "VERSION `cat ../VERSION`" \ + $MAKEINFO_OPTS \ + --set-customization-variable CLOSE_QUOTE_SYMBOL=\" \ + --set-customization-variable OPEN_QUOTE_SYMBOL=\" \ + --set-customization-variable CSS_LINES="`cat style.css`" \ + --output $3 index.texi diff --git a/doc/sources.texi b/doc/sources.texi index ad02cef5dfe332f97cd061cfab97b7bbaebdea82d8b0d55fbdd4739321acb208..f47fcb47db04bb743ba6799fe6bd02c5b1311253809ccc166beeef177fa50588 100644 --- a/doc/sources.texi +++ b/doc/sources.texi @@ -11,21 +11,3 @@ $ git clone git://git.cypherpunks.ru/nncp.git $ cd nncp $ git checkout develop @end example - -Also there is mirror of dependent libraries for safety if their native -repositories will be unavailable (they are seldom updated): - -@multitable @columnfractions .50 .50 -@headitem Software/library @tab Mirror -@item @code{github.com/davecgh/go-xdr} @tab @url{git://git.cypherpunks.ru/go-xdr.git} -@item @code{github.com/dustin/go-humanize} @tab @url{git://git.cypherpunks.ru/go-humanize.git} -@item @code{github.com/flynn/noise} @tab @url{git://git.cypherpunks.ru/noise.git} -@item @code{github.com/google/go-cmp} @tab @url{git://git.cypherpunks.ru/go-cmp.git} -@item @code{github.com/gorhill/cronexpr} @tab @url{git://git.cypherpunks.ru/cronexpr.git} -@item @code{github.com/hjson/hjson-go} @tab @url{git://git.cypherpunks.ru/hjson-go.git} -@item @code{github.com/klauspost/compress} @tab @url{git://git.cypherpunks.ru/compress.git} -@item @code{golang.org/x/crypto} @tab @url{git://git.cypherpunks.ru/crypto.git} -@item @code{golang.org/x/net} @tab @url{git://git.cypherpunks.ru/net.git} -@item @code{golang.org/x/sys} @tab @url{git://git.cypherpunks.ru/sys.git} -@item @code{gopkg.in/check.v1} @tab @url{git://git.cypherpunks.ru/check.git} -@end multitable diff --git a/doc/sp.plantuml b/doc/sp.plantuml new file mode 100644 index 0000000000000000000000000000000000000000..6ebfd6fe7e81840c0f8de1b7cb1ebac57b515c29770696dabbbf8f16d69e4676 --- /dev/null +++ b/doc/sp.plantuml @@ -0,0 +1,34 @@ + ┌─────────┐ ┌─────────┐ + │Initiator│ │Responder│ + └────┬────┘ └────┬────┘ + │ │ + │ ╔═════════════╗ │ +══════════╪═════════╣ preparation ╠═════════╪══════════ + │ ╚═════════════╝ │ + │ │ + │ [s] │ + │<────────────────────────────────│ + │ │ + │ │ + │ ╔═════════════╗ │ +══════════╪═════════╣ interactive ╠═════════╪══════════ + │ ╚═════════════╝ │ + │ │ + │[e, es, s, ss], INFO..., HALT... │ + │────────────────────────────────>│ + │ │ + │ [e, ee, se], INFO..., HALT... │ + │<────────────────────────────────│ + │ │ + │ INFO..., FREQ..., DONE... │ + │────────────────────────────────>│ + │ │ + │ INFO..., FREQ..., DONE... │ + │<────────────────────────────────│ + │ │ + │FILE..., INFO..., DONE..., PING │ + │────────────────────────────────>│ + │ │ + │FILE..., INFO..., DONE..., PING │ + │<────────────────────────────────│ + │ │ diff --git a/doc/sp.texi b/doc/sp.texi index b3a6ad33028f34e89318383d152b09ff58d3f1664dd6663bcc88aac78ab2e7aa..2c5c7337c01c7fbf9a20652681119f9e2136f9272f37532c3bfe8247b8925a05 100644 --- a/doc/sp.texi +++ b/doc/sp.texi @@ -154,7 +154,7 @@ @end table Typical peer's behaviour is following: -@verbatiminclude sp.utxt +@verbatiminclude sp.plantuml.txt @enumerate @item Perform @emph{Noise-IK} handshake: diff --git a/doc/sp.txt b/doc/sp.txt deleted file mode 100644 index 4c898e8bce7fceb300ccfa6f0a297c99af42076556be3f6db0709b55928668cc..0000000000000000000000000000000000000000 --- a/doc/sp.txt +++ /dev/null @@ -1,19 +0,0 @@ -@startuml -hide footbox -participant Initiator -participant Responder - -== preparation == - -Initiator <- Responder : [s] - -== interactive == - -Initiator -> Responder : [e, es, s, ss], INFO..., HALT... -Initiator <- Responder : [e, ee, se], INFO..., HALT... -Initiator -> Responder : INFO..., FREQ..., DONE... -Initiator <- Responder : INFO..., FREQ..., DONE... -Initiator -> Responder : FILE..., INFO..., DONE..., PING -Initiator <- Responder : FILE..., INFO..., DONE..., PING - -@enduml diff --git a/doc/style.css b/doc/style.css index 7cfb55f8ad0828d46db2d8ab86aec767541141dedbdb0a821ba846b195309e85..80e824dd12986301befe23705fc699747e6174c74199985b8ea56d76a223be5b 100644 --- a/doc/style.css +++ b/doc/style.css @@ -7,5 +7,5 @@ } h1, h2, h3, h4 { text-align: center } h1, h2, h3, h4, strong { color: #900090 } pre { background-color: #CCCCCC } -table, th, td { border: 1px solid black } +table, th, td { border: 1px solid black ; border-collapse: collapse } --> diff --git a/doc/thanks.texi b/doc/thanks.texi index fb4806484e7af0676029ea45e7044ba8a67516b1875ffc9ef73743342550a94c..4265fde60238046974246482fc89f6d73d596a2c39f6baf3f7783298fb2baef1 100644 --- a/doc/thanks.texi +++ b/doc/thanks.texi @@ -8,6 +8,9 @@ @item Shawn K. Quinn for his descriptive instructions about building NNCP under Ubuntu GNU/Linux distributions and bug reports. +@item @url{mailto:nncp@@woffs.de, Frank Doepper} for his bug reports +feedback and NixOS package maintenance. + @item @url{mailto:jgoerzen@@complete.org, John Goerzen} for his feature suggestions and Debian package maintenance. diff --git a/gopath.do b/gopath.do new file mode 100644 index 0000000000000000000000000000000000000000..a6f3700b87a7ec25f53c187b49c9bcbbca831a6fbe41ee2b0f7d2c6c570220e7 --- /dev/null +++ b/gopath.do @@ -0,0 +1 @@ +echo GOPATH=${GOPATH:-`pwd`} diff --git a/install-strip.do b/install-strip.do new file mode 100644 index 0000000000000000000000000000000000000000..616a0b3c4a814f9a5d712c2f0bef600a7bb330ae1cdc86a73d0f80801c2255cc --- /dev/null +++ b/install-strip.do @@ -0,0 +1,5 @@ +redo-ifchange config install +. ./config +for cmd in `cat bin/cmd.list` ; do + strip $BINDIR/$cmd +done diff --git a/install.do b/install.do new file mode 100644 index 0000000000000000000000000000000000000000..209e5abdcc9cf689e8010fd48087fd909efc418c433e66c829586c447192d669 --- /dev/null +++ b/install.do @@ -0,0 +1,16 @@ +redo-ifchange config bin/all doc/nncp.info +. ./config + +mkdir -p $BINDIR +for cmd in `cat bin/cmd.list` ; do + cp -f bin/$cmd $BINDIR + chmod 755 $BINDIR/$cmd +done + +mkdir -p $INFODIR +cp -f doc/nncp.info $INFODIR +chmod 644 $INFODIR/nncp.info + +mkdir -p $DOCDIR +cp -f -L AUTHORS NEWS NEWS.RU README README.RU THANKS $DOCDIR +chmod 644 $DOCDIR/* diff --git a/makedist.sh b/makedist.sh index a3b58375adeed0b24cc4748e606b09e25a7b73a066840f86e1b39bc52bce91e2..9691f86241ce58857a471a2e55c699f565d0faffc53b69039b28f1a6ec0c7805 100755 --- a/makedist.sh +++ b/makedist.sh @@ -8,9 +8,10 @@ git clone . $tmp/nncp-$release cd $tmp/nncp-$release git checkout v$release +redo module-name VERSION +mod_name=`cat module-name` rm -fr .git -mod_name=$(sed -n 's/^module //p' src/go.mod) mv src src.orig mkdir -p src/$mod_name mv src.orig/* src/$mod_name @@ -67,6 +68,7 @@ golang.org/x/sys/AUTHORS golang.org/x/sys/CONTRIBUTORS golang.org/x/sys/cpu golang.org/x/sys/go.mod +golang.org/x/sys/internal/unsafeheader golang.org/x/sys/LICENSE golang.org/x/sys/PATENTS golang.org/x/sys/README.md @@ -99,7 +101,14 @@ rm -r src/github.com/flynn/noise/vector* rm src/github.com/hjson/hjson-go/build_release.sh rm src/github.com/gorhill/cronexpr/APLv2 rm -fr ports -rm makedist.sh +find . -name .gitignore -delete +rm makedist.sh module-name.do VERSION.do + +mkdir contrib +cp ~/work/redo/minimal/do contrib/do +echo echo GOPATH=\`pwd\` > gopath.do + +perl -p -i -e "s#src/#src/$mod_name/#g" bin/default.do cat > doc/download.texi < $texi < $texi < $texi < $texi < diff --git a/ports/nncp/pkg-plist b/ports/nncp/pkg-plist index 22fbf9b6e30f0ebd7d0c35dfffb46946da8691ae5cc0db5c1f78b05605a8e787..78e0e5f8a7aae806d2217979a3f7a480e24e278cb5dcfc1d164bab9ace7415fb 100644 --- a/ports/nncp/pkg-plist +++ b/ports/nncp/pkg-plist @@ -16,4 +16,5 @@ bin/nncp-rm bin/nncp-stat bin/nncp-toss bin/nncp-xfer +@dir etc/newsyslog.conf.d @sample etc/nncp.conf.sample etc/newsyslog.conf.d/nncp.conf diff --git a/src/go.mod b/src/go.mod index 931c20be4bc3d9ca5eebc6fd66572581f805386dca8d7579493879c4c3a6c35e..4f341b7b6a401374e6d3c2438222c21fd3be1873b4ebd02b99fd67178c183122 100644 --- a/src/go.mod +++ b/src/go.mod @@ -5,14 +5,14 @@ github.com/davecgh/go-xdr v0.0.0-20161123171359-e6a2ba005892 github.com/dustin/go-humanize v1.0.0 github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6 github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 - github.com/hjson/hjson-go v3.0.1+incompatible - github.com/klauspost/compress v1.9.8 - github.com/kr/pretty v0.1.0 // indirect + github.com/hjson/hjson-go v3.1.0+incompatible + github.com/klauspost/compress v1.11.0 + github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect go.cypherpunks.ru/balloon v1.1.1 - golang.org/x/crypto v0.0.0-20200117160349-530e935923ad + golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa - golang.org/x/sys v0.0.0-20200122134326-e047566fdf82 - gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect + golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d + gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect ) go 1.10 diff --git a/src/go.sum b/src/go.sum index 917c9e597c7b1f154f540c91445d8d61914ffe39269bbf81b1f9f36327c36717..d3a6c0451243a2424ac16787523db1dbefa35bc91ea26247428855bdb11ec2dc 100644 --- a/src/go.sum +++ b/src/go.sum @@ -6,28 +6,27 @@ 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= -github.com/hjson/hjson-go v3.0.1+incompatible h1:JwOXblcMiBbiWue7iPkoFK9oXSnW8n+qXh/0Fio6TCo= -github.com/hjson/hjson-go v3.0.1+incompatible/go.mod h1:qsetwF8NlsTsOTwZTApNlTCerV+b2GjYRRcIk4JMFio= -github.com/klauspost/compress v1.9.8 h1:VMAMUUOh+gaxKTMk+zqbjsSjsIcUcL/LF4o63i82QyA= -github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/hjson/hjson-go v3.1.0+incompatible h1:DY/9yE8ey8Zv22bY+mHV1uk2yRy0h8tKhZ77hEdi0Aw= +github.com/hjson/hjson-go v3.1.0+incompatible/go.mod h1:qsetwF8NlsTsOTwZTApNlTCerV+b2GjYRRcIk4JMFio= +github.com/klauspost/compress v1.11.0 h1:wJbzvpYMVGG9iTI9VxpnNZfd4DzMPoCWze3GgSqz8yg= +github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= go.cypherpunks.ru/balloon v1.1.1 h1:ypHM1DRf/XuCrp9pDkTHg00CqZX/Np/APb//iHvDJTA= go.cypherpunks.ru/balloon v1.1.1/go.mod h1:k4s4ozrIrhpBjj78Z7LX8ZHxMQ+XE7DZUWl8gP2ojCo= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200117160349-530e935923ad h1:Jh8cai0fqIK+f6nG0UgPW5wFk8wmiMhM3AyciDBdtQg= -golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa h1:F+8P+gmewFQYRk6JoLQLwjBCTu3mcIURZfNkVweuRKA= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 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-20200122134326-e047566fdf82 h1:ywK/j/KkyTHcdyYSZNXGjMwgmDSfjglYZ3vStQ/gSCU= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d h1:L/IKR6COd7ubZrs2oTnTi73IhgqJ71c9s80WsQnh0Es= +golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/src/log.go b/src/log.go index 0b79949c33237644d1b03b8053f739cc89093e2d96cc8b1b1912196ba0e7a2ba..b016a45afc35a61cb48935ce281a58a4d39537dda9548d99fc60902ec6c3630d 100644 --- a/src/log.go +++ b/src/log.go @@ -75,6 +75,7 @@ if err != nil { fmt.Fprintln(os.Stderr, "Can not open lock for log:", err) return } + defer fdLock.Close() fdLockFd := int(fdLock.Fd()) err = unix.Flock(fdLockFd, unix.LOCK_EX) if err != nil { diff --git a/src/nncp.go b/src/nncp.go index f5ea6adbd33699485fe8b99f19ca56fd983703818e9ce387955f7eec9b495b67..2556e253c1ed6aedc3b1c6455d035e288b55a2af12de67a3ca05f35ebf927e91 100644 --- a/src/nncp.go +++ b/src/nncp.go @@ -38,7 +38,7 @@ along with this program. If not, see .` ) var ( - Version string = "UNKNOWN" + Version string = "5.4.0" Base32Codec *base32.Encoding = base32.StdEncoding.WithPadding(base32.NoPadding) ) diff --git a/src/sp.go b/src/sp.go index 61ae718bfc1808856336ceaef6879be8eab7d41b768d902cf6931eefae20d29b..d47eae281738a4d5c3775f747015a0cd5d707f9d1af4fd1465e82bdfd282f2eb 100644 --- a/src/sp.go +++ b/src/sp.go @@ -226,11 +226,11 @@ default: } close(state.isDead) go func() { - for _ = range state.payloads { + for range state.payloads { } }() go func() { - for _ = range state.pings { + for range state.pings { } }() } diff --git a/src/uilive/writer.go b/src/uilive/writer.go index f6051461a9b176b8d264957f1489cbcefdb6469fb46ebf26a1473c8cb4733bf3..1ea096eb8fda7ccd98c9e153c99bac8a8a8056f6b58fdb329fec2ac0101d6fb2 100644 --- a/src/uilive/writer.go +++ b/src/uilive/writer.go @@ -6,9 +6,6 @@ // is printed // * By default it uses stderr // * By default it uses 10ms refresh period // * defer-s are removed for less CPU usage -// * By default it uses stderr -// * By default it uses stderr -// * By default it uses stderr // * Removed newline/bypass related code. No Windows support package uilive diff --git a/test.do b/test.do new file mode 100644 index 0000000000000000000000000000000000000000..f9ddbaa50c6ef53880e4932d899a27dd1b013f80cd4a049a0014bd7b3951c345 --- /dev/null +++ b/test.do @@ -0,0 +1,6 @@ +redo-ifchange config gopath module-name +. ./config +. ./gopath +mod=`cat module-name` +cd src +GOPATH=$GOPATH ${GO:-go} test -failfast $mod/... diff --git a/uninstall.do b/uninstall.do new file mode 100644 index 0000000000000000000000000000000000000000..1888b8c28f8437cb00d895e5aa02363462d62dae74ae07d356d1de4b80adaad2 --- /dev/null +++ b/uninstall.do @@ -0,0 +1,5 @@ +redo-ifchange config +. ./config +for cmd in `cat bin/cmd.list` ; do rm -f $BINDIR/$cmd ; done +rm -f $INFODIR/nncp.info +rm -fr $DOCDIR