]> Cypherpunks.ru repositories - gogost.git/commitdiff
Move to redo build system
authorSergey Matveev <stargrave@stargrave.org>
Fri, 19 Jun 2020 12:06:43 +0000 (15:06 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 24 Jun 2020 18:18:49 +0000 (21:18 +0300)
.gitignore [new file with mode: 0644]
Makefile [deleted file]
all.do [new file with mode: 0644]
bench.do [new file with mode: 0644]
clean.do [new file with mode: 0644]
default.do [new file with mode: 0644]
install.texi
makedist.sh
module-name.do [new file with mode: 0644]
www.do [new file with mode: 0644]
www.mk [deleted file]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..7418c4c
--- /dev/null
@@ -0,0 +1 @@
+module-name
diff --git a/Makefile b/Makefile
deleted file mode 100644 (file)
index 9dba5f7..0000000
--- a/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-GOPATH != pwd
-VERSION != cat VERSION
-
-MOD = go.cypherpunks.ru/gogost/v4
-LDFLAGS = -X $(MOD).Version=$(VERSION)
-
-all: streebog256 streebog512
-
-streebog256:
-       GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" $(MOD)/cmd/streebog256
-
-streebog512:
-       GOPATH=$(GOPATH) go build -ldflags "$(LDFLAGS)" $(MOD)/cmd/streebog512
-
-bench:
-       GOPATH=$(GOPATH) go test -benchmem -bench . $(MOD)/...
diff --git a/all.do b/all.do
new file mode 100644 (file)
index 0000000..8e4f885
--- /dev/null
+++ b/all.do
@@ -0,0 +1 @@
+redo-ifchange streebog256 streebog512
diff --git a/bench.do b/bench.do
new file mode 100644 (file)
index 0000000..a08e351
--- /dev/null
+++ b/bench.do
@@ -0,0 +1,3 @@
+redo-ifchange module-name
+exec >&2
+go test -benchmem -bench . `cat module-name`/...
diff --git a/clean.do b/clean.do
new file mode 100644 (file)
index 0000000..615710c
--- /dev/null
+++ b/clean.do
@@ -0,0 +1 @@
+rm -f module-name streebog256 streebog512
diff --git a/default.do b/default.do
new file mode 100644 (file)
index 0000000..85bd5f1
--- /dev/null
@@ -0,0 +1,3 @@
+redo-ifchange module-name
+MOD=`cat module-name`
+go build -o $3 -ldflags "-X ${MOD}.Version=`cat VERSION`" ${MOD}/cmd/$1
index 7cf962cbb602c9b4c1416f19c87d2b4bec30956b..441c9a1543619ad5946264d723854c8abc619cbd 100644 (file)
@@ -11,11 +11,22 @@ $ [fetch|wget] http://gogost.cypherpunks.ru/gogost-@value{VERSION}.tar.xz
 $ [fetch|wget] http://gogost.cypherpunks.ru/gogost-@value{VERSION}.tar.xz.sig
 $ gpg --verify gogost-@value{VERSION}.tar.xz.sig gogost-@value{VERSION}.tar.xz
 $ xz --decompress --stdout gogost-@value{VERSION}.tar.xz | tar xf -
-$ make -C gogost-@value{VERSION} all bench
-$ echo hello world | gogost-@value{VERSION}/streebog256
+$ cd gogost-@value{VERSION}
+$ redo bench
+$ redo all
+$ echo hello world | ./streebog256
 f72018189a5cfb803dbe1f2149cf554c40093d8e7f81c21e08ac5bcd09d9934d
 @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 @code{apenwarr/do}:
+
+@example
+$ [fetch|wget] https://github.com/apenwarr/redo/raw/master/minimal/do
+$ mv do redo ; chmod +x redo
+@end example
+
 @include download.texi
 
 And then you can include its source code in your project for example
@@ -83,13 +94,11 @@ GoGOST is also @command{go get}-able. For example to use
 $ go get go.cypherpunks.ru/gogost/cmd/streebog256
 @end example
 
-@code{go.cypherpunks.ru} uses @url{https://www.cacert.org/, CACert.org}
-certificate authority, that is not included by default in some operating
-system distributions and probably you have to install it in your system,
-because @command{go get} uses HTTPS connections. If you have issues
-using either @code{sum.golang.org} or @code{proxy.golang.org}, then you
-can disable their usage with @env{GOPRIVATE=go.cypherpunks.ru/gogost}
-environment variable.
+@code{go.cypherpunks.ru} uses @url{http://ca.cypherpunks.ru/, ca.cypherpunks.ru}
+certificate authority. If you have issues using either
+@code{sum.golang.org} or @code{proxy.golang.org}, then you can disable
+their usage with @env{GOPRIVATE=go.cypherpunks.ru/gogost} environment
+variable.
 
 Also you can use @code{replace} feature inside your @file{go.mod}, like:
 
index c0bda20d98175f36b5c79162e78cece367a08a1d..5ca9e86a98caf29fd3a6a2118ee7f3a292ca0259 100755 (executable)
@@ -5,11 +5,12 @@ tmp=$(mktemp -d)
 release=$1
 [ -n "$release" ]
 
+redo-ifchange module-name streebog256
+mod_name=`cat module-name`
 git clone . $tmp/gogost-$release
 cd $tmp/gogost-$release
 git checkout v$release
 
-mod_name=$(sed -n 's/^module //p' go.mod)
 crypto_mod_path=$(sed -n 's#^require \(golang.org/x/crypto\) \(.*\)$#\1@\2#p' go.mod)
 mkdir -p src/$mod_name
 mv \
@@ -25,6 +26,10 @@ mv \
     prfplus \
     cmd internal gogost.go go.mod go.sum src/$mod_name
 
+rm module-name.do clean.do
+echo $mod_name > module-name
+find . -name "*.do" -exec perl -i -npe "s/^go/GOPATH=\`pwd\` go/" {} \;
+
 mkdir -p src/golang.org/x/crypto
 ( cd $GOPATH/pkg/mod/$crypto_mod_path ; \
     tar cf - AUTHORS CONTRIBUTORS LICENSE PATENTS README.md pbkdf2 hkdf ) |
@@ -32,7 +37,7 @@ mkdir -p src/golang.org/x/crypto
 
 cat > download.texi <<EOF
 You can obtain releases source code prepared tarballs on
-@url{http://gocheese.cypherpunks.ru/}.
+@url{http://gogost.cypherpunks.ru/}.
 EOF
 
 texi=$(mktemp)
@@ -65,7 +70,7 @@ EOF
 makeinfo --plaintext -o FAQ $texi
 
 find . -name .git -type d | xargs rm -fr
-rm -f *.texi www.mk style.css makedist.sh TODO
+rm -f *.texi www.do style.css makedist.sh TODO .gitignore
 
 find . -type d -exec chmod 755 {} \;
 find . -type f -exec chmod 644 {} \;
diff --git a/module-name.do b/module-name.do
new file mode 100644 (file)
index 0000000..8284690
--- /dev/null
@@ -0,0 +1,2 @@
+redo-ifchange go.mod
+sed -n 's/^module //p' < go.mod
diff --git a/www.do b/www.do
new file mode 100644 (file)
index 0000000..51b16f0
--- /dev/null
+++ b/www.do
@@ -0,0 +1,11 @@
+rm -f gogost.html/*.html
+${MAKEINFO:-makeinfo} --html \
+    --set-customization-variable EXTRA_HEAD='<link rev="made" href="mailto:webmaster@cypherpunks.ru">' \
+    --set-customization-variable CSS_LINES="`cat style.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 gogost.html www.texi
diff --git a/www.mk b/www.mk
deleted file mode 100644 (file)
index b37b4d9..0000000
--- a/www.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-MAKEINFO ?= makeinfo
-
-CSS != cat style.css
-
-all: gogost.html
-
-gogost.html: *.texi
-       rm -f gogost.html/*.html
-       $(MAKEINFO) --html \
-               --set-customization-variable EXTRA_HEAD='<link rev="made" href="mailto:webmaster@cypherpunks.ru">' \
-               --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 gogost.html www.texi