]> 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 rm -fr .git
12
13 mod_name=go.cypherpunks.ru/nncp/v5
14 mv src src.orig
15 mkdir -p src/$mod_name
16 mv src.orig/* src/$mod_name
17 rmdir src.orig
18
19 mods="
20 github.com/davecgh/go-xdr
21 github.com/dustin/go-humanize
22 github.com/flynn/noise
23 github.com/gorhill/cronexpr
24 github.com/hjson/hjson-go
25 github.com/klauspost/compress
26 go.cypherpunks.ru/balloon
27 golang.org/x/crypto
28 golang.org/x/net
29 golang.org/x/sys
30 "
31 for mod in $mods; do
32     mod_path=$(sed -n "s# // indirect## ; s#^   \($mod\) \(.*\)\$#\1@\2#p" src/$mod_name/go.mod)
33     [ -n "$mod_path" ]
34     mkdir -p src/$mod
35     ( cd $GOPATH/pkg/mod/$mod_path ; tar cf - --exclude ".git*" * ) | tar xfC - src/$mod
36     chmod -R +w src/$mod
37 done
38
39 cat > $tmp/includes <<EOF
40 golang.org/x/crypto/AUTHORS
41 golang.org/x/crypto/blake2b
42 golang.org/x/crypto/blake2s
43 golang.org/x/crypto/chacha20
44 golang.org/x/crypto/chacha20poly1305
45 golang.org/x/crypto/CONTRIBUTORS
46 golang.org/x/crypto/curve25519
47 golang.org/x/crypto/ed25519
48 golang.org/x/crypto/go.mod
49 golang.org/x/crypto/go.sum
50 golang.org/x/crypto/internal/subtle
51 golang.org/x/crypto/LICENSE
52 golang.org/x/crypto/nacl
53 golang.org/x/crypto/PATENTS
54 golang.org/x/crypto/poly1305
55 golang.org/x/crypto/README.md
56 golang.org/x/crypto/salsa20
57 golang.org/x/crypto/ssh/terminal
58 golang.org/x/net/AUTHORS
59 golang.org/x/net/CONTRIBUTORS
60 golang.org/x/net/go.mod
61 golang.org/x/net/go.sum
62 golang.org/x/net/LICENSE
63 golang.org/x/net/netutil
64 golang.org/x/net/PATENTS
65 golang.org/x/net/README.md
66 golang.org/x/sys/AUTHORS
67 golang.org/x/sys/CONTRIBUTORS
68 golang.org/x/sys/cpu
69 golang.org/x/sys/go.mod
70 golang.org/x/sys/LICENSE
71 golang.org/x/sys/PATENTS
72 golang.org/x/sys/README.md
73 golang.org/x/sys/unix
74 EOF
75 tar cfCI - src $tmp/includes | tar xfC - $tmp
76 rm -fr src/golang.org $tmp/includes
77 mv $tmp/golang.org src
78
79 cat > $tmp/includes <<EOF
80 compress/compressible.go
81 compress/fse
82 compress/huff0
83 compress/LICENSE
84 compress/README.md
85 compress/zstd
86 EOF
87 cat > $tmp/excludes <<EOF
88 *testdata*
89 *_test.go
90 snappy.go
91 EOF
92 tar cfCIX - src/github.com/klauspost $tmp/includes $tmp/excludes | tar xfC - $tmp
93 rm -fr src/github.com/klauspost/compress $tmp/includes $tmp/excludes
94 mv $tmp/compress src/github.com/klauspost
95
96 find src -name .travis.yml -delete
97 rm -fr src/github.com/davecgh/go-xdr/xdr
98 rm -r src/github.com/flynn/noise/vector*
99 rm src/github.com/hjson/hjson-go/build_release.sh
100 rm src/github.com/gorhill/cronexpr/APLv2
101 rm -fr ports
102 rm makedist.sh
103
104 cat > doc/download.texi <<EOF
105 @node Tarballs
106 @section Prepared tarballs
107 You can obtain releases source code prepared tarballs on
108 @url{http://www.nncpgo.org/}.
109 EOF
110 perl -i -ne 'print unless /include pedro/' doc/index.texi doc/about.ru.texi
111 make -C doc
112
113 ########################################################################
114 # Supplementary files autogeneration
115 ########################################################################
116 texi=`mktemp`
117
118 cat > $texi <<EOF
119 \input texinfo
120 @documentencoding UTF-8
121 @settitle NEWS
122
123 @node News
124 @unnumbered News
125
126 `sed -n '5,$p' < doc/news.texi`
127
128 @bye
129 EOF
130 makeinfo --plaintext -o NEWS $texi
131
132 cat > $texi <<EOF
133 \input texinfo
134 @documentencoding UTF-8
135 @settitle NEWS.RU
136
137 @node Новости
138 @unnumbered Новости
139
140 `sed -n '3,$p' < doc/news.ru.texi | sed 's/^@subsection/@section/'`
141
142 @bye
143 EOF
144 makeinfo --plaintext -o NEWS.RU $texi
145
146 rm -f $texi
147
148 texi=$(TMPDIR=doc mktemp)
149 cat > $texi <<EOF
150 \input texinfo
151 @documentencoding UTF-8
152 @settitle INSTALL
153
154 @include install.texi
155
156 @bye
157 EOF
158 makeinfo --plaintext -o INSTALL $texi
159 rm -f $texi
160
161 texi=`mktemp`
162
163 cat > $texi <<EOF
164 \input texinfo
165 @documentencoding UTF-8
166 @settitle THANKS
167
168 `cat doc/thanks.texi`
169
170 @bye
171 EOF
172 makeinfo --plaintext -o THANKS $texi
173 rm -f $texi
174
175 ########################################################################
176
177 mv doc/.well-known/openpgpkey/hu/i4cdqgcarfjdjnba6y4jnf498asg8c6p.asc PUBKEY.asc
178 rm -r doc/.gitignore doc/.well-known doc/nncp.html/.well-known
179
180 find . -type d -exec chmod 755 {} \;
181 find . -type f -exec chmod 644 {} \;
182 find . -type f -name "*.sh" -exec chmod 755 {} \;
183
184 cd ..
185 tar cvf nncp-"$release".tar --uid=0 --gid=0 --numeric-owner nncp-"$release"
186 xz -9v nncp-"$release".tar
187 gpg --detach-sign --sign --local-user releases@nncpgo.org nncp-"$release".tar.xz
188 mv -v $tmp/nncp-"$release".tar.xz $tmp/nncp-"$release".tar.xz.sig $cur/doc/nncp.html/download
189
190 tarball=$cur/doc/nncp.html/download/nncp-"$release".tar.xz
191 size=$(( $(stat -f %z $tarball) / 1024 ))
192 hash=$(gpg --print-md SHA256 < $tarball)
193 release_date=$(date "+%Y-%m-%d")
194
195 cat <<EOF
196 An entry for documentation:
197 @item @ref{Release $release, $release} @tab $release_date @tab $size KiB
198 @tab @url{download/nncp-${release}.tar.xz, link} @url{download/nncp-${release}.tar.xz.sig, sign}
199 @tab @code{$hash}
200 EOF
201
202 cd $cur
203
204 cat <<EOF
205 Subject: [EN] NNCP $release release announcement
206
207 I am pleased to announce NNCP $release release availability!
208
209 NNCP (Node to Node copy) is a collection of utilities simplifying
210 secure store-and-forward files and mail exchanging.
211
212 This utilities are intended to help build up small size (dozens of
213 nodes) ad-hoc friend-to-friend (F2F) statically routed darknet
214 delay-tolerant networks for fire-and-forget secure reliable files, file
215 requests, Internet mail and commands transmission. All packets are
216 integrity checked, end-to-end encrypted (E2EE), explicitly authenticated
217 by known participants public keys. Onion encryption is applied to
218 relayed packets. Each node acts both as a client and server, can use
219 push and poll behaviour model.
220
221 Out-of-box offline sneakernet/floppynet, dead drops, sequential and
222 append-only CD-ROM/tape storages, air-gapped computers support. But
223 online TCP daemon with full-duplex resumable data transmission exists.
224
225 ------------------------ >8 ------------------------
226
227 The main improvements for that release are:
228
229 $(git cat-file -p $release | sed -n '6,/^.*BEGIN/p' | sed '$d')
230
231 ------------------------ >8 ------------------------
232
233 NNCP's home page is: http://www.nncpgo.org/
234
235 Source code and its signature for that version can be found here:
236
237     http://www.nncpgo.org/download/nncp-${release}.tar.xz ($size KiB)
238     http://www.nncpgo.org/download/nncp-${release}.tar.xz.sig
239
240 SHA256 hash: $hash
241 GPG key ID: 0x2B25868E75A1A953 NNCP releases <releases@nncpgo.org>
242 Fingerprint: 92C2 F0AE FE73 208E 46BF  F3DE 2B25 868E 75A1 A953
243
244 Please send questions regarding the use of NNCP, bug reports and patches
245 to mailing list: https://lists.cypherpunks.ru/pipermail/nncp-devel/
246 EOF
247
248 cat <<EOF
249 Subject: [RU] Состоялся релиз NNCP $release
250
251 Я рад сообщить о выходе релиза NNCP $release!
252
253 NNCP (Node to Node copy) это набор утилит упрощающий безопасный обмен
254 файлами и почтой в режиме сохранить-и-переслать.
255
256 Эти утилиты предназначены помочь с построением одноранговых устойчивых к
257 разрывам сетей небольшого размера (дюжины узлов), в режиме друг-к-другу
258 (F2F) со статической маршрутизацией для безопасной надёжной передачи
259 файлов, запросов на передачу файлов, Интернет почты и команд по принципу
260 выстрелил-и-забыл. Все пакеты проверяются на целостность, шифруются по
261 принципу точка-точка (E2EE), аутентифицируются известными публичными
262 ключами участников. Луковичное (onion) шифрование применяется ко всем
263 ретранслируемым пакетам. Каждый узел выступает одновременно в роли
264 клиента и сервера, может использовать как push, так и poll модель
265 поведения.
266
267 Поддержка из коробки offline флоппинета, тайников для сброса информации
268 (dead drop), последовательных и только-для-записи CD-ROM/ленточных
269 хранилищ, компьютеров с "воздушным зазором" (air-gap). Но также
270 существует и online TCP демон с полнодуплексной возобновляемой передачей
271 данных.
272
273 ------------------------ >8 ------------------------
274
275 Основные усовершенствования в этом релизе:
276
277 $(git cat-file -p $release | sed -n '6,/^.*BEGIN/p' | sed '$d')
278
279 ------------------------ >8 ------------------------
280
281 Домашняя страница NNCP: http://www.nncpgo.org/
282 Коротко об утилитах: http://www.nncpgo.org/Ob-utilitakh.html
283
284 Исходный код и его подпись для этой версии находятся здесь:
285
286     http://www.nncpgo.org/download/nncp-${release}.tar.xz ($size KiB)
287     http://www.nncpgo.org/download/nncp-${release}.tar.xz.sig
288
289 SHA256 хэш: $hash
290 Идентификатор GPG ключа: 0x2B25868E75A1A953 NNCP releases <releases@nncpgo.org>
291 Отпечаток: 92C2 F0AE FE73 208E 46BF  F3DE 2B25 868E 75A1 A953
292
293 Пожалуйста, все вопросы касающиеся использования NNCP, отчёты об ошибках
294 и патчи отправляйте в nncp-devel почтовую рассылку:
295 https://lists.cypherpunks.ru/pipermail/nncp-devel/
296 EOF