]> Cypherpunks.ru repositories - goredo.git/blob - makedist.sh
BLAKE3 instead of BLAKE2b
[goredo.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/goredo-$release
9 cd $tmp/goredo-$release
10 git checkout v$release
11
12 redo-ifchange module-name VERSION
13 mod_name=`cat module-name`
14
15 ########################################################################
16 cd doc
17 cat > download.texi <<EOF
18 You can obtain releases source code prepared tarballs on
19 @url{http://www.goredo.cypherpunks.ru/}.
20 EOF
21
22 mkinfo() {
23     ${MAKEINFO:-makeinfo} --plaintext \
24         --set-customization-variable CLOSE_QUOTE_SYMBOL=\" \
25         --set-customization-variable OPEN_QUOTE_SYMBOL=\" \
26         -D "VERSION `cat ../VERSION`" $@
27 }
28
29 texi=$(mktemp)
30
31 cat > $texi <<EOF
32 \input texinfo
33 @documentencoding UTF-8
34 @settitle NEWS
35 @node News
36 @unnumbered News
37 `sed -n '3,$p' < news.texi`
38 @bye
39 EOF
40 mkinfo --output NEWS $texi
41
42 cat > $texi <<EOF
43 \input texinfo
44 @documentencoding UTF-8
45 @settitle INSTALL
46 @include install.texi
47 @bye
48 EOF
49 perl -i -p -e "s/.verbatiminclude .*PUBKEY.asc/Look in PUBKEY.asc file./" install.texi
50 mkinfo --output INSTALL $texi
51
52 rm $texi
53 redo goredo.info
54 mv goredo.info NEWS INSTALL ..
55 cd ..
56
57 ########################################################################
58
59 mkdir -p src/$mod_name
60 mv *.go go.* src/$mod_name
61
62 mods="
63 go.cypherpunks.ru/recfile
64 go.cypherpunks.ru/tai64n
65 golang.org/x/sys
66 golang.org/x/term
67 lukechampine.com/blake3
68 "
69
70 for mod in $mods; do
71     mod_path=$(sed -n "s# // indirect## ; s#^   \($mod\) \(.*\)\$#\1@\2#p" src/$mod_name/go.mod)
72     [ -n "$mod_path" ]
73     mkdir -p src/$mod
74     ( cd $GOPATH/pkg/mod/$mod_path ; tar cf - --exclude ".git*" * ) | tar xfC - src/$mod
75     chmod -R +w src/$mod
76 done
77
78 for mod in github.com/klauspost/cpuid; do
79     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)
80     [ -n "$mod_path" ]
81     mkdir -p src/$mod
82     ( cd $GOPATH/pkg/mod/$mod_path ; tar cf - --exclude ".git*" * ) | tar xfC - src/$mod
83     chmod -R +w src/$mod
84 done
85
86 cat > $tmp/includes <<EOF
87 golang.org/x/sys/AUTHORS
88 golang.org/x/sys/CONTRIBUTORS
89 golang.org/x/sys/go.mod
90 golang.org/x/sys/internal/unsafeheader
91 golang.org/x/sys/LICENSE
92 golang.org/x/sys/PATENTS
93 golang.org/x/sys/README.md
94 golang.org/x/sys/unix
95 golang.org/x/term
96 EOF
97 tar cfCI - src $tmp/includes | tar xfC - $tmp
98 rm -fr src/golang.org $tmp/includes
99 mv $tmp/golang.org src
100
101 rm -r src/golang.org/x/sys/unix/linux
102 rm -r src/github.com/klauspost/cpuid/private src/github.com/klauspost/cpuid/testdata
103
104 ########################################################################
105
106 rm -rf *.texi .redo .git .gitignore doc makedist.sh module-name* VERSION.do
107 find . -type d -exec chmod 755 {} \;
108 find . -type f -exec chmod 644 {} \;
109
110 cd ..
111 tar cvf goredo-"$release".tar --uid=0 --gid=0 --numeric-owner goredo-"$release"
112 zstd -19 -v goredo-"$release".tar
113 gpg --detach-sign --sign --local-user 3A528DDE952C7E93 goredo-"$release".tar.zst
114
115 tarball=goredo-"$release".tar.zst
116 size=$(( $(stat -f %z $tarball) / 1024 ))
117 hash=$(gpg --print-md SHA256 < $tarball)
118 release_date=$(date "+%Y-%m-%d")
119
120 cat <<EOF
121 An entry for documentation:
122 @item @ref{Release $release, $release} @tab $release_date @tab $size KiB
123 @tab @url{download/goredo-${release}.tar.zst, link} @url{download/goredo-${release}.tar.zst.sig, sign}
124 @tab @code{$hash}
125 EOF
126
127 mv $tmp/$tarball $tmp/"$tarball".sig $cur/doc/goredo.html/download
128
129 cat <<EOF
130 Subject: goredo $release release announcement
131
132 I am pleased to announce goredo $release release availability!
133
134 goredo is redo implementation on pure Go.
135
136 ------------------------ >8 ------------------------
137
138 The main improvements for that release are:
139
140
141 ------------------------ >8 ------------------------
142
143 goredo's home page is: http://www.goredo.cypherpunks.ru/
144
145 Source code and its signature for that version can be found here:
146
147     http://www.goredo.cypherpunks.ru/download/goredo-${release}.tar.zst ($size KiB)
148     http://www.goredo.cypherpunks.ru/download/goredo-${release}.tar.zst.sig
149
150 SHA256 hash: $hash
151 GPG key ID: 0x3A528DDE952C7E93 goredo releases <goredo@cypherpunks.ru>
152 Fingerprint: 7531 BB84 FAF0 BF35 960C  63B9 3A52 8DDE 952C 7E93
153
154 Please send questions regarding the use of goredo, bug reports and patches
155 to mailing list: https://lists.cypherpunks.ru/pipermail/goredo-devel/
156 EOF