Usage: $scriptName[-c|u|v|b|s|B|o|h|j|m|] signer version
Run this script from the directory containing the bitcoin, gitian-builder, gitian.sigs, and bitcoin-detached-sigs.
Arguments:
signer GPG signer to sign each build assert file
version Version number, commit, or branch to build. If building a commit or branch, the -c option must be specified
Options:
-c|--commit Indicate that the version argument is for a commit or branch
-u|--url Specify the URL of the repository. Default is https://github.com/bitcoin/bitcoin
-v|--verify Verify the gitian build
-b|--build Do a gitiain build
-s|--sign Make signed binaries for Windows and Mac OSX
-B|--buildsign Build both signed and unsigned binaries
-o|--os Specify which Operating Systems the build is for. Default is lwx. l for linux, w for windows, x for osx
-j Number of processes to use. Default 4
-m Memory to allocate in MiB. Default 2000
--kvm Use KVM instead of LXC
--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)
-h|--help Print this help message
EOF
# Get options and arguments
while :;do
case$1 in
# Verify
-v|--verify)
verify=true
;;
# Build
-b|--build)
build=true
;;
# Sign binaries
-s|--sign)
sign=true
;;
# Build then Sign
-B|--buildsign)
sign=true
build=true
;;
# PGP Signer
-S|--signer)
if[ -n "$2"]
then
SIGNER=$2
shift
else
echo'Error: "--signer" requires a non-empty argument.'
exit1
fi
;;
# Operating Systems
-o|--os)
if[ -n "$2"]
then
linux=false
windows=false
osx=false
if[["$2"= *"l"* ]]
then
linux=true
fi
if[["$2"= *"w"* ]]
then
windows=true
fi
if[["$2"= *"x"* ]]
then
osx=true
fi
shift
else
echo'Error: "--os" requires an argument containing an l (for linux), w (for windows), or x (for Mac OSX)\n'
exit1
fi
;;
# Help message
-h|--help)
echo"$usage"
exit0
;;
# Commit or branch
-c|--commit)
commit=true
;;
# Number of Processes
-j)
if[ -n "$2"]
then
proc=$2
shift
else
echo'Error: "-j" requires an argument'
exit1
fi
;;
# Memory to allocate
-m)
if[ -n "$2"]
then
mem=$2
shift
else
echo'Error: "-m" requires an argument'
exit1
fi
;;
# URL
-u)
if[ -n "$2"]
then
url=$2
shift
else
echo'Error: "-u" requires an argument'
exit1
fi
;;
# kvm
--kvm)
lxc=false
;;
# Setup
--setup)
setup=true
;;
*)# Default case: If no more options then break out of the loop.