]> Cypherpunks.ru repositories - gocheese.git/blobdiff - makedist.sh
Download link for 3.0.0 release
[gocheese.git] / makedist.sh
index b9e3d271f464a4a6fccd1a4216f8f9734f973045..999b9a4614713b90f65a767053edbf52c8796a2c 100755 (executable)
@@ -4,73 +4,30 @@ cur=$(pwd)
 tmp=$(mktemp -d)
 release=$1
 [ -n "$release" ]
-MAKEINFO=${MAKEINFO:=makeinfo}
 
 git clone . $tmp/gocheese-$release
 cd $tmp/gocheese-$release
 git checkout v$release
 
-redo-ifchange module-name
-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
-mv *.go go.mod go.sum src/$mod_name
+redo-ifchange VERSION
 
-mods="
-golang.org/x/crypto
-golang.org/x/net
-"
-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
+go mod vendor
 
-for mod in golang.org/x/sys; do
-    mod_path=$(sed -n "s#^\($mod\) \(.*\) h1:.*\$#\1@\2#p" src/$mod_name/go.sum | sed /go.mod/d | sort -n -r | sed -n 1p)
-    [ -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/argon2
-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/net/AUTHORS
-golang.org/x/net/CONTRIBUTORS
-golang.org/x/net/go.mod
-golang.org/x/net/go.sum
-golang.org/x/net/LICENSE
-golang.org/x/net/netutil
-golang.org/x/net/PATENTS
-golang.org/x/net/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/LICENSE
-golang.org/x/sys/PATENTS
-golang.org/x/sys/README.md
-EOF
-tar cfCI - src $tmp/includes | tar xfC - $tmp
-rm -fr src/golang.org $tmp/includes
-mv $tmp/golang.org src
-
-cat > download.texi <<EOF
+cat > doc/download.texi <<EOF
 You can obtain releases source code prepared tarballs on
 @url{http://www.gocheese.cypherpunks.ru/}.
 EOF
-redo gocheese.info
+redo doc/gocheese.info
+
+cd doc
+mkinfo() {
+    ${MAKEINFO:=makeinfo} --plaintext \
+        --set-customization-variable SECTION_NAME_IN_TITLE=1 \
+        --set-customization-variable TREE_TRANSFORMATIONS=complete_tree_nodes_menus \
+        --set-customization-variable CLOSE_QUOTE_SYMBOL=\" \
+        --set-customization-variable OPEN_QUOTE_SYMBOL=\" \
+        -D "VERSION `cat ../VERSION`" $@
+}
 
 texi=$(mktemp)
 cat > $texi <<EOF
@@ -80,24 +37,27 @@ cat > $texi <<EOF
 @include install.texi
 @bye
 EOF
-perl -i -p -e "s/.verbatiminclude PUBKEY.asc/Look in PUBKEY.asc file./" install.texi
-$MAKEINFO --plaintext -o INSTALL $texi
+perl -i -p -e "s/.verbatiminclude ...PUBKEY.asc/Look in PUBKEY.asc file./" install.texi
+mkinfo --output ../INSTALL $texi
 rm $texi
+cd ..
 
-rm -rf .redo .git .gitignore style.css makedist.sh www.do module-name.do
-echo 'GOPATH=`pwd` ${GO:=go} build -o $3 -ldflags "-X main.Version=`cat VERSION`" `cat module-name`' > gocheese.do
-echo 'GOPATH=`pwd` ${GO:=go} test `cat module-name`/... >&2' > test.do
+rm -rf .git .gitignore doc/.gitignore doc/style.css makedist.sh doc/www.do VERSION.do
+redo-cleanup full
+perl -i -npe "s/go} build/go} build -mod=vendor/" gocheese.do
+perl -i -npe "s/go} test/go} test -mod=vendor/" test.do
+cp ~/work/redo/minimal/do contrib/do
 
-find . -type d -exec chmod 755 {} \;
-find . -type f -exec chmod 644 {} \;
-chmod +x pyshop2packages.sh
+find . -type d -exec chmod 755 {} +
+find . -type f -exec chmod 644 {} +
+chmod +x contrib/pyshop2packages.sh contrib/do
 
 cd ..
 tar cvf gocheese-"$release".tar --uid=0 --gid=0 --numeric-owner gocheese-"$release"
-xz -9 gocheese-"$release".tar
-gpg --detach-sign --sign --local-user CD5CD01F55343D88 gocheese-"$release".tar.xz
+zstd -19 -v gocheese-"$release".tar
+gpg --detach-sign --sign --local-user CD5CD01F55343D88 gocheese-"$release".tar.zst
 
-tarball=gocheese-"$release".tar.xz
+tarball=gocheese-"$release".tar.zst
 size=$(( $(stat -f %z $tarball) / 1024 ))
 hash=$(gpg --print-md SHA256 < $tarball)
 release_date=$(date "+%Y-%m-%d")
@@ -105,8 +65,9 @@ release_date=$(date "+%Y-%m-%d")
 cat <<EOF
 An entry for documentation:
 @item $release @tab $release_date @tab $size KiB
-@tab @url{gocheese-${release}.tar.xz, link} @url{gocheese-${release}.tar.xz.sig, sign}
+@tab @url{download/gocheese-${release}.tar.zst, link}
+     @url{download/gocheese-${release}.tar.zst.sig, sign}
 @tab @code{$hash}
 EOF
 
-mv $tmp/$tarball $tmp/"$tarball".sig $cur/gocheese.html/
+mv $tmp/$tarball $tmp/"$tarball".sig $cur/doc/gocheese.html/download