]> asedeno.scripts.mit.edu Git - PuTTY.git/blob - sign.sh
first pass
[PuTTY.git] / sign.sh
1 #!/bin/sh 
2
3 # Generate GPG signatures on a PuTTY release/snapshot directory as
4 # delivered by Buildscr.
5
6 # Usage: sh sign.sh [-r] <builddir>
7 # e.g.   sh sign.sh putty              (probably in the build.out directory)
8 #   or   sh sign.sh -r 0.60            (-r means use the release keys)
9
10 set -e
11
12 keyname=EEF20295D15F7E8A
13
14 if test "x$1" = "x-r"; then
15     shift
16     keyname=9DFE2648B43434E4
17 fi
18
19 sign() {
20   # Check for the prior existence of the signature, so we can
21   # re-run this script if it encounters an error part way
22   # through.
23   echo "----- Signing $2 with key '$keyname'"
24   test -f "$3" || \
25     gpg --load-extension=idea "$1" -u "$keyname" -o "$3" "$2"
26 }
27
28 cd "$1"
29 echo "===== Signing with key '$keyname'"
30 for i in putty*src.zip putty*.tar.gz w32/*.exe w32/*.zip w32/*.msi w64/*.exe w64/*.zip w64/*.msi w32old/*.exe w32old/*.zip; do
31     sign --detach-sign "$i" "$i.gpg"
32 done
33 for i in md5sums sha1sums sha256sums sha512sums; do
34     sign --clearsign "$i" "$i.gpg"
35 done