@@ -20,6 +20,8 @@ lxc=true
20
20
osslTarUrl=http://downloads.sourceforge.net/project/osslsigncode/osslsigncode/osslsigncode-1.7.1.tar.gz
21
21
osslPatchUrl=https://bitcoincore.org/cfields/osslsigncode-Backports-to-1.7.1.patch
22
22
scriptName=$( basename -- " $0 " )
23
+ signProg=" gpg --detach-sign"
24
+ commitFiles=true
23
25
24
26
# Help Message
25
27
read -d ' ' usage << - EOF
@@ -43,6 +45,8 @@ Options:
43
45
-m Memory to allocate in MiB. Default 2000
44
46
--kvm Use KVM instead of LXC
45
47
--setup Setup the gitian building environment. Uses KVM. If you want to use lxc, use the --lxc option. Only works on Debian-based systems (Ubuntu, Debian)
48
+ --detach-sign Create the assert file for detached signing. Will not commit anything.
49
+ --no-commit Do not commit anything to git
46
50
-h|--help Print this help message
47
51
EOF
48
52
@@ -148,6 +152,15 @@ while :; do
148
152
--kvm)
149
153
lxc=false
150
154
;;
155
+ # Detach sign
156
+ --detach-sign)
157
+ signProg=" true"
158
+ commitFiles=false
159
+ ;;
160
+ # Commit files
161
+ --no-commit)
162
+ commitFiles=false
163
+ ;;
151
164
# Setup
152
165
--setup)
153
166
setup=true
@@ -214,11 +227,11 @@ echo ${COMMIT}
214
227
# Setup build environment
215
228
if [[ $setup = true ]]
216
229
then
217
- pushd ./gitian-builder
218
230
sudo apt-get install ruby apache2 git apt-cacher-ng python-vm-builder qemu-kvm qemu-utils
219
231
git clone https://github.com/bitcoin-core/gitian.sigs.git
220
232
git clone https://github.com/bitcoin-core/bitcoin-detached-sigs.git
221
233
git clone https://github.com/devrandom/gitian-builder.git
234
+ pushd ./gitian-builder
222
235
if [[ -n " $USE_LXC " ]]
223
236
then
224
237
sudo apt-get install lxc
258
271
echo " Compiling ${VERSION} Linux"
259
272
echo " "
260
273
./bin/gbuild -j ${proc} -m ${mem} --commit bitcoin=${COMMIT} --url bitcoin=${url} ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml
261
- ./bin/gsign --signer $SIGNER --release ${VERSION} -linux --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml
274
+ ./bin/gsign -p $signProg - -signer $SIGNER --release ${VERSION} -linux --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml
262
275
mv build/out/bitcoin-* .tar.gz build/out/src/bitcoin-* .tar.gz ../bitcoin-binaries/${VERSION}
263
276
fi
264
277
# Windows
268
281
echo " Compiling ${VERSION} Windows"
269
282
echo " "
270
283
./bin/gbuild -j ${proc} -m ${mem} --commit bitcoin=${COMMIT} --url bitcoin=${url} ../bitcoin/contrib/gitian-descriptors/gitian-win.yml
271
- ./bin/gsign --signer $SIGNER --release ${VERSION} -win-unsigned --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-win.yml
284
+ ./bin/gsign -p $signProg - -signer $SIGNER --release ${VERSION} -win-unsigned --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-win.yml
272
285
mv build/out/bitcoin-* -win-unsigned.tar.gz inputs/bitcoin-win-unsigned.tar.gz
273
286
mv build/out/bitcoin-* .zip build/out/bitcoin-* .exe ../bitcoin-binaries/${VERSION}
274
287
fi
@@ -279,22 +292,25 @@ then
279
292
echo " Compiling ${VERSION} Mac OSX"
280
293
echo " "
281
294
./bin/gbuild -j ${proc} -m ${mem} --commit bitcoin=${COMMIT} --url bitcoin=${url} ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml
282
- ./bin/gsign --signer $SIGNER --release ${VERSION} -osx-unsigned --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml
295
+ ./bin/gsign -p $signProg - -signer $SIGNER --release ${VERSION} -osx-unsigned --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml
283
296
mv build/out/bitcoin-* -osx-unsigned.tar.gz inputs/bitcoin-osx-unsigned.tar.gz
284
297
mv build/out/bitcoin-* .tar.gz build/out/bitcoin-* .dmg ../bitcoin-binaries/${VERSION}
285
298
fi
286
299
popd
287
300
288
- # Commit to gitian.sigs repo
289
- echo " "
290
- echo " Committing ${VERSION} Unsigned Sigs"
291
- echo " "
292
- pushd gitian.sigs
293
- git add ${VERSION} -linux/${SIGNER}
294
- git add ${VERSION} -win-unsigned/${SIGNER}
295
- git add ${VERSION} -osx-unsigned/${SIGNER}
296
- git commit -a -m " Add ${VERSION} unsigned sigs for ${SIGNER} "
297
- popd
301
+ if [[ $commitFiles = true ]]
302
+ then
303
+ # Commit to gitian.sigs repo
304
+ echo " "
305
+ echo " Committing ${VERSION} Unsigned Sigs"
306
+ echo " "
307
+ pushd gitian.sigs
308
+ git add ${VERSION} -linux/${SIGNER}
309
+ git add ${VERSION} -win-unsigned/${SIGNER}
310
+ git add ${VERSION} -osx-unsigned/${SIGNER}
311
+ git commit -a -m " Add ${VERSION} unsigned sigs for ${SIGNER} "
312
+ popd
313
+ fi
298
314
fi
299
315
300
316
# Verify the build
341
357
echo " Signing ${VERSION} Windows"
342
358
echo " "
343
359
./bin/gbuild -i --commit signature=${COMMIT} ../bitcoin/contrib/gitian-descriptors/gitian-win-signer.yml
344
- ./bin/gsign --signer $SIGNER --release ${VERSION} -win-signed --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-win-signer.yml
360
+ ./bin/gsign -p $signProg - -signer $SIGNER --release ${VERSION} -win-signed --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-win-signer.yml
345
361
mv build/out/bitcoin-* win64-setup.exe ../bitcoin-binaries/${VERSION}
346
362
mv build/out/bitcoin-* win32-setup.exe ../bitcoin-binaries/${VERSION}
347
363
fi
@@ -352,18 +368,21 @@ then
352
368
echo " Signing ${VERSION} Mac OSX"
353
369
echo " "
354
370
./bin/gbuild -i --commit signature=${COMMIT} ../bitcoin/contrib/gitian-descriptors/gitian-osx-signer.yml
355
- ./bin/gsign --signer $SIGNER --release ${VERSION} -osx-signed --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-osx-signer.yml
371
+ ./bin/gsign -p $signProg - -signer $SIGNER --release ${VERSION} -osx-signed --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-osx-signer.yml
356
372
mv build/out/bitcoin-osx-signed.dmg ../bitcoin-binaries/${VERSION} /bitcoin-${VERSION} -osx.dmg
357
373
fi
358
374
popd
359
375
360
- # Commit Sigs
361
- pushd gitian.sigs
362
- echo " "
363
- echo " Committing ${VERSION} Signed Sigs"
364
- echo " "
365
- git add ${VERSION} -win-signed/${SIGNER}
366
- git add ${VERSION} -osx-signed/${SIGNER}
367
- git commit -a -m " Add ${VERSION} signed binary sigs for ${SIGNER} "
368
- popd
376
+ if [[ $commitFiles = true ]]
377
+ then
378
+ # Commit Sigs
379
+ pushd gitian.sigs
380
+ echo " "
381
+ echo " Committing ${VERSION} Signed Sigs"
382
+ echo " "
383
+ git add ${VERSION} -win-signed/${SIGNER}
384
+ git add ${VERSION} -osx-signed/${SIGNER}
385
+ git commit -a -m " Add ${VERSION} signed binary sigs for ${SIGNER} "
386
+ popd
387
+ fi
369
388
fi
0 commit comments