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