]> Cypherpunks.ru repositories - gocheese.git/blob - makedist.sh
Use Texinfo 7.0 features
[gocheese.git] / makedist.sh
1 #!/bin/sh -ex
2
3 cur=$(pwd)
4 tmp=$(mktemp -d)
5 release=$1
6 [ -n "$release" ]
7
8 git clone . $tmp/gocheese-$release
9 cd $tmp/gocheese-$release
10 git checkout v$release
11
12 redo-ifchange VERSION
13
14 go mod vendor
15
16 cat > doc/download.texi <<EOF
17 You can obtain releases source code prepared tarballs on
18 @url{http://www.gocheese.cypherpunks.ru/}.
19 EOF
20 redo doc/gocheese.info
21
22 cd doc
23 mkinfo() {
24     ${MAKEINFO:=makeinfo} --plaintext \
25         --set-customization-variable SECTION_NAME_IN_TITLE=1 \
26         --set-customization-variable TREE_TRANSFORMATIONS=complete_tree_nodes_menus \
27         --set-customization-variable ASCII_PUNCTUATION=1 \
28         -D "VERSION `cat ../VERSION`" $@
29 }
30
31 texi=$(mktemp)
32 cat > $texi <<EOF
33 \input texinfo
34 @documentencoding UTF-8
35 @settitle INSTALL
36 @include install.texi
37 @bye
38 EOF
39 perl -i -p -e "s/.verbatiminclude ...PUBKEY.asc/Look in PUBKEY.asc file./" install.texi
40 mkinfo --output ../INSTALL $texi
41 rm $texi
42 cd ..
43
44 rm -rf .git .gitignore doc/.gitignore doc/style.css makedist.sh doc/www.do VERSION.do
45 redo-cleanup full
46 perl -i -npe "s/go} build/go} build -mod=vendor/" gocheese.do
47 perl -i -npe "s/go} test/go} test -mod=vendor/" test.do
48 cp ~/work/redo/apenwarr/minimal/do contrib/do
49
50 find . -type d -exec chmod 755 {} +
51 find . -type f -exec chmod 644 {} +
52 chmod +x contrib/pyshop2packages.sh contrib/do
53
54 cd ..
55 tar cvf gocheese-"$release".tar --uid=0 --gid=0 --numeric-owner gocheese-"$release"
56 zstd -19 -v gocheese-"$release".tar
57 tarball=gocheese-"$release".tar.zst
58 gpg --detach-sign --sign --local-user CD5CD01F55343D88 $tarball
59 gpg --enarmor < "$tarball".sig |
60     sed "/^Comment:/d ; s/ARMORED FILE/SIGNATURE/" > "$tarball".asc
61 meta4-create -file "$tarball" -mtime "$tarball" -sig "$tarball".asc \
62     http://www.gocheese.cypherpunks.ru/download/"$tarball" \
63     http://y.www.gocheese.cypherpunks.ru/download/"$tarball" > "$tarball".meta4
64
65 size=$(( $(stat -f %z $tarball) / 1024 ))
66 hash=$(gpg --print-md SHA256 < $tarball)
67 release_date=$(date "+%Y-%m-%d")
68
69 cat <<EOF
70 An entry for documentation:
71 @item $release @tab $release_date @tab $size KiB
72 @tab
73     @url{download/gocheese-${release}.tar.zst.meta4, meta4}
74     @url{download/gocheese-${release}.tar.zst, link}
75     @url{download/gocheese-${release}.tar.zst.sig, sig}
76 @tab @code{$hash}
77 EOF
78
79 mv $tmp/$tarball $tmp/"$tarball".sig $tmp/"$tarball".meta4 $cur/doc/gocheese.html/download