]> Cypherpunks.ru repositories - goredo.git/blob - makedist.sh
Use an updated recfile
[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 cat > $texi <<EOF
53 \input texinfo
54 @documentencoding UTF-8
55 @settitle THANKS
56 `cat thanks.texi`
57 @bye
58 EOF
59 mkinfo --output THANKS $texi
60
61 rm $texi
62 redo goredo.info
63 mv goredo.info INSTALL NEWS THANKS ..
64 cd ..
65
66 ########################################################################
67
68 mkdir -p src/$mod_name
69 mv *.go go.* src/$mod_name
70
71 mods="
72 go.cypherpunks.ru/recfile
73 go.cypherpunks.ru/tai64n
74 golang.org/x/sys
75 golang.org/x/term
76 lukechampine.com/blake3
77 "
78
79 for mod in $mods; do
80     mod_path=$(sed -n "s# // indirect## ; s#^   \($mod\) \(.*\)\$#\1@\2#p" src/$mod_name/go.mod)
81     [ -n "$mod_path" ]
82     mkdir -p src/$mod
83     ( cd $GOPATH/pkg/mod/$mod_path ; tar cf - --exclude ".git*" * ) | tar xfC - src/$mod
84     chmod -R +w src/$mod
85 done
86
87 for mod in github.com/klauspost/cpuid; do
88     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)
89     [ -n "$mod_path" ]
90     mkdir -p src/$mod
91     ( cd $GOPATH/pkg/mod/$mod_path ; tar cf - --exclude ".git*" * ) | tar xfC - src/$mod
92     chmod -R +w src/$mod
93 done
94
95 cat > $tmp/includes <<EOF
96 golang.org/x/sys/AUTHORS
97 golang.org/x/sys/CONTRIBUTORS
98 golang.org/x/sys/go.mod
99 golang.org/x/sys/internal/unsafeheader
100 golang.org/x/sys/LICENSE
101 golang.org/x/sys/PATENTS
102 golang.org/x/sys/README.md
103 golang.org/x/sys/unix
104 golang.org/x/term
105 EOF
106 tar cfCI - src $tmp/includes | tar xfC - $tmp
107 rm -fr src/golang.org $tmp/includes
108 mv $tmp/golang.org src
109
110 rm -r src/golang.org/x/sys/unix/linux
111 rm -r src/github.com/klauspost/cpuid/private src/github.com/klauspost/cpuid/testdata
112
113 ########################################################################
114
115 rm -rf *.texi .redo .git .gitignore doc makedist.sh module-name* VERSION.do
116 find . -type d -exec chmod 755 {} \;
117 find . -type f -exec chmod 644 {} \;
118
119 cd ..
120 tar cvf goredo-"$release".tar --uid=0 --gid=0 --numeric-owner goredo-"$release"
121 zstd -19 -v goredo-"$release".tar
122 gpg --detach-sign --sign --local-user 3A528DDE952C7E93 goredo-"$release".tar.zst
123
124 tarball=goredo-"$release".tar.zst
125 size=$(( $(stat -f %z $tarball) / 1024 ))
126 hash=$(gpg --print-md SHA256 < $tarball)
127 release_date=$(date "+%Y-%m-%d")
128
129 cat <<EOF
130 An entry for documentation:
131 @item @ref{Release $release, $release} @tab $release_date @tab $size KiB
132 @tab @url{download/goredo-${release}.tar.zst, link} @url{download/goredo-${release}.tar.zst.sig, sign}
133 @tab @code{$hash}
134 EOF
135
136 mv $tmp/$tarball $tmp/"$tarball".sig $cur/doc/goredo.html/download
137
138 cat <<EOF
139 Subject: goredo $release release announcement
140
141 I am pleased to announce goredo $release release availability!
142
143 goredo is redo implementation on pure Go.
144
145 ------------------------ >8 ------------------------
146
147 The main improvements for that release are:
148
149
150 ------------------------ >8 ------------------------
151
152 goredo's home page is: http://www.goredo.cypherpunks.ru/
153
154 Source code and its signature for that version can be found here:
155
156     http://www.goredo.cypherpunks.ru/download/goredo-${release}.tar.zst ($size KiB)
157     http://www.goredo.cypherpunks.ru/download/goredo-${release}.tar.zst.sig
158
159 SHA256 hash: $hash
160 GPG key ID: 0x3A528DDE952C7E93 goredo releases <goredo@cypherpunks.ru>
161 Fingerprint: 7531 BB84 FAF0 BF35 960C  63B9 3A52 8DDE 952C 7E93
162
163 Please send questions regarding the use of goredo, bug reports and patches
164 to mailing list: https://lists.cypherpunks.ru/pipermail/goredo-devel/
165 EOF