]> Cypherpunks.ru repositories - goredo.git/blob - makedist.sh
Ability to rely on mtime, instead of ctime
[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 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 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
69 mv *.go go.* src
70 cd src
71 go mod vendor
72 modvendor -v -copy="**/*_test.go **/private-gen.go **/main.go **/vectors.json **/gen.go"
73 rm -rf vendor/golang.org/x/sys/plan9 vendor/golang.org/x/sys/windows
74 find vendor/golang.org/x/sys -name "*_test.go" -delete
75 find . \( -name .gitignore -o -name .travis.yml \) -delete
76 cd ..
77
78 ########################################################################
79
80 rm -rf *.texi .redo .git .gitignore doc makedist.sh VERSION.do
81 find . -type d -exec chmod 755 {} +
82 find . -type f -exec chmod 644 {} +
83 find t/redo-sh.tests -name test -exec chmod +x {} +
84 find t -name wrapper.rc -exec chmod +x {} +
85 chmod +x t/apenwarr/sleep t/goredo-*.t
86
87 cd ..
88 tar cvf goredo-"$release".tar --uid=0 --gid=0 --numeric-owner goredo-"$release"
89 zstd -19 -v goredo-"$release".tar
90 tarball=goredo-"$release".tar.zst
91 gpg --detach-sign --sign --local-user 3A528DDE952C7E93 "$tarball"
92 gpg --enarmor < "$tarball".sig |
93     sed "/^Comment:/d ; s/ARMORED FILE/SIGNATURE/" > "$tarball".asc
94 meta4-create -file "$tarball" -mtime "$tarball" -sig "$tarball".asc \
95     http://www.goredo.cypherpunks.ru/download/"$tarball" > "$tarball".meta4
96
97 size=$(( $(stat -f %z $tarball) / 1024 ))
98 hash=$(gpg --print-md SHA256 < $tarball)
99 release_date=$(date "+%Y-%m-%d")
100
101 release_underscored=`echo $release | tr . _`
102 cat <<EOF
103 An entry for documentation:
104 @item @ref{Release $release_underscored, $release} @tab $release_date @tab $size KiB
105 @tab
106     @url{download/$tarball.meta4, meta4}
107     @url{download/$tarball, link}
108     @url{download/$tarball.sig, sig}
109 @tab @code{$hash}
110 EOF
111
112 mv $tmp/$tarball $tmp/"$tarball".sig $tarball.meta4 $cur/doc/goredo.html/download
113
114 cat <<EOF
115 Subject: goredo $release release announcement
116
117 I am pleased to announce goredo $release release availability!
118
119 goredo is Go implementation of djb's redo,
120 Makefile replacement that sucks less.
121
122 ------------------------ >8 ------------------------
123
124 The main improvements for that release are:
125
126
127 ------------------------ >8 ------------------------
128
129 goredo's home page is: http://www.goredo.cypherpunks.ru/
130
131 Source code and its signature for that version can be found here:
132
133     http://www.goredo.cypherpunks.ru/download/goredo-${release}.tar.zst ($size KiB)
134     http://www.goredo.cypherpunks.ru/download/goredo-${release}.tar.zst.sig
135
136 SHA256 hash: $hash
137 GPG key ID: 0x3A528DDE952C7E93 goredo releases <goredo@cypherpunks.ru>
138 Fingerprint: 7531 BB84 FAF0 BF35 960C  63B9 3A52 8DDE 952C 7E93
139
140 Please send questions regarding the use of goredo, bug reports and patches
141 to mailing list: http://lists.cypherpunks.ru/goredo_002ddevel.html
142 EOF
143
144 echo mutt -s \"goredo $release release announcement\" \
145     goredo-devel@lists.cypherpunks.ru \
146     -a $cur/doc/goredo.html/download/"$tarball".meta4