]> Cypherpunks.ru repositories - nncp.git/blob - makedist.sh
Replace zlib with zstd
[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/chacha20poly1305
44 golang.org/x/crypto/CONTRIBUTORS
45 golang.org/x/crypto/curve25519
46 golang.org/x/crypto/ed25519
47 golang.org/x/crypto/go.mod
48 golang.org/x/crypto/go.sum
49 golang.org/x/crypto/internal/chacha20
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 make -C doc
111
112 ########################################################################
113 # Supplementary files autogeneration
114 ########################################################################
115 texi=`mktemp`
116
117 cat > $texi <<EOF
118 \input texinfo
119 @documentencoding UTF-8
120 @settitle NEWS
121
122 @node News
123 @unnumbered News
124
125 `sed -n '5,$p' < doc/news.texi`
126
127 @bye
128 EOF
129 makeinfo --plaintext -o NEWS $texi
130
131 cat > $texi <<EOF
132 \input texinfo
133 @documentencoding UTF-8
134 @settitle NEWS.RU
135
136 @node Новости
137 @unnumbered Новости
138
139 `sed -n '3,$p' < doc/news.ru.texi | sed 's/^@subsection/@section/'`
140
141 @bye
142 EOF
143 makeinfo --plaintext -o NEWS.RU $texi
144
145 rm -f $texi
146
147 texi=$(TMPDIR=doc mktemp)
148 cat > $texi <<EOF
149 \input texinfo
150 @documentencoding UTF-8
151 @settitle INSTALL
152
153 @include install.texi
154
155 @bye
156 EOF
157 makeinfo --plaintext -o INSTALL $texi
158 rm -f $texi
159
160 texi=`mktemp`
161
162 cat > $texi <<EOF
163 \input texinfo
164 @documentencoding UTF-8
165 @settitle THANKS
166
167 `cat doc/thanks.texi`
168
169 @bye
170 EOF
171 makeinfo --plaintext -o THANKS $texi
172 rm -f $texi
173
174 ########################################################################
175
176 mv doc/.well-known/openpgpkey/hu/i4cdqgcarfjdjnba6y4jnf498asg8c6p.asc PUBKEY.asc
177 rm -r doc/.gitignore doc/.well-known doc/nncp.html/.well-known
178
179 find . -type d -exec chmod 755 {} \;
180 find . -type f -exec chmod 644 {} \;
181 find . -type f -name "*.sh" -exec chmod 755 {} \;
182
183 cd ..
184 tar cvf nncp-"$release".tar --uid=0 --gid=0 --numeric-owner nncp-"$release"
185 xz -9v nncp-"$release".tar
186 gpg --detach-sign --sign --local-user releases@nncpgo.org nncp-"$release".tar.xz
187 mv -v $tmp/nncp-"$release".tar.xz $tmp/nncp-"$release".tar.xz.sig $cur/doc/nncp.html/download
188
189 tarball=$cur/doc/nncp.html/download/nncp-"$release".tar.xz
190 size=$(( $(stat -f %z $tarball) / 1024 ))
191 hash=$(gpg --print-md SHA256 < $tarball)
192 release_date=$(date "+%Y-%m-%d")
193
194 cat <<EOF
195 An entry for documentation:
196 @item @ref{Release $release, $release} @tab $release_date @tab $size KiB
197 @tab @url{download/nncp-${release}.tar.xz, link} @url{download/nncp-${release}.tar.xz.sig, sign}
198 @tab @code{$hash}
199 EOF
200
201 cd $cur
202
203 cat <<EOF
204 Subject: [EN] NNCP $release release announcement
205
206 I am pleased to announce NNCP $release release availability!
207
208 NNCP (Node to Node copy) is a collection of utilities simplifying
209 secure store-and-forward files and mail exchanging.
210
211 This utilities are intended to help build up small size (dozens of
212 nodes) ad-hoc friend-to-friend (F2F) statically routed darknet
213 delay-tolerant networks for fire-and-forget secure reliable files, file
214 requests, Internet mail and commands transmission. All packets are
215 integrity checked, end-to-end encrypted (E2EE), explicitly authenticated
216 by known participants public keys. Onion encryption is applied to
217 relayed packets. Each node acts both as a client and server, can use
218 push and poll behaviour model.
219
220 Out-of-box offline sneakernet/floppynet, dead drops, sequential and
221 append-only CD-ROM/tape storages, air-gapped computers support. But
222 online TCP daemon with full-duplex resumable data transmission exists.
223
224 ------------------------ >8 ------------------------
225
226 The main improvements for that release are:
227
228 $(git cat-file -p $release | sed -n '6,/^.*BEGIN/p' | sed '$d')
229
230 ------------------------ >8 ------------------------
231
232 NNCP's home page is: http://www.nncpgo.org/
233
234 Source code and its signature for that version can be found here:
235
236     http://www.nncpgo.org/download/nncp-${release}.tar.xz ($size KiB)
237     http://www.nncpgo.org/download/nncp-${release}.tar.xz.sig
238
239 SHA256 hash: $hash
240 GPG key ID: 0x2B25868E75A1A953 NNCP releases <releases@nncpgo.org>
241 Fingerprint: 92C2 F0AE FE73 208E 46BF  F3DE 2B25 868E 75A1 A953
242
243 Please send questions regarding the use of NNCP, bug reports and patches
244 to mailing list: https://lists.cypherpunks.ru/pipermail/nncp-devel/
245 EOF
246
247 cat <<EOF
248 Subject: [RU] Состоялся релиз NNCP $release
249
250 Я рад сообщить о выходе релиза NNCP $release!
251
252 NNCP (Node to Node copy) это набор утилит упрощающий безопасный обмен
253 файлами и почтой в режиме сохранить-и-переслать.
254
255 Эти утилиты предназначены помочь с построением одноранговых устойчивых к
256 разрывам сетей небольшого размера (дюжины узлов), в режиме друг-к-другу
257 (F2F) со статической маршрутизацией для безопасной надёжной передачи
258 файлов, запросов на передачу файлов, Интернет почты и команд по принципу
259 выстрелил-и-забыл. Все пакеты проверяются на целостность, шифруются по
260 принципу точка-точка (E2EE), аутентифицируются известными публичными
261 ключами участников. Луковичное (onion) шифрование применяется ко всем
262 ретранслируемым пакетам. Каждый узел выступает одновременно в роли
263 клиента и сервера, может использовать как push, так и poll модель
264 поведения.
265
266 Поддержка из коробки offline флоппинета, тайников для сброса информации
267 (dead drop), последовательных и только-для-записи CD-ROM/ленточных
268 хранилищ, компьютеров с "воздушным зазором" (air-gap). Но также
269 существует и online TCP демон с полнодуплексной возобновляемой передачей
270 данных.
271
272 ------------------------ >8 ------------------------
273
274 Основные усовершенствования в этом релизе:
275
276 $(git cat-file -p $release | sed -n '6,/^.*BEGIN/p' | sed '$d')
277
278 ------------------------ >8 ------------------------
279
280 Домашняя страница NNCP: http://www.nncpgo.org/
281 Коротко об утилитах: http://www.nncpgo.org/Ob-utilitakh.html
282
283 Исходный код и его подпись для этой версии находятся здесь:
284
285     http://www.nncpgo.org/download/nncp-${release}.tar.xz ($size KiB)
286     http://www.nncpgo.org/download/nncp-${release}.tar.xz.sig
287
288 SHA256 хэш: $hash
289 Идентификатор GPG ключа: 0x2B25868E75A1A953 NNCP releases <releases@nncpgo.org>
290 Отпечаток: 92C2 F0AE FE73 208E 46BF  F3DE 2B25 868E 75A1 A953
291
292 Пожалуйста, все вопросы касающиеся использования NNCP, отчёты об ошибках
293 и патчи отправляйте в nncp-devel почтовую рассылку:
294 https://lists.cypherpunks.ru/pipermail/nncp-devel/
295 EOF