]> Cypherpunks.ru repositories - nncp.git/blob - makedist.sh
Merge branch 'develop'
[nncp.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/nncp-$release
9 cd $tmp/nncp-$release
10 git checkout v$release
11 redo VERSION
12 cd src
13 go mod vendor
14 modvendor -v -copy="**/*_test.go **/words.go **/README.md **/main.go"
15 cd vendor
16 rm -r \
17     github.com/flynn/noise/vector* \
18     github.com/gorhill/cronexpr/APLv2 \
19     github.com/hjson/hjson-go/build_release.sh \
20     github.com/klauspost/compress/gen.sh \
21     github.com/klauspost/compress/gzhttp \
22     github.com/klauspost/compress/internal/snapref \
23     github.com/klauspost/compress/s2* \
24     github.com/klauspost/compress/snappy \
25     github.com/klauspost/compress/zstd/snappy.go \
26     golang.org/x/sys/plan9 \
27     golang.org/x/sys/windows
28 find github.com/klauspost/compress golang.org/x/sys -name "*_test.go" -delete
29 find . -type d -exec rmdir {} + 2>/dev/null || :
30 cd ../..
31 rm -r ports
32 find . \( \
33     -name .gitignore -o \
34     -name .travis.yml -o \
35     -name .goreleaser.yml -o \
36     -name .gitattributes \) -delete
37
38 mkdir contrib
39 cp ~/work/redo/apenwarr/minimal/do contrib/do
40
41 cat > doc/download.texi <<EOF
42 @node Tarballs
43 @section Prepared tarballs
44 You can obtain releases source code prepared tarballs from
45 @url{http://www.nncpgo.org/} and from one of its
46 @url{http://www.nncpgo.org/Mirrors.html, mirrors}.
47 EOF
48 perl -i -ne 'print unless /include pedro/' doc/index.texi doc/about.ru.texi
49 perl -p -i -e 's/^(.verbatiminclude) .*$/$1 PUBKEY.asc/g' doc/integrity.texi
50 mv doc/.well-known/openpgpkey/nncpgo.org/hu/i4cdqgcarfjdjnba6y4jnf498asg8c6p.asc PUBKEY.asc
51 ln -s ../PUBKEY.asc doc
52 redo doc/all
53
54 ########################################################################
55 # Supplementary files autogeneration
56 ########################################################################
57 texi=$(TMPDIR=doc mktemp)
58
59 mkinfo() {
60     ${MAKEINFO:-makeinfo} --plaintext \
61         --set-customization-variable CLOSE_QUOTE_SYMBOL=\" \
62         --set-customization-variable OPEN_QUOTE_SYMBOL=\" \
63         -D "VERSION `cat VERSION`" $@
64 }
65
66 cat > $texi <<EOF
67 \input texinfo
68 @documentencoding UTF-8
69 @settitle NEWS
70 @node News
71 @unnumbered News
72 `sed -n '6,$p' < doc/news.texi`
73 @bye
74 EOF
75 mkinfo --output NEWS $texi
76
77 cat > $texi <<EOF
78 \input texinfo
79 @documentencoding UTF-8
80 @settitle NEWS.RU
81 @node Новости
82 @unnumbered Новости
83 `sed -n '3,$p' < doc/news.ru.texi | sed 's/^@subsection/@section/'`
84 @bye
85 EOF
86 mkinfo --output NEWS.RU $texi
87
88 cat > $texi <<EOF
89 \input texinfo
90 @documentencoding UTF-8
91 @settitle INSTALL
92 @include install.texi
93 @bye
94 EOF
95 mkinfo --output INSTALL $texi
96
97 cat > $texi <<EOF
98 \input texinfo
99 @documentencoding UTF-8
100 @settitle THANKS
101 `cat doc/thanks.texi`
102 @bye
103 EOF
104 mkinfo --output THANKS $texi
105
106 rm -f $texi
107 rm -r doc/.well-known
108
109 ########################################################################
110
111 perl -i -npe "s/GO build/GO build -mod=vendor/" bin/default.do bin/hjson-cli.do
112 perl -i -npe "s/GO list/GO list -mod=vendor/" bin/default.do
113 perl -i -npe "s/GO test/GO test -mod=vendor/" test.do
114 rm makedist.sh VERSION.do
115 rm -r .git
116 redo-cleanup full
117 find . -type d -exec chmod 755 {} +
118 find . -type f -exec chmod 644 {} +
119 find . -type f -name "*.sh" -exec chmod +x {} +
120 chmod +x contrib/do
121
122 cd ..
123 tar cvf nncp-"$release".tar --uid=0 --gid=0 --numeric-owner nncp-"$release"
124 xz -9v nncp-"$release".tar
125 tarball=nncp-"$release".tar.xz
126 gpg --detach-sign --sign --local-user releases@nncpgo.org "$tarball"
127 gpg --enarmor < "$tarball".sig |
128     sed "/^Comment:/d ; s/ARMORED FILE/SIGNATURE/" > "$tarball".asc
129 meta4-create -file "$tarball" -mtime "$tarball" -sig "$tarball".asc \
130     http://www.nncpgo.org/download/"$tarball" \
131     http://y.www.nncpgo.org/download/"$tarball" \
132     https://nncp.mirrors.quux.org/download/"$tarball" > "$tarball".meta4
133
134 size=$(( $(stat -f %z $tarball) / 1024 ))
135 hash=$(gpg --print-md SHA256 < $tarball)
136 release_date=$(date "+%Y-%m-%d")
137
138 mv -v $tmp/"$tarball" $tmp/"$tarball".sig $tmp/"$tarball".meta4 $cur/doc/download
139
140 release_underscored=`echo $release | tr . _`
141 cat <<EOF
142 An entry for documentation:
143 @item @ref{Release $release_underscored, $release} @tab $release_date @tab $size KiB
144 @tab
145     @url{download/nncp-${release}.tar.xz.meta4, meta4}
146     @url{download/nncp-${release}.tar.xz, link}
147     @url{download/nncp-${release}.tar.xz.sig, sig}
148 @tab @code{$hash}
149 EOF
150
151 cd $cur
152
153 cat <<EOF
154 Subject: [EN] NNCP $release release announcement
155
156 I am pleased to announce NNCP $release release availability!
157
158 NNCP (Node to Node copy) is a collection of utilities simplifying
159 secure store-and-forward files and mail exchanging.
160
161 This utilities are intended to help build up small size (dozens of
162 nodes) ad-hoc friend-to-friend (F2F) statically routed darknet
163 delay-tolerant networks for fire-and-forget secure reliable files, file
164 requests, Internet mail and commands transmission. All packets are
165 integrity checked, end-to-end encrypted (E2EE), explicitly authenticated
166 by known participants public keys. Onion encryption is applied to
167 relayed packets. Each node acts both as a client and server, can use
168 push and poll behaviour model. Also there is multicasting areas support.
169
170 Out-of-box offline sneakernet/floppynet, dead drops, sequential and
171 append-only CD-ROM/tape storages, air-gapped computers support. But
172 online TCP daemon with full-duplex resumable data transmission exists.
173
174 ------------------------ >8 ------------------------
175
176 The main improvements for that release are:
177
178 $(git cat-file -p v$release | sed -n '6,/^.*BEGIN/p' | sed '$d')
179
180 ------------------------ >8 ------------------------
181
182 NNCP's home page is: http://www.nncpgo.org/
183
184 Source code and its signature for that version can be found here:
185
186     http://www.nncpgo.org/download/nncp-${release}.tar.xz ($size KiB)
187     http://www.nncpgo.org/download/nncp-${release}.tar.xz.sig
188
189 SHA256 hash: $hash
190 GPG key ID: 0x2B25868E75A1A953 NNCP releases <releases@nncpgo.org>
191 Fingerprint: 92C2 F0AE FE73 208E 46BF  F3DE 2B25 868E 75A1 A953
192
193 There are mirrors where you can also get the source code tarballs:
194 http://www.nncpgo.org/Mirrors.html
195
196 Please send questions regarding the use of NNCP, bug reports and patches
197 to mailing list: http://lists.cypherpunks.ru/nncp_002ddevel.html
198 EOF
199 echo mutt -s \"[EN] NNCP $release release announcement\" \
200     nncp-devel@lists.cypherpunks.ru \
201     -a $cur/doc/download/"$tarball".meta4
202
203 cat <<EOF
204 Subject: [RU] Состоялся релиз NNCP $release
205
206 Я рад сообщить о выходе релиза NNCP $release!
207
208 NNCP (Node to Node copy) это набор утилит упрощающий безопасный обмен
209 файлами и почтой в режиме сохранить-и-переслать.
210
211 Эти утилиты предназначены помочь с построением одноранговых устойчивых к
212 разрывам сетей небольшого размера (дюжины узлов), в режиме друг-к-другу
213 (F2F) со статической маршрутизацией для безопасной надёжной передачи
214 файлов, запросов на передачу файлов, Интернет почты и команд по принципу
215 выстрелил-и-забыл. Все пакеты проверяются на целостность, шифруются по
216 принципу точка-точка (E2EE), аутентифицируются известными публичными
217 ключами участников. Луковичное (onion) шифрование применяется ко всем
218 ретранслируемым пакетам. Каждый узел выступает одновременно в роли
219 клиента и сервера, может использовать как push, так и poll модель
220 поведения. А также есть поддержка мультивещательной рассылки пакетов.
221
222 Поддержка из коробки offline флоппинета, тайников для сброса информации
223 (dead drop), последовательных и только-для-записи CD-ROM/ленточных
224 хранилищ, компьютеров с "воздушным зазором" (air-gap). Но также
225 существует и online TCP демон с полнодуплексной возобновляемой передачей
226 данных.
227
228 ------------------------ >8 ------------------------
229
230 Основные усовершенствования в этом релизе:
231
232 $(git cat-file -p v$release | sed -n '6,/^.*BEGIN/p' | sed '$d')
233
234 ------------------------ >8 ------------------------
235
236 Домашняя страница NNCP: http://www.nncpgo.org/
237 Коротко об утилитах: http://www.nncpgo.org/Ob-utilitakh.html
238
239 Исходный код и его подпись для этой версии находятся здесь:
240
241     http://www.nncpgo.org/download/nncp-${release}.tar.xz ($size KiB)
242     http://www.nncpgo.org/download/nncp-${release}.tar.xz.sig
243
244 SHA256 хэш: $hash
245 Идентификатор GPG ключа: 0x2B25868E75A1A953 NNCP releases <releases@nncpgo.org>
246 Отпечаток: 92C2 F0AE FE73 208E 46BF  F3DE 2B25 868E 75A1 A953
247
248 Есть и зеркала где вы также можете получить архивы с исходным кодом:
249 http://www.nncpgo.org/Mirrors.html
250
251 Пожалуйста, все вопросы касающиеся использования NNCP, отчёты об ошибках
252 и патчи отправляйте в nncp-devel почтовую рассылку:
253 http://lists.cypherpunks.ru/nncp_002ddevel.html
254 EOF
255 echo mutt -s \"[RU] Состоялся релиз NNCP $release\" \
256     nncp-devel@lists.cypherpunks.ru \
257     -a $cur/doc/download/"$tarball".meta4