Repository navigation
Expand file tree
/
Copy pathcompile.sh
More file actions
431 lines (344 loc) · 13 KB
/
Copy pathcompile.sh
File metadata and controls
431 lines (344 loc) · 13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
# ##############################################################################
#
# This script compiles the Mofo Wallet source code for the various
# supported nodewebkit platforms.
#
# Supported platforms:
#
# 1. Windows (mofo.win.zip)
# 2. Linux (mofo.lin.zip
# 3. MacOSX (mofo.osx.zip)
#
# Requirements:
#
# 1. Compiled FIMK jar files (run compile.sh first)
# 2. Unpacked NXT jar files in dist/nxt
# 2. Installed grunt
# 3. Installed grunt nwjs
#
# Usage:
#
# Usage is straightforward, just run this script and you'll end up with
# executables for all supported platforms. All platforms come with various
# helper libraries that for the embedded webkit libraries, these libraries
# (dll, so) are packaged together with the FIM Community Client source in
# a directory. That directory is then zipped.
#
# ##############################################################################
DEBUG=false
WITH_NEXT=false
VERSION=`cat VERSION`
BASE=lompsa
MODE_JS_FILE='app/mode.js'
MODE_JS=$(cat <<'END_HEREDOC'
/* This file is autogenerated by the build system */
var VERSION='#VERSION#';
var ENABLE_DUAL_ENGINES=false;
var IS_TEST_NET=false;
var FORCE_LOCAL_HOST=false;
var WALLET_NAME='Lompsa.com';
var TRADE_UI_ONLY=false;
var DEBUG=false;
var BUILD_TIMESTAMP=#TIMESTAMP#;
END_HEREDOC
)
cat > $MODE_JS_FILE <<EOF
$MODE_JS
EOF
orig=#VERSION#
sed -i "s/${orig}/${VERSION}/g" $MODE_JS_FILE
orig=#TIMESTAMP#
timestamp=$(date +%s)
sed -i "s/${orig}/${timestamp}/g" $MODE_JS_FILE
export WINEARCH="win32"
export WINEPREFIX=/home/dirk/.wine32
grunt nwjs
# This compiles NXT
# if [ "$WITH_NEXT" = "true" ]; then
# cd ../nxt
# sh compile.sh
# cd ../mofowallet
# fi
/bin/rm -r -f dist/build/linux64
if [ "$DEBUG" = "false" ]; then
/bin/rm -r -f dist/build/linux32
/bin/rm -r -f dist/build/win32
/bin/rm -r -f dist/build/win64
/bin/rm -r -f dist/build/osx32
/bin/rm -r -f dist/build/osx64
fi
mkdir dist/releases
echo "nodewebkit generated successfully"
FIM_FILES="../fimk/html/ ../fimk/lib/ ../fimk/fim.jar ../fimk/README.txt ../fimk/run.bat ../fimk/run.sh"
FIM_FILES_CONF="../fimk/conf/nxt-default.properties ../fimk/conf/logging-default.properties"
NXT_FILES="../nxt-plus/html/ ../nxt-plus/lib/ ../nxt-plus/nxt.jar ../nxt-plus/README.txt ../nxt-plus/run.bat ../nxt-plus/run.sh"
NXT_FILES_CONF="../nxt-plus/conf/nxt-default.properties ../nxt-plus/conf/logging-default.properties"
# ==============================================================================
# Linux 64
# ==============================================================================
# Copy FIM to the fim dir to allow addition of other servers later
BUILD=dist/build/linux64
mkdir -p $BUILD
# FIM embedded in lompsa
mkdir -p $BUILD/fim
mkdir -p $BUILD/fim/conf
cp -r -p $FIM_FILES $BUILD/fim
cp -p $FIM_FILES_CONF $BUILD/fim/conf
# NXT embedded in lompsa
if [ "$WITH_NEXT" = "true" ]; then
mkdir -p $BUILD/nxt
mkdir -p $BUILD/nxt/conf
cp -r -p $NXT_FILES $BUILD/nxt
cp -p $NXT_FILES_CONF $BUILD/nxt/conf
fi
# Copy over the lompsa files
cp -r -p dist/lompsa/linux64/* $BUILD
cp LICENSE.txt $BUILD
if [ "$DEBUG" = "true" ]; then
exit 0
fi
# create the release zip
cd $BUILD
/bin/rm -f ../../../dist/releases/$BASE.linux64-$VERSION.zip
zip -qr -9 ../../../dist/releases/$BASE.linux64-$VERSION.zip .
cd ../../..
echo "$BASE.linux64-$VERSION.zip generated successfully"
# ==============================================================================
# Linux 32
# ==============================================================================
# Copy FIM to the fim dir to allow addition of other servers later
BUILD=dist/build/linux32
mkdir -p $BUILD
# FIM embedded in lompsa
mkdir -p $BUILD/fim
mkdir -p $BUILD/fim/conf
cp -r -p $FIM_FILES $BUILD/fim
cp -p $FIM_FILES_CONF $BUILD/fim/conf
# NXT embedded in lompsa
if [ "$WITH_NEXT" = "true" ]; then
mkdir -p $BUILD/nxt
mkdir -p $BUILD/nxt/conf
cp -r -p $NXT_FILES $BUILD/nxt
cp -p $NXT_FILES_CONF $BUILD/nxt/conf
fi
# Copy over the lompsa files
cp -r -p dist/lompsa/linux32/* $BUILD
cp LICENSE.txt $BUILD
# create the release zip
cd $BUILD
/bin/rm -f ../../../dist/releases/$BASE.linux32-$VERSION.zip
zip -qr -9 ../../../dist/releases/$BASE.linux32-$VERSION.zip .
cd ../../..
echo "$BASE.linux32-$VERSION.zip generated successfully"
# ==============================================================================
# Windows 32
# ==============================================================================
# Copy FIM to the fim dir to allow addition of other servers later
BUILD=dist/build/win32
mkdir -p $BUILD
# FIM embedded in lompsa
mkdir -p $BUILD/fim
mkdir -p $BUILD/fim/conf
cp -r -p $FIM_FILES $BUILD/fim
cp -p $FIM_FILES_CONF $BUILD/fim/conf
# NXT embedded in lompsa
if [ "$WITH_NEXT" = "true" ]; then
mkdir -p $BUILD/nxt
mkdir -p $BUILD/nxt/conf
cp -r -p $NXT_FILES $BUILD/nxt
cp -p $NXT_FILES_CONF $BUILD/nxt/conf
fi
# Copy over the lompsa files
cp -r -p dist/lompsa/win32/* $BUILD
cp LICENSE.txt $BUILD
# Remove pdf.dll
rm -f $BUILD/pdf.dll
# create the release zip
cd $BUILD
/bin/rm -f ../../../dist/releases/$BASE.win32-$VERSION.zip
zip -qr -9 ../../../dist/releases/$BASE.win32-$VERSION.zip .
cd ../../..
echo "$BASE.win32-$VERSION.zip generated successfully"
# ==============================================================================
# Windows 64
# ==============================================================================
# Copy FIM to the fim dir to allow addition of other servers later
BUILD=dist/build/win64
mkdir -p $BUILD
# FIM embedded in lompsa
mkdir -p $BUILD/fim
mkdir -p $BUILD/fim/conf
cp -r -p $FIM_FILES $BUILD/fim
cp -p $FIM_FILES_CONF $BUILD/fim/conf
# NXT embedded in lompsa
if [ "$WITH_NEXT" = "true" ]; then
mkdir -p $BUILD/nxt
mkdir -p $BUILD/nxt/conf
cp -r -p $NXT_FILES $BUILD/nxt
cp -p $NXT_FILES_CONF $BUILD/nxt/conf
fi
# Copy over the lompsa files
cp -r -p dist/lompsa/win64/* $BUILD
cp LICENSE.txt $BUILD
# Remove pdf.dll
rm -f $BUILD/pdf.dll
# create the release zip
cd $BUILD
/bin/rm -f ../../../dist/releases/$BASE.win64-$VERSION.zip
zip -qr -9 ../../../dist/releases/$BASE.win64-$VERSION.zip .
cd ../../..
echo "$BASE.win64-$VERSION.zip generated successfully"
# ==============================================================================
# Osx 32 (10.7 and up)
# ==============================================================================
# Copy FIM to the fim dir to allow addition of other servers later
BUILD=dist/build/osx32
mkdir -p $BUILD
# FIM embedded in lompsa
mkdir -p $BUILD/lompsa.app/Contents/Resources/fim
mkdir -p $BUILD/lompsa.app/Contents/Resources/fim/conf
cp -r -p $FIM_FILES $BUILD/lompsa.app/Contents/Resources/fim
cp -p $FIM_FILES_CONF $BUILD/lompsa.app/Contents/Resources/fim/conf
# NXT embedded in lompsa
if [ "$WITH_NEXT" = "true" ]; then
mkdir -p $BUILD/lompsa.app/Contents/Resources/nxt
mkdir -p $BUILD/lompsa.app/Contents/Resources/nxt/conf
cp -r -p $NXT_FILES $BUILD/lompsa.app/Contents/Resources/nxt
cp -p $NXT_FILES_CONF $BUILD/lompsa.app/Contents/Resources/nxt/conf
fi
# Copy over the lompsa files
cp -r -p dist/lompsa/osx32/* $BUILD
cp LICENSE.txt $BUILD
# create the release zip
cd $BUILD
/bin/rm -f ../../../dist/releases/$BASE.osx32-$VERSION.zip
zip -qr -9 ../../../dist/releases/$BASE.osx32-$VERSION.zip .
cd ../../..
echo "$BASE.osx32-$VERSION generated successfully"
# ==============================================================================
# Osx 64 (10.7 and up)
# ==============================================================================
# Copy FIM to the fim dir to allow addition of other servers later
BUILD=dist/build/osx64
mkdir -p $BUILD
# FIM embedded in lompsa
mkdir -p $BUILD/lompsa.app/Contents/Resources/fim
mkdir -p $BUILD/lompsa.app/Contents/Resources/fim/conf
cp -r -p $FIM_FILES $BUILD/lompsa.app/Contents/Resources/fim
cp -p $FIM_FILES_CONF $BUILD/lompsa.app/Contents/Resources/fim/conf
# NXT embedded in lompsa
if [ "$WITH_NEXT" = "true" ]; then
mkdir -p $BUILD/lompsa.app/Contents/Resources/nxt
mkdir -p $BUILD/lompsa.app/Contents/Resources/nxt/conf
cp -r -p $NXT_FILES $BUILD/lompsa.app/Contents/Resources/nxt
cp -p $NXT_FILES_CONF $BUILD/lompsa.app/Contents/Resources/nxt/conf
fi
# Copy over the lompsa files
cp -r -p dist/lompsa/osx64/* $BUILD
cp LICENSE.txt $BUILD
# create the release zip
cd $BUILD
/bin/rm -f ../../../dist/releases/$BASE.osx64-$VERSION.zip
zip -qr -9 ../../../dist/releases/$BASE.osx64-$VERSION.zip .
cd ../../..
echo "$BASE.osx64-$VERSION generated successfully"
# ==============================================================================
# Package it all up
# ==============================================================================
DATE=`date +%Y-%m-%d`
TARGET_WIN32="$BASE.win32-$VERSION.zip"
TARGET_WIN64="$BASE.win64-$VERSION.zip"
TARGET_MAC32="$BASE.osx32-$VERSION.zip"
TARGET_MAC64="$BASE.osx64-$VERSION.zip"
TARGET_LIN32="$BASE.linux32-$VERSION.zip"
TARGET_LIN64="$BASE.linux64-$VERSION.zip"
# The version number is used to pick up the changelog which describes the release
CHANGELOG="changelogs/mofowallet-$VERSION.txt"
ANNOUNCEMENT="announcements/lompsa-$VERSION.txt"
rm -f $ANNOUNCEMENT
SHA_SUM_1=`sha256sum "dist/releases/$TARGET_WIN32"`
MD5_SUM_1=`md5sum "dist/releases/$TARGET_WIN32"`
SHA_SUM_1=${SHA_SUM_1%\ *}
MD5_SUM_1=${MD5_SUM_1%\ *}
SHA_SUM_2=`sha256sum "dist/releases/$TARGET_WIN64"`
MD5_SUM_2=`md5sum "dist/releases/$TARGET_WIN64"`
SHA_SUM_2=${SHA_SUM_2%\ *}
MD5_SUM_2=${MD5_SUM_2%\ *}
SHA_SUM_3=`sha256sum "dist/releases/$TARGET_MAC32"`
MD5_SUM_3=`md5sum "dist/releases/$TARGET_MAC32"`
SHA_SUM_3=${SHA_SUM_3%\ *}
MD5_SUM_3=${MD5_SUM_3%\ *}
SHA_SUM_4=`sha256sum "dist/releases/$TARGET_MAC64"`
MD5_SUM_4=`md5sum "dist/releases/$TARGET_MAC64"`
SHA_SUM_4=${SHA_SUM_4%\ *}
MD5_SUM_4=${MD5_SUM_4%\ *}
SHA_SUM_5=`sha256sum "dist/releases/$TARGET_LIN32"`
MD5_SUM_5=`md5sum "dist/releases/$TARGET_LIN32"`
SHA_SUM_5=${SHA_SUM_5%\ *}
MD5_SUM_5=${MD5_SUM_5%\ *}
SHA_SUM_6=`sha256sum "dist/releases/$TARGET_LIN64"`
MD5_SUM_6=`md5sum "dist/releases/$TARGET_LIN64"`
SHA_SUM_6=${SHA_SUM_6%\ *}
MD5_SUM_6=${MD5_SUM_6%\ *}
BANNER=$(cat <<'END_HEREDOC'
███████╗██╗███╗ ███╗██╗ ██╗ Release : #VERSION#
██╔════╝██║████╗ ████║██║ ██╔╝ Date : #DATE#
█████╗ ██║██╔████╔██║█████╔╝ http://fimk.fi
██╔══╝ ██║██║╚██╔╝██║██╔═██╗ https://github.com/fimkrypto/mofowallet
██║ ██║██║ ╚═╝ ██║██║ ██╗ https://lompsa.com
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝
presents:
██╗ ██████╗ ███╗ ███╗██████╗ ███████╗ █████╗
██║ ██╔═══██╗████╗ ████║██╔══██╗██╔════╝██╔══██╗
██║ ██║ ██║██╔████╔██║██████╔╝███████╗███████║
██║ ██║ ██║██║╚██╔╝██║██╔═══╝ ╚════██║██╔══██║
███████╗╚██████╔╝██║ ╚═╝ ██║██║ ███████║██║ ██║
╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚══════╝╚═╝ ╚═╝
END_HEREDOC
)
cat > $ANNOUNCEMENT <<EOF
$BANNER
`cat $CHANGELOG`
~~~ DOWNLOAD ~~~
https://github.com/fimkrypto/mofowallet/releases/download/v$VERSION/$TARGET_WIN32
SHA256 $SHA_SUM_1
MD5 $MD5_SUM_1
https://github.com/fimkrypto/mofowallet/releases/download/v$VERSION/$TARGET_WIN64
SHA256 $SHA_SUM_2
MD5 $MD5_SUM_2
https://github.com/fimkrypto/mofowallet/releases/download/v$VERSION/$TARGET_MAC32
SHA256 $SHA_SUM_3
MD5 $MD5_SUM_3
https://github.com/fimkrypto/mofowallet/releases/download/v$VERSION/$TARGET_MAC64
SHA256 $SHA_SUM_4
MD5 $MD5_SUM_4
https://github.com/fimkrypto/mofowallet/releases/download/v$VERSION/$TARGET_LIN32
SHA256 $SHA_SUM_5
MD5 $MD5_SUM_5
https://github.com/fimkrypto/mofowallet/releases/download/v$VERSION/$TARGET_LIN64
SHA256 $SHA_SUM_6
MD5 $MD5_SUM_6
EOF
orig=#VERSION#
sed -i "s/${orig}/${VERSION}/g" $ANNOUNCEMENT
orig=#DATE#
sed -i "s/${orig}/${DATE}/g" $ANNOUNCEMENT
if [ "$DEBUG" = "false" ]; then
gpg --clearsign --batch $ANNOUNCEMENT
mv $ANNOUNCEMENT.asc $ANNOUNCEMENT
fi
echo "========================================================================="
echo "== Successfully generated new version"
echo "=="
echo "=="
echo "== Checklist.."
echo "=="
echo "== 1. Did you update the version number in README.txt ?"
echo "== 2. Did you update the version number in index.html ?"
echo "=="
echo "== Final actions.."
echo "=="
echo "== 1. Github release: https://github.com/fimkrypto/mofowallet/releases/tag/v$VERSION"
echo "=="
echo "=="
echo "========================================================================="