]> Cypherpunks.ru repositories - goredo.git/blobdiff - makedist.sh
Texinfo-ed documentation and tarballs preparation
[goredo.git] / makedist.sh
diff --git a/makedist.sh b/makedist.sh
new file mode 100755 (executable)
index 0000000..b2a1d0f
--- /dev/null
@@ -0,0 +1,151 @@
+#!/bin/sh -ex
+
+cur=$(pwd)
+tmp=$(mktemp -d)
+release=$1
+[ -n "$release" ]
+
+git clone . $tmp/goredo-$release
+cd $tmp/goredo-$release
+git checkout v$release
+
+redo-ifchange module-name VERSION
+mod_name=`cat module-name`
+
+########################################################################
+cat > download.texi <<EOF
+You can obtain releases source code prepared tarballs on
+@url{http://www.goredo.cypherpunks.ru/}.
+EOF
+redo goredo.info
+
+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
+@documentencoding UTF-8
+@settitle NEWS
+@node News
+@unnumbered News
+`sed -n '3,$p' < news.texi`
+@bye
+EOF
+mkinfo --output NEWS $texi
+
+cat > $texi <<EOF
+\input texinfo
+@documentencoding UTF-8
+@settitle INSTALL
+@include install.texi
+@bye
+EOF
+perl -i -p -e "s/.verbatiminclude PUBKEY.asc/Look in PUBKEY.asc file./" install.texi
+mkinfo --output INSTALL $texi
+
+rm $texi
+
+########################################################################
+
+mkdir -p src/$mod_name
+mv *.go go.* src/$mod_name
+
+mods="
+go.cypherpunks.ru/recfile
+go.cypherpunks.ru/tai64n
+golang.org/x/crypto
+golang.org/x/sys
+golang.org/x/term
+"
+
+for mod in $mods; do
+    mod_path=$(sed -n "s# // indirect## ; s#^  \($mod\) \(.*\)\$#\1@\2#p" src/$mod_name/go.mod)
+    [ -n "$mod_path" ]
+    mkdir -p src/$mod
+    ( cd $GOPATH/pkg/mod/$mod_path ; tar cf - --exclude ".git*" * ) | tar xfC - src/$mod
+    chmod -R +w src/$mod
+done
+
+cat > $tmp/includes <<EOF
+golang.org/x/crypto/AUTHORS
+golang.org/x/crypto/blake2b
+golang.org/x/crypto/CONTRIBUTORS
+golang.org/x/crypto/go.mod
+golang.org/x/crypto/go.sum
+golang.org/x/crypto/LICENSE
+golang.org/x/crypto/PATENTS
+golang.org/x/crypto/README.md
+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
+golang.org/x/sys/unix
+golang.org/x/term
+EOF
+tar cfCI - src $tmp/includes | tar xfC - $tmp
+rm -fr src/golang.org $tmp/includes
+mv $tmp/golang.org src
+
+########################################################################
+
+rm -rf *.texi .redo .git .gitignore makedist.sh goredo.info.do module-name* VERSION.do
+find . -type d -exec chmod 755 {} \;
+find . -type f -exec chmod 644 {} \;
+
+cd ..
+tar cvf goredo-"$release".tar --uid=0 --gid=0 --numeric-owner goredo-"$release"
+zstd -19 -v goredo-"$release".tar
+gpg --detach-sign --sign --local-user 3A528DDE952C7E93 goredo-"$release".tar.zst
+
+tarball=goredo-"$release".tar.zst
+size=$(( $(stat -f %z $tarball) / 1024 ))
+hash=$(gpg --print-md SHA256 < $tarball)
+release_date=$(date "+%Y-%m-%d")
+
+cat <<EOF
+An entry for documentation:
+@item @ref{Release $release, $release} @tab $release_date @tab $size KiB
+@tab @url{goredo-${release}.tar.zst, link} @url{goredo-${release}.tar.zst.sig, sign}
+@tab @code{$hash}
+EOF
+
+mv $tmp/$tarball $tmp/"$tarball".sig $cur/goredo.html/download
+
+cat <<EOF
+Subject: goredo $release release announcement
+
+I am pleased to announce goredo $release release availability!
+
+goredo is redo implementation on pure Go.
+
+------------------------ >8 ------------------------
+
+The main improvements for that release are:
+
+
+------------------------ >8 ------------------------
+
+goredo's home page is: http://www.goredo.cypherpunks.ru/
+
+Source code and its signature for that version can be found here:
+
+    http://www.goredo.cypherpunks.ru/download/goredo-${release}.tar.zst ($size KiB)
+    http://www.goredo.cypherpunks.ru/download/goredo-${release}.tar.zst.sig
+
+SHA256 hash: $hash
+GPG key ID: 0x3A528DDE952C7E93 goredo releases <goredo@cypherpunks.ru>
+Fingerprint: 7531 BB84 FAF0 BF35 960C  63B9 3A52 8DDE 952C 7E93
+
+Please send questions regarding the use of goredo, bug reports and patches
+to mailing list: https://lists.cypherpunks.ru/pipermail/goredo-devel/
+EOF