]> Cypherpunks.ru repositories - gogost.git/commitdiff
Take version from source code directly v5.0.1
authorSergey Matveev <stargrave@stargrave.org>
Sat, 5 Sep 2020 07:32:33 +0000 (10:32 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 5 Sep 2020 07:56:02 +0000 (10:56 +0300)
.gitignore
VERSION [deleted file]
VERSION.do [new file with mode: 0644]
clean.do
default.do
gogost.go
install.texi
makedist.sh
www.do

index 7418c4c5f30c65d110e5f10ee8c7343e92b6a2c1..10d32f339bc9364339671457e6a26da2a072b447 100644 (file)
@@ -1 +1,2 @@
 module-name
+VERSION
diff --git a/VERSION b/VERSION
deleted file mode 100644 (file)
index 0062ac9..0000000
--- a/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-5.0.0
diff --git a/VERSION.do b/VERSION.do
new file mode 100644 (file)
index 0000000..4868bed
--- /dev/null
@@ -0,0 +1,2 @@
+redo-ifchange gogost.go
+perl -ne 'print $1 if /Version.*"(.*)"$/' < gogost.go
index 615710ce14dd1ff705c81b57cf153bce741bd4ad..8cd8ae507fb14d7d25f72245060d90d5d0abe740 100644 (file)
--- a/clean.do
+++ b/clean.do
@@ -1 +1 @@
-rm -f module-name streebog256 streebog512
+rm -f module-name streebog256 streebog512 VERSION
index 85bd5f1ead62d04bf5ea1225c46966bc1a59b304..db7986db4a3337e701393ae21ac4060478c1eefd 100644 (file)
@@ -1,3 +1,2 @@
 redo-ifchange module-name
-MOD=`cat module-name`
-go build -o $3 -ldflags "-X ${MOD}.Version=`cat VERSION`" ${MOD}/cmd/$1
+go build -o $3 `cat module-name`/cmd/$1
index de5246b5f736b84a4e85b2e72ffb55d67ec6fbe4..8fd2fc7b43e9c2b380af562c54ac841859fc6f32 100644 (file)
--- a/gogost.go
+++ b/gogost.go
@@ -1,6 +1,4 @@
 // Pure Go GOST cryptographic functions library.
 package gogost
 
-var (
-       Version string = "UNKNOWN"
-)
+const Version = "v5.0.1"
index e756897dd0be593781c8c63d51c751624f30bc19..dcb8b25f2604ba50ea4c5fe23a830f3e759a5442 100644 (file)
@@ -1,8 +1,6 @@
 @node Download
 @unnumbered Download
 
-@set VERSION 5.0.0
-
 Preferable way is to download tarball with the signature from
 website and, for example, run tests with benchmarks:
 
index 84801211f8849d1d7bc438777bc2d135d805246c..c8f0d760a254f5ac7cd4c7a4885f1775b9958aaf 100755 (executable)
@@ -5,11 +5,12 @@ tmp=$(mktemp -d)
 release=$1
 [ -n "$release" ]
 
-redo-ifchange module-name streebog256
-mod_name=`cat module-name`
+redo-ifchange streebog256
 git clone . $tmp/gogost-$release
 cd $tmp/gogost-$release
 git checkout v$release
+redo module-name VERSION
+mod_name=`cat module-name`
 
 crypto_mod_path=$(sed -n 's#^require \(golang.org/x/crypto\) \(.*\)$#\1@\2#p' go.mod)
 mkdir -p src/$mod_name
@@ -26,10 +27,8 @@ 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/" {} \;
-perl -i -npe "s/UNKNOWN/v$release/" src/$mod_name/gogost.go
 mkdir contrib
 cp ~/work/redo/minimal/do contrib/do
 
@@ -43,6 +42,13 @@ You can obtain releases source code prepared tarballs on
 @url{http://www.gogost.cypherpunks.ru/}.
 EOF
 
+mkinfo() {
+    ${MAKEINFO:-makeinfo} --plaintext \
+        --set-customization-variable CLOSE_QUOTE_SYMBOL=\" \
+        --set-customization-variable OPEN_QUOTE_SYMBOL=\" \
+        -D "VERSION `cat VERSION`" $@
+}
+
 texi=$(mktemp)
 cat > $texi <<EOF
 \input texinfo
@@ -51,8 +57,7 @@ cat > $texi <<EOF
 @include install.texi
 @bye
 EOF
-makeinfo --plaintext -o INSTALL $texi
-rm $texi
+mkinfo --output INSTALL $texi
 
 cat > $texi <<EOF
 \input texinfo
@@ -61,7 +66,7 @@ cat > $texi <<EOF
 @include news.texi
 @bye
 EOF
-makeinfo --plaintext -o NEWS $texi
+mkinfo --output NEWS $texi
 
 cat > $texi <<EOF
 \input texinfo
@@ -70,10 +75,21 @@ cat > $texi <<EOF
 @include faq.texi
 @bye
 EOF
-makeinfo --plaintext -o FAQ $texi
+mkinfo --output FAQ $texi
 
 find . -name .git -type d | xargs rm -fr
-rm -f *.texi www.do style.css makedist.sh TODO .gitignore
+rm -fr .redo
+rm -f \
+    $texi \
+    *.texi \
+    .gitignore \
+    clean.do \
+    makedist.sh \
+    module-name.do \
+    style.css \
+    TODO \
+    VERSION.do \
+    www.do
 
 find . -type d -exec chmod 755 {} \;
 find . -type f -exec chmod 644 {} \;
@@ -163,3 +179,4 @@ https://lists.cypherpunks.ru/mailman/listinfo/gost
 EOF
 
 mv $tmp/$tarball $tmp/"$tarball".sig $cur/gogost.html/
+rm -fr $tmp
diff --git a/www.do b/www.do
index b2142c9d5b8956f4785681007612ba4632a43fa5..174c93338344c632c9de5b5e695625d54c9dc462 100644 (file)
--- a/www.do
+++ b/www.do
@@ -1,10 +1,11 @@
+redo-ifchange *.texi VERSION
 html=gogost.html
 rm -f $html/*.html
 ${MAKEINFO:-makeinfo} --html \
+    -D "VERSION `cat VERSION`" \
     --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=\" \