From bf46c0c95ad1abc2382abc45f30830971a055bdd Mon Sep 17 00:00:00 2001 From: gdm85 Date: Tue, 3 Jun 2014 13:22:06 +0200 Subject: [PATCH] * added support for newer versions of bitcoin --- docker/gitian-bitcoin-host/Dockerfile | 6 ++++ docker/gitian-bitcoin-host/README.md | 21 +++++-------- docker/gitian-bitcoin-host/build-bitcoin.sh | 30 ++++++++----------- .../input-sources/0.9.1.txt | 9 ++++++ docker/gitian-bitcoin-host/inputs-0.9.1.txt | 0 docker/gitian-bitcoin-host/sign.sh | 13 ++++++++ 6 files changed, 48 insertions(+), 31 deletions(-) create mode 100644 docker/gitian-bitcoin-host/input-sources/0.9.1.txt create mode 100644 docker/gitian-bitcoin-host/inputs-0.9.1.txt create mode 100755 docker/gitian-bitcoin-host/sign.sh diff --git a/docker/gitian-bitcoin-host/Dockerfile b/docker/gitian-bitcoin-host/Dockerfile index 1dff3b6..1514a53 100644 --- a/docker/gitian-bitcoin-host/Dockerfile +++ b/docker/gitian-bitcoin-host/Dockerfile @@ -1,3 +1,7 @@ +## gitian-bitcoin-host +## +## VERSION 0.1.0 +## FROM gdm85/gitian-host @@ -9,8 +13,10 @@ ADD gitian.patch /home/debian/ WORKDIR /home/debian +## patch to allow paralle creation of VMs RUN cd gitian-builder && patch -p1 < ../gitian.patch ADD build-bitcoin.sh /home/debian/ +ADD sign.sh /home/debian/ RUN chown -R debian.debian /home/debian/ diff --git a/docker/gitian-bitcoin-host/README.md b/docker/gitian-bitcoin-host/README.md index 2460741..a6cfbb5 100644 --- a/docker/gitian-bitcoin-host/README.md +++ b/docker/gitian-bitcoin-host/README.md @@ -1,13 +1,14 @@ Building bitcoin with a gitian-builder Docker container ======================================================= -This image allows automated gitian builds of bitcoin 0.9.1 using a docker container. +This image allows automated gitian builds of bitcoin using a docker container. Before proceeding make sure you have created the necessary *wheezy* and *gitian-host* images, see [these instructions](../gitian-host/README.md). Afterwards you can create the image by running [create-gitian-bitcoin-host.sh). ](../scripts/create-gitian-bitcoin-host.sh). NOTE: this image currently supports only building of bitcoin 0.9.1, but it can be easily adapted to build other versions. +You can submit the source lists for other versions as a patch or pull request. Preamble -------- @@ -26,12 +27,14 @@ See also: Preparing the gitian environment -------------------------------- -If you have already prepared the base VMs (./build-base-vms.sh) inside the gitian host container, all what you need to do is: +If you have already prepared the base VMs ([/build-base-vms.sh](../gitian-host/build-base-vms.sh)) inside the gitian host container, all what you need to do is: ```sh -ssh -o SendEnv= debian@your-gitian-host ./build-bitcoin.sh +ssh -o SendEnv= debian@your-gitian-host ./build-bitcoin.sh 0.9.1 ``` +Notice the parameter 0.9.1, that is the version we are going to build. + [build-bitcoin.sh](build-bitcoin.sh) is a script that will download & build all the dependencies and then bitcoin itself, for both i386 and amd64 Linux architectures. **NOTE:** the SendEnv= is there to overcome an [issue](https://github.com/devrandom/gitian-builder/issues/56) in gitian-builder that allows pollution of the LXC environment. @@ -44,16 +47,8 @@ Before doing that, you can verify if signatures are matching with those of [othe In order to sign you have to either put your private key in the container's *~/.gnupg* or perform the signing externally, at your option. -If you have the private key in the container (also displayed by `gpg -K`), then you can use this script: -```bash -#!/bin/bash -set -e -export SIGNER=yourSignerName -export VERSION=0.9.1 - -cd gitian-builder -./bin/gsign --signer $SIGNER --release ${VERSION} --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml -``` +If you have the private key in the container (also displayed by `gpg -K`), then you can use the [sign.sh](sign.sh) script that is already in the running container, otherwise +run it (with failure) and then copy the *~/gitian.sigs~ directory to another machine to apply the GPG signature. Submitting your signature ------------------------- diff --git a/docker/gitian-bitcoin-host/build-bitcoin.sh b/docker/gitian-bitcoin-host/build-bitcoin.sh index 7d0b778..bcee26a 100755 --- a/docker/gitian-bitcoin-host/build-bitcoin.sh +++ b/docker/gitian-bitcoin-host/build-bitcoin.sh @@ -1,15 +1,12 @@ #!/bin/bash set -e -if [[ -z "$VERSION" ]]; then - echo "Please define VERSION environment variable for bitcoin checkout" 1>&2 +if [[ ! $# -eq 1 ]]; then + echo "Please specify version" 1>&2 exit 1 fi -if [[ "$VERSION" != "0.9.1" ]]; then - echo "Dependencies on this script are valid only for 0.9.1" - exit 2 -fi +VERSION="$1" git clone https://github.com/bitcoin/bitcoin.git cd bitcoin @@ -18,18 +15,15 @@ git checkout v${VERSION} cd ../gitian-builder mkdir -p inputs; cd inputs/ -## -## dependencies valid only for 0.9.1! -## -wget 'http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.8.tar.gz' -O miniupnpc-1.8.tar.gz -wget --no-check-certificate 'https://www.openssl.org/source/openssl-1.0.1g.tar.gz' -wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz' -wget 'http://zlib.net/zlib-1.2.8.tar.gz' -wget 'ftp://ftp.simplesystems.org/pub/png/src/history/libpng16/libpng-1.6.8.tar.gz' -wget 'https://fukuchi.org/works/qrencode/qrencode-3.4.3.tar.bz2' -wget 'https://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.bz2' -wget 'https://download.qt-project.org/official_releases/qt/5.2/5.2.0/single/qt-everywhere-opensource-src-5.2.0.tar.gz' -wget 'https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.bz2' +## get each dependency +## they are validated afterwards by gbuild +while read -r URL FNAME; do + if [ -z "$URL" ]; then + continue + fi + wget --no-check-certificate "$URL" -O "$FNAME" +done < ../input-sources/${VERSION}.txt + cd .. ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/boost-linux.yml mv build/out/boost-*.zip inputs/ diff --git a/docker/gitian-bitcoin-host/input-sources/0.9.1.txt b/docker/gitian-bitcoin-host/input-sources/0.9.1.txt new file mode 100644 index 0000000..cd40897 --- /dev/null +++ b/docker/gitian-bitcoin-host/input-sources/0.9.1.txt @@ -0,0 +1,9 @@ +http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.8.tar.gz miniupnpc-1.8.tar.gz +https://www.openssl.org/source/openssl-1.0.1g.tar.gz openssl-1.0.1g.tar.gz +http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz db-4.8.30.NC.tar.gz +http://zlib.net/zlib-1.2.8.tar.gz zlib-1.2.8.tar.gz +ftp://ftp.simplesystems.org/pub/png/src/history/libpng16/libpng-1.6.8.tar.gz libpng-1.6.8.tar.gz +https://fukuchi.org/works/qrencode/qrencode-3.4.3.tar.bz2 qrencode-3.4.3.tar.bz2 +https://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.bz2 boost_1_55_0.tar.bz2 +https://download.qt-project.org/official_releases/qt/5.2/5.2.0/single/qt-everywhere-opensource-src-5.2.0.tar.gz qt-everywhere-opensource-src-5.2.0.tar.gz +https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.bz2 protobuf-2.5.0.tar.bz2 diff --git a/docker/gitian-bitcoin-host/inputs-0.9.1.txt b/docker/gitian-bitcoin-host/inputs-0.9.1.txt new file mode 100644 index 0000000..e69de29 diff --git a/docker/gitian-bitcoin-host/sign.sh b/docker/gitian-bitcoin-host/sign.sh new file mode 100755 index 0000000..2086967 --- /dev/null +++ b/docker/gitian-bitcoin-host/sign.sh @@ -0,0 +1,13 @@ +-#!/bin/bash +set -e + +if [[ ! $# -eq 2 ]]; then + echo "Please specify version and signer id" 1>&2 + exit 1 +fi + +VERSION="$1" +SIGNER="$2" + +cd gitian-builder +./bin/gsign --signer $SIGNER --release ${VERSION} --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml