]> Cypherpunks.ru repositories - goredo.git/blob - makedist
Unnecessary .sh extension
[goredo.git] / makedist
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 go generate
12
13 redo-ifchange VERSION
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 ASCII_PUNCTUATION=1 \
25         -D "VERSION `cat ../VERSION`" $@
26 }
27
28 texi=$(mktemp)
29
30 cat > $texi <<EOF
31 \input texinfo
32 @documentencoding UTF-8
33 @settitle NEWS
34 @node News
35 `sed -n '3,$p' < news.texi`
36 @bye
37 EOF
38 mkinfo --output NEWS $texi
39
40 cat > $texi <<EOF
41 \input texinfo
42 @documentencoding UTF-8
43 @settitle INSTALL
44 @include install.texi
45 @bye
46 EOF
47 perl -i -p -e "s/.verbatiminclude .*PUBKEY.asc/Look in PUBKEY.asc file./" install.texi
48 mkinfo --output INSTALL $texi
49
50 cat > $texi <<EOF
51 \input texinfo
52 @documentencoding UTF-8
53 @settitle THANKS
54 `cat thanks.texi`
55 @bye
56 EOF
57 mkinfo --output THANKS $texi
58
59 rm $texi
60 redo goredo.info
61 mv goredo.info INSTALL NEWS THANKS ..
62 cd ..
63
64 ########################################################################
65
66 mkdir -p src
67 mv *.go go.* src
68 cd src
69 go mod vendor
70 modvendor -v -copy="**/*_test.go **/private-gen.go **/main.go **/vectors.json **/gen.go"
71 rm -rf vendor/golang.org/x/sys/plan9 vendor/golang.org/x/sys/windows
72 find vendor/golang.org/x/sys -name "*_test.go" -delete
73 find . \( -name .gitignore -o -name .travis.yml \) -delete
74 cd ..
75
76 ########################################################################
77
78 rm -rf *.texi .redo .git .gitignore doc makedist VERSION.do
79 find . -type d -exec chmod 755 {} +
80 find . -type f -exec chmod 644 {} +
81 find t/redo-sh.tests -name test -exec chmod +x {} +
82 find t -name wrapper.rc -exec chmod +x {} +
83 chmod +x t/apenwarr/sleep t/goredo-*.t
84
85 cd ..
86 tar cvf goredo-"$release".tar --uid=0 --gid=0 --numeric-owner goredo-"$release"
87 zstd -19 -v goredo-"$release".tar
88 tarball=goredo-"$release".tar.zst
89 gpg --detach-sign --sign --local-user 3A528DDE952C7E93 "$tarball"
90 gpg --enarmor < "$tarball".sig |
91     sed "/^Comment:/d ; s/ARMORED FILE/SIGNATURE/" > "$tarball".asc
92 meta4-create -file "$tarball" -mtime "$tarball" -sig "$tarball".asc \
93     http://www.goredo.cypherpunks.ru/download/"$tarball" \
94     http://y.www.goredo.cypherpunks.ru/download/"$tarball" > "$tarball".meta4
95
96 size=$(( $(stat -f %z $tarball) / 1024 ))
97 hash=$(gpg --print-md SHA256 < $tarball)
98 release_date=$(date "+%Y-%m-%d")
99
100 release_underscored=`echo $release | tr . _`
101 cat <<EOF
102 An entry for documentation:
103 @item @ref{Release $release_underscored, $release} @tab $release_date @tab $size KiB
104 @tab
105     @url{download/$tarball.meta4, meta4}
106     @url{download/$tarball, link}
107     @url{download/$tarball.sig, sig}
108 @tab @code{$hash}
109 EOF
110
111 mv $tmp/$tarball $tmp/"$tarball".sig $tarball.meta4 $cur/doc/goredo.html/download
112
113 cat <<EOF
114 Subject: goredo $release release announcement
115
116 I am pleased to announce goredo $release release availability!
117
118 goredo is Go implementation of djb's redo,
119 Makefile replacement that sucks less.
120
121 ------------------------ >8 ------------------------
122
123 The main improvements for that release are:
124
125
126 ------------------------ >8 ------------------------
127
128 goredo's home page is: http://www.goredo.cypherpunks.ru/
129
130 Source code and its signature for that version can be found here:
131
132     http://www.goredo.cypherpunks.ru/download/goredo-${release}.tar.zst ($size KiB)
133     http://www.goredo.cypherpunks.ru/download/goredo-${release}.tar.zst.sig
134
135 SHA256 hash: $hash
136 GPG key ID: 0x3A528DDE952C7E93 goredo releases <goredo@cypherpunks.ru>
137 Fingerprint: 7531 BB84 FAF0 BF35 960C  63B9 3A52 8DDE 952C 7E93
138
139 Please send questions regarding the use of goredo, bug reports and patches
140 to mailing list: http://lists.cypherpunks.ru/goredo_002ddevel.html
141 EOF
142
143 echo mutt -s \"goredo $release release announcement\" \
144     goredo-devel@lists.cypherpunks.ru \
145     -a $cur/doc/goredo.html/download/"$tarball".meta4