]> Cypherpunks.ru repositories - nncp.git/commitdiff
No redo during installation
authorSergey Matveev <stargrave@stargrave.org>
Thu, 3 Aug 2023 13:04:24 +0000 (16:04 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 9 Aug 2023 12:09:11 +0000 (15:09 +0300)
26 files changed:
.gitignore [deleted file]
Makefile [deleted file]
VERSION.do [deleted file]
all.do [deleted file]
bin/.gitignore [deleted file]
bin/all.do [deleted file]
bin/build [new file with mode: 0755]
bin/clean.do [deleted file]
bin/default.do [deleted file]
bin/hjson-cli.do [deleted file]
clean.do [deleted file]
doc.do [deleted file]
doc/building.texi
doc/makeinfo.rc
doc/news.ru.texi
doc/news.texi
install [new file with mode: 0755]
install-strip [new file with mode: 0755]
install-strip.do [deleted file]
install.do [deleted file]
makedist
src/nncp.go
test.do [deleted file]
uninstall [new file with mode: 0755]
uninstall.do [deleted file]
version [new file with mode: 0755]

diff --git a/.gitignore b/.gitignore
deleted file mode 100644 (file)
index fd85e30..0000000
+++ /dev/null
@@ -1 +0,0 @@
-VERSION
diff --git a/Makefile b/Makefile
deleted file mode 100644 (file)
index 1ae4fe8..0000000
--- a/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-REDO ?= contrib/do -c
-
-warning:
-       @echo WARNING: this is not real Makefile. Just proxying commands to redo command
-
-all: warning
-       $(REDO) $@
-
-clean: warning
-       $(REDO) $@
-
-install: warning
-       $(REDO) $@
-
-install-strip: warning
-       $(REDO) $@
-
-uninstall: warning
-       $(REDO) $@
diff --git a/VERSION.do b/VERSION.do
deleted file mode 100644 (file)
index 488da2c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-redo-ifchange src/nncp.go
-perl -ne 'print "$1\n" if /Version.* = "(.*)"$/' < src/nncp.go
diff --git a/all.do b/all.do
deleted file mode 100644 (file)
index 8c7fdb1..0000000
--- a/all.do
+++ /dev/null
@@ -1 +0,0 @@
-redo-ifchange bin/all
diff --git a/bin/.gitignore b/bin/.gitignore
deleted file mode 100644 (file)
index b3d9328..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-hjson-cli
-nncp-*
diff --git a/bin/all.do b/bin/all.do
deleted file mode 100644 (file)
index 2b31559..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-redo-ifchange cmd.list hjson-cli
-redo-ifchange `cat cmd.list`
diff --git a/bin/build b/bin/build
new file mode 100755 (executable)
index 0000000..1cbd5fc
--- /dev/null
+++ b/bin/build
@@ -0,0 +1,13 @@
+#!/bin/sh -e
+
+cd "$(realpath -- $(dirname "$0"))"/../src
+GO=${GO:-go}
+mod=`$GO list -mod=vendor -m`
+GO_LDFLAGS="$GO_LDFLAGS -X $mod.DefaultCfgPath=$CFGPATH"
+GO_LDFLAGS="$GO_LDFLAGS -X $mod.DefaultSendmailPath=$SENDMAIL"
+GO_LDFLAGS="$GO_LDFLAGS -X $mod.DefaultSpoolPath=$SPOOLPATH"
+GO_LDFLAGS="$GO_LDFLAGS -X $mod.DefaultLogPath=$LOGPATH"
+for cmd in `cat ../bin/cmd.list` ; do
+    $GO build -mod=vendor -o ../bin/$cmd $GO_CFLAGS -ldflags "$GO_LDFLAGS" ./cmd/$cmd
+done
+$GO build -mod=vendor -o ../bin/$cmd $GO_CFLAGS github.com/hjson/hjson-go/hjson-cli
diff --git a/bin/clean.do b/bin/clean.do
deleted file mode 100644 (file)
index 86a5019..0000000
+++ /dev/null
@@ -1 +0,0 @@
-rm -f `cat cmd.list` hjson-cli
diff --git a/bin/default.do b/bin/default.do
deleted file mode 100644 (file)
index 52c5501..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-cd ../src
-redo-ifchange ../config *.go cmd/${1##*/}/*.go
-. ../config
-GO=${GO:-go}
-mod=`$GO list -m`
-GO_LDFLAGS="$GO_LDFLAGS -X $mod.DefaultCfgPath=$CFGPATH"
-GO_LDFLAGS="$GO_LDFLAGS -X $mod.DefaultSendmailPath=$SENDMAIL"
-GO_LDFLAGS="$GO_LDFLAGS -X $mod.DefaultSpoolPath=$SPOOLPATH"
-GO_LDFLAGS="$GO_LDFLAGS -X $mod.DefaultLogPath=$LOGPATH"
-$GO build -o ../bin/$3 $GO_CFLAGS -ldflags "$GO_LDFLAGS" ./cmd/${1##*/}
diff --git a/bin/hjson-cli.do b/bin/hjson-cli.do
deleted file mode 100644 (file)
index c7d40d2..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-cd ../src
-GO=${GO:-go}
-$GO build -o ../bin/$3 github.com/hjson/hjson-go/hjson-cli
diff --git a/clean.do b/clean.do
deleted file mode 100644 (file)
index ebefc3e..0000000
--- a/clean.do
+++ /dev/null
@@ -1,2 +0,0 @@
-redo bin/clean
-rm -f VERSION
diff --git a/doc.do b/doc.do
deleted file mode 100644 (file)
index e8a354a..0000000
--- a/doc.do
+++ /dev/null
@@ -1 +0,0 @@
-redo-ifchange doc/all
index 5aa7f10f5e7318e446584d2b71fe9f1e78cc96e2..af28f753a88888ce6559afe6271481b94a72246c 100644 (file)
@@ -17,7 +17,7 @@ $ [fetch|wget] http://www.nncpgo.org/download/nncp-@value{VERSION}.tar.xz.asc
 $ gpg --verify nncp-@value{VERSION}.tar.xz.asc nncp-@value{VERSION}.tar.xz
 $ xz --decompress --stdout nncp-@value{VERSION}.tar.xz | tar xf -
 $ cd nncp-@value{VERSION}
-$ redo all
+$ bin/build
 @end example
 
 @pindex info
@@ -27,22 +27,6 @@ necessary installation). For example, documentation for
 @command{nncp-bundle} command can be get with
 @command{info doc/nncp.info -n nncp-bundle}.
 
-@pindex redo
-@pindex apenwarr/redo
-@pindex apenwarr/do
-@pindex redo-c
-@pindex baredo
-@pindex goredo
-It uses @url{http://cr.yp.to/redo.html, redo} build system for that
-examples. You can use one of its 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. Following ones are tested to work with:
-@url{http://www.goredo.cypherpunks.ru/, goredo} (NNCP's author creation),
-@url{https://redo.readthedocs.io/, apenwarr/redo} (@code{contrib/do} is
-from that project), @url{https://github.com/leahneukirchen/redo-c, redo-c},
-@url{https://github.com/gotroyb127/baredo, baredo}.
-
 @vindex PREFIX
 @vindex DESTDIR
 @vindex GO
@@ -72,25 +56,25 @@ respected during installation:
 @env{$INFODIR},
 @env{$DOCDIR}.
 
-There is @command{install} target for binaries and info-documentation
+There is @command{install} script for binaries and info-documentation
 installation:
 
 @example
-# PREFIX=/usr/local redo install
+# PREFIX=/usr/local ./install
 @end example
 
 @vindex nofsnotify
 @cindex kqueue
 @cindex epoll
 @vindex GO_CFLAGS
-NNCP depends on @code{github.com/fsnotify/fsnotify} library, that is
-solely relies on OS-specific mechanisms. There is possibility that you
-have either broken or unsupported ones. You can still build NNCP with
+NNCP depends on @code{github.com/fsnotify/fsnotify} library, that solely
+relies on OS-specific mechanisms. There is possibility that you have
+either broken or unsupported ones. You can still build NNCP with
 @code{-tags nofsnotify} build option, to skip @code{fsnotify} library
 usage at all:
 
 @example
-$ GO_CFLAGS="-tags nofsnotify" redo @dots{}
+$ GO_CFLAGS="-tags nofsnotify" bin/build
 @end example
 
 @vindex noyggdrasil
index e58f0e9888f30fda7ffc1b9239dce4a080c49931..2c459e997365f68ac1ab69aea1e8c6a7da41097e 100644 (file)
@@ -1,6 +1,5 @@
 redo-ifchange \
     ../config \
-    ../VERSION \
     *.texi \
     cfg/*.texi \
     cmd/*.texi \
@@ -12,7 +11,7 @@ redo-ifchange \
     usecases/*.texi
 . ../config
 ${MAKEINFO:-makeinfo} \
-    -D "VERSION `cat ../VERSION`" \
+    -D "VERSION `../version`" \
     $MAKEINFO_OPTS \
     --set-customization-variable SECTION_NAME_IN_TITLE=1 \
     --set-customization-variable TREE_TRANSFORMATIONS=complete_tree_nodes_menus \
index bc331a886664d09e8a176a237cbed16d313c1309..31fbf580f37cec42bd172894e4b61a6039a12751 100644 (file)
@@ -1,6 +1,16 @@
 @node Новости
 @section Новости
 
+@node Релиз 8.8.4
+@subsection Релиз 8.8.4
+@itemize
+
+@item
+Избавиться от @command{redo} системы сборки при установке, так как по сути
+нет зависимостей, только компиляция Go кода.
+
+@end itemize
+
 @node Релиз 8.8.3
 @subsection Релиз 8.8.3
 @itemize
index fa973407bbac647a13281a5ece77fd9c6a9983aa..a7ec96118c51eb1af61c1175dc384c5c04bde554 100644 (file)
@@ -4,6 +4,16 @@
 
 See also this page @ref{Новости, on russian}.
 
+@node Release 8_8_4
+@section Release 8.8.4
+@itemize
+
+@item
+Get rid of @command{redo} build system during installation, as there are
+virtually none dependencies, just only compilation of the Go code.
+
+@end itemize
+
 @node Release 8_8_3
 @section Release 8.8.3
 @itemize
diff --git a/install b/install
new file mode 100755 (executable)
index 0000000..0b5c8c3
--- /dev/null
+++ b/install
@@ -0,0 +1,18 @@
+#!/bin/sh -e
+
+cd "$(realpath -- $(dirname "$0"))"
+. ./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/install-strip b/install-strip
new file mode 100755 (executable)
index 0000000..9b7875a
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh -e
+
+root="$(realpath -- $(dirname "$0"))"
+cd "$root"
+./install
+. ./config
+for cmd in `cat bin/cmd.list` ; do
+    strip "$BINDIR"/$cmd
+done
diff --git a/install-strip.do b/install-strip.do
deleted file mode 100644 (file)
index 63b442e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-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
deleted file mode 100644 (file)
index 95c71cb..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-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/*
index cc9cbc38f52c01619e3801990253da35dde00a6a..c115272616eef08fbe6c084d7bf8dad2012739da 100755 (executable)
--- a/makedist
+++ b/makedist
@@ -1,5 +1,6 @@
 #!/bin/sh -ex
 
+PATH=$HOME/work/meta4ra/contrib:$PATH
 cur=$(pwd)
 tmp=$(mktemp -d)
 release=$1
@@ -8,7 +9,7 @@ release=$1
 git clone . $tmp/nncp-$release
 cd $tmp/nncp-$release
 git checkout v$release
-redo VERSION
+./version > VERSION
 cd src
 go mod vendor
 modvendor -v -copy="**/*_test.go **/words.go **/README.md **/main.go"
@@ -35,9 +36,6 @@ find . \( \
     -name .goreleaser.yml -o \
     -name .gitattributes \) -delete
 
-mkdir contrib
-cp ~/work/redo/apenwarr/minimal/do contrib/do
-
 cat > doc/download.texi <<EOF
 @node Tarballs
 @section Prepared tarballs
@@ -105,16 +103,15 @@ rm -r doc/.well-known
 
 ########################################################################
 
-perl -i -npe "s/GO build/GO build -mod=vendor/" bin/default.do bin/hjson-cli.do
-perl -i -npe "s/GO list/GO list -mod=vendor/" bin/default.do
-perl -i -npe "s/GO test/GO test -mod=vendor/" test.do
-rm makedist VERSION.do
+perl -i -npe "s/GO build/GO build -mod=vendor/" bin/build
+perl -i -npe "s/GO list/GO list -mod=vendor/" bin/build
+rm makedist version
 rm -r .git
 redo-cleanup full
 find . -type d -exec chmod 755 {} +
 find . -type f -exec chmod 644 {} +
 find . -type f -name "*.sh" -exec chmod +x {} +
-chmod +x contrib/do
+chmod +x bin/build install install-strip uninstall
 
 cd ..
 tar cvf nncp-"$release".tar --uid=0 --gid=0 --numeric-owner nncp-"$release"
index dde9bcb020cb3b509bf5c0e0d7cbf3f22361a388..5b6ef8bbfebf2a8e07529e1db9eb0e432818f2a0 100644 (file)
@@ -40,7 +40,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.`
 const Base32Encoded32Len = 52
 
 var (
-       Version string = "8.8.3"
+       Version string = "8.8.4"
 
        Base32Codec *base32.Encoding = base32.StdEncoding.WithPadding(base32.NoPadding)
 )
diff --git a/test.do b/test.do
deleted file mode 100644 (file)
index 13b228a..0000000
--- a/test.do
+++ /dev/null
@@ -1,6 +0,0 @@
-redo-ifchange config
-exec >&2
-. ./config
-cd src
-GO=${GO:-go}
-$GO test -failfast ./...
diff --git a/uninstall b/uninstall
new file mode 100755 (executable)
index 0000000..6864157
--- /dev/null
+++ b/uninstall
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+
+root="$(realpath -- $(dirname "$0"))"
+. "$root"/config
+cd "$BINDIR"
+rm -f `cat "$root"/bin/cmd.list`
+rm -f "$INFODIR"/nncp.info
+rm -fr "$DOCDIR"
diff --git a/uninstall.do b/uninstall.do
deleted file mode 100644 (file)
index fcec27c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-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
diff --git a/version b/version
new file mode 100755 (executable)
index 0000000..7e6282e
--- /dev/null
+++ b/version
@@ -0,0 +1,3 @@
+#!/bin/sh -e
+
+exec perl -ne 'print "$1\n" if /Version.* = "(.*)"$/' < "$(realpath -- $(dirname "$0"))"/src/nncp.go