--- /dev/null
+gopath
+module-name
+VERSION
-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) $@
--- /dev/null
+redo-ifchange src/nncp.go
+perl -ne 'print "$1\n" if /Version.* = "(.*)"$/' < src/nncp.go
--- /dev/null
+redo-ifchange bin/all
--- /dev/null
+redo-ifchange cmd.list
+redo-ifchange `cat cmd.list`
--- /dev/null
+rm -f `cat cmd.list`
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+redo bin/clean
+rm gopath module-name VERSION
--- /dev/null
+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
--- /dev/null
+redo-ifchange doc/all
nncp.info
nncp.html
-sp.utxt
+sp.plantuml.txt
+++ /dev/null
-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='<link rev="made" href="mailto:webmaster@nncpgo.org">' \
- --set-customization-variable CSS_LINES='$(CSS)' \
- --set-customization-variable SHOW_TITLE=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/
--- /dev/null
+redo-ifchange nncp.info nncp.html
$ [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
--- /dev/null
+src=${1%.txt}
+redo-ifchange $src ../config
+. ../config
+$PLANTUML -tutxt -pipe < $src
+
@node Installation
@unnumbered Installation
-@set VERSION 5.3.3
-
Possibly NNCP package already exists for your distribution:
@itemize
@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
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
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+ ┌─────────┐ ┌─────────┐
+ │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 │
+ │<────────────────────────────────│
+ │ │
Typical peer's behaviour is following:
-@verbatiminclude sp.utxt
+@verbatiminclude sp.plantuml.txt
@enumerate
@item Perform @emph{Noise-IK} handshake:
+++ /dev/null
-@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
--- /dev/null
+echo GOPATH=${GOPATH:-`pwd`}
--- /dev/null
+redo-ifchange config install
+. ./config
+for cmd in `cat bin/cmd.list` ; do
+ strip $BINDIR/$cmd
+done
--- /dev/null
+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/*
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
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
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 <<EOF
@node Tarballs
perl -p -i -e 's/^(.verbatiminclude) .*$/$1 PUBKEY.asc/g' doc/integrity.texi
mv doc/.well-known/openpgpkey/hu/i4cdqgcarfjdjnba6y4jnf498asg8c6p.asc PUBKEY.asc
ln -s ../PUBKEY.asc doc
-make -C doc
+redo doc
########################################################################
# Supplementary files autogeneration
########################################################################
texi=$(TMPDIR=doc mktemp)
+mkinfo() {
+ ${MAKEINFO:-makeinfo} --plaintext \
+ --set-customization-variable CLOSE_QUOTE_SYMBOL=\" \
+ --set-customization-variable OPEN_QUOTE_SYMBOL=\" \
+ -D "VERSION `cat VERSION`" $@
+}
+
cat > $texi <<EOF
\input texinfo
@documentencoding UTF-8
`sed -n '5,$p' < doc/news.texi`
@bye
EOF
-makeinfo --plaintext -o NEWS $texi
+mkinfo --output NEWS $texi
cat > $texi <<EOF
\input texinfo
`sed -n '3,$p' < doc/news.ru.texi | sed 's/^@subsection/@section/'`
@bye
EOF
-makeinfo --plaintext -o NEWS.RU $texi
+mkinfo --output NEWS.RU $texi
cat > $texi <<EOF
\input texinfo
@include install.texi
@bye
EOF
-makeinfo --plaintext -o INSTALL $texi
+mkinfo --output INSTALL $texi
cat > $texi <<EOF
\input texinfo
`cat doc/thanks.texi`
@bye
EOF
-makeinfo --plaintext -o THANKS $texi
+mkinfo --output THANKS $texi
rm -f $texi
+rm -r doc/.well-known doc/nncp.html/.well-known
########################################################################
-rm -r doc/.gitignore doc/.well-known doc/nncp.html/.well-known
-
+rm -r .redo
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
find . -type f -name "*.sh" -exec chmod 755 {} \;
+chmod 755 contrib/do
cd ..
tar cvf nncp-"$release".tar --uid=0 --gid=0 --numeric-owner nncp-"$release"
xz -9v nncp-"$release".tar
gpg --detach-sign --sign --local-user releases@nncpgo.org nncp-"$release".tar.xz
-mv -v $tmp/nncp-"$release".tar.xz $tmp/nncp-"$release".tar.xz.sig $cur/doc/nncp.html/download
+mv -v $tmp/nncp-"$release".tar.xz $tmp/nncp-"$release".tar.xz.sig $cur/doc/download
-tarball=$cur/doc/nncp.html/download/nncp-"$release".tar.xz
+tarball=$cur/doc/download/nncp-"$release".tar.xz
size=$(( $(stat -f %z $tarball) / 1024 ))
hash=$(gpg --print-md SHA256 < $tarball)
release_date=$(date "+%Y-%m-%d")
--- /dev/null
+redo-ifchange src/go.mod
+sed -n 's/^module //p' < src/go.mod
# $FreeBSD: $
PORTNAME= nncp
-DISTVERSION= 5.3.3
+DISTVERSION= 5.4.0
CATEGORIES= net
MASTER_SITES= http://www.nncpgo.org/download/
)
var (
- Version string = "UNKNOWN"
+ Version string = "5.4.0"
Base32Codec *base32.Encoding = base32.StdEncoding.WithPadding(base32.NoPadding)
)
--- /dev/null
+redo-ifchange config gopath module-name
+. ./config
+. ./gopath
+mod=`cat module-name`
+cd src
+GOPATH=$GOPATH ${GO:-go} test -failfast $mod/...
--- /dev/null
+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