diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/bitcoind.bash-completion | 115 | ||||
-rwxr-xr-x | contrib/debian/bin/bitcoin-qt | 16 | ||||
-rwxr-xr-x | contrib/debian/bin/bitcoind | 4 | ||||
-rw-r--r-- | contrib/debian/bitcoin-qt.install | 3 | ||||
-rw-r--r-- | contrib/debian/bitcoind.bash-completion | 1 | ||||
-rw-r--r-- | contrib/debian/changelog | 56 | ||||
-rw-r--r-- | contrib/debian/control | 1 | ||||
-rw-r--r-- | contrib/debian/patches/1001_use_system_json-spirit.patch | 63 | ||||
-rw-r--r-- | contrib/debian/patches/series | 2 | ||||
-rwxr-xr-x | contrib/debian/rules | 2 | ||||
-rw-r--r-- | contrib/gitian-descriptors/README | 65 | ||||
-rw-r--r-- | contrib/gitian-descriptors/boost-win32.yml | 10 | ||||
-rw-r--r-- | contrib/gitian-descriptors/deps-win32.yml | 10 | ||||
-rw-r--r-- | contrib/gitian-descriptors/gitian-win32.yml | 22 | ||||
-rw-r--r-- | contrib/gitian-descriptors/qt-win32.yml | 10 | ||||
-rwxr-xr-x | contrib/macdeploy/macdeployqtplus | 5 | ||||
-rwxr-xr-x | contrib/pyminer/pyminer.py | 2 | ||||
-rw-r--r-- | contrib/testgen/README | 1 | ||||
-rw-r--r-- | contrib/testgen/base58.py | 104 | ||||
-rwxr-xr-x | contrib/testgen/gen_base58_test_vectors.py | 126 |
20 files changed, 494 insertions, 124 deletions
diff --git a/contrib/bitcoind.bash-completion b/contrib/bitcoind.bash-completion new file mode 100644 index 0000000000..dd6c1ce819 --- /dev/null +++ b/contrib/bitcoind.bash-completion @@ -0,0 +1,115 @@ +# bash programmable completion for bitcoind(1) +# Copyright (c) 2012 Christian von Roques <roques@mti.ag> +# Distributed under the MIT/X11 software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +have bitcoind && { + +# call $bitcoind for RPC +_bitcoin_rpc() { + # determine already specified args necessary for RPC + local rpcargs=() + for i in ${COMP_LINE}; do + case "$i" in + -conf=*|-proxy*|-rpc*) + rpcargs=( "${rpcargs[@]}" "$i" ) + ;; + esac + done + $bitcoind "${rpcargs[@]}" "$@" +} + +# Add bitcoin accounts to COMPREPLY +_bitcoin_accounts() { + local accounts + accounts=$(_bitcoin_rpc listaccounts | awk '/".*"/ { a=$1; gsub(/"/, "", a); print a}') + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "$accounts" -- "$cur" ) ) +} + +_bitcoind() { + local cur prev words=() cword + local bitcoind + + # save and use original argument to invoke bitcoind + # bitcoind might not be in $PATH + bitcoind="$1" + + COMPREPLY=() + _get_comp_words_by_ref -n = cur prev words cword + + if ((cword > 2)); then + case ${words[cword-2]} in + listreceivedbyaccount|listreceivedbyaddress) + COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) + return 0 + ;; + move|setaccount) + _bitcoin_accounts + return 0 + ;; + esac + fi + + case "$prev" in + backupwallet) + _filedir + return 0 + ;; + setgenerate) + COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) + return 0 + ;; + getaccountaddress|getaddressesbyaccount|getbalance|getnewaddress|getreceivedbyaccount|listtransactions|move|sendfrom|sendmany) + _bitcoin_accounts + return 0 + ;; + esac + + case "$cur" in + -conf=*|-pid=*|-rpcsslcertificatechainfile=*|-rpcsslprivatekeyfile=*) + cur="${cur#*=}" + _filedir + return 0 + ;; + -datadir=*) + cur="${cur#*=}" + _filedir -d + return 0 + ;; + -*=*) # prevent nonsense completions + return 0 + ;; + *) + local helpopts commands + + # only parse --help if senseful + if [[ -z "$cur" || "$cur" =~ ^- ]]; then + helpopts=$($bitcoind --help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' ) + fi + + # only parse help if senseful + if [[ -z "$cur" || "$cur" =~ ^[a-z] ]]; then + commands=$(_bitcoin_rpc help 2>/dev/null | awk '{ print $1; }') + fi + + COMPREPLY=( $( compgen -W "$helpopts $commands" -- "$cur" ) ) + + # Prevent space if an argument is desired + if [[ $COMPREPLY == *= ]]; then + compopt -o nospace + fi + return 0 + ;; + esac +} + +complete -F _bitcoind bitcoind +} + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff --git a/contrib/debian/bin/bitcoin-qt b/contrib/debian/bin/bitcoin-qt deleted file mode 100755 index f2eac1b1ab..0000000000 --- a/contrib/debian/bin/bitcoin-qt +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -set -e - -umask 077 - -basedir=~/.bitcoin -dbfile="$basedir/DB_CONFIG" -cfgfile="$basedir/bitcoin.conf" - -[ -e "$basedir" ] || mkdir "$basedir" - -# Bitcoin does not clean up DB log files by default -[ -e "$dbfile" ] || echo 'set_flags DB_LOG_AUTOREMOVE' > "$dbfile" - -exec /usr/lib/bitcoin/bitcoin-qt "$@" diff --git a/contrib/debian/bin/bitcoind b/contrib/debian/bin/bitcoind index 0904f76f7b..a2f55a9138 100755 --- a/contrib/debian/bin/bitcoind +++ b/contrib/debian/bin/bitcoind @@ -5,14 +5,10 @@ set -e umask 077 basedir=~/.bitcoin -dbfile="$basedir/DB_CONFIG" cfgfile="$basedir/bitcoin.conf" [ -e "$basedir" ] || mkdir "$basedir" [ -e "$cfgfile" ] || perl -le 'print"rpcpassword=",map{(a..z,A..Z,0..9)[rand 62]}0..9' > "$cfgfile" -# Bitcoin does not clean up DB log files by default -[ -e "$dbfile" ] || echo 'set_flags DB_LOG_AUTOREMOVE' > "$dbfile" - exec /usr/lib/bitcoin/bitcoind "$@" diff --git a/contrib/debian/bitcoin-qt.install b/contrib/debian/bitcoin-qt.install index 6a566f515a..ba407134e7 100644 --- a/contrib/debian/bitcoin-qt.install +++ b/contrib/debian/bitcoin-qt.install @@ -1,5 +1,4 @@ -debian/bin/bitcoin-qt usr/bin -bitcoin-qt usr/lib/bitcoin +bitcoin-qt usr/bin share/pixmaps/bitcoin32.xpm usr/share/pixmaps share/pixmaps/bitcoin80.xpm usr/share/pixmaps debian/bitcoin-qt.desktop usr/share/applications diff --git a/contrib/debian/bitcoind.bash-completion b/contrib/debian/bitcoind.bash-completion new file mode 100644 index 0000000000..0f84707b66 --- /dev/null +++ b/contrib/debian/bitcoind.bash-completion @@ -0,0 +1 @@ +contrib/bitcoind.bash-completion bitcoind diff --git a/contrib/debian/changelog b/contrib/debian/changelog index db5e2682c6..52d0e5907b 100644 --- a/contrib/debian/changelog +++ b/contrib/debian/changelog @@ -1,13 +1,61 @@ -bitcoin (0.5.1-natty1) natty; urgency=low +bitcoin (0.6.3-natty1) natty; urgency=low + + * New upstream release. + + -- Matt Corallo <matt@bluematt.me> Mon, 25 Jun 2012 23:47:00 +0200 + +bitcoin (0.6.2-natty1) natty; urgency=low + + * Update package description and launch scripts. + + -- Matt Corallo <matt@bluematt.me> Sat, 2 Jun 2012 16:41:00 +0200 + +bitcoin (0.6.2-natty0) natty; urgency=low + + * New upstream release. + + -- Matt Corallo <matt@bluematt.me> Tue, 8 May 2012 16:27:00 -0500 + +bitcoin (0.6.1-natty0) natty; urgency=low + + * New upstream release. + + -- Matt Corallo <matt@bluematt.me> Sun, 6 May 2012 20:09:00 -0500 + +bitcoin (0.6.0-natty0) natty; urgency=low + + * New upstream release. + * Add GNOME/KDE support for bitcoin-qt's bitcoin: URI support. + Thanks to luke-jr for the KDE .protocol file. + + -- Matt Corallo <matt@bluematt.me> Sat, 31 Mar 2012 15:35:00 -0500 + +bitcoin (0.5.3-natty1) natty; urgency=low + + * Mark for upload to PPA. + + -- Matt Corallo <matt@bluematt.me> Wed, 14 Mar 2012 23:06:00 -0400 + +bitcoin (0.5.3-natty0) natty; urgency=low + + * New upstream release. + + -- Luke Dashjr <luke+bitcoin+deb@dashjr.org> Tue, 10 Jan 2012 15:57:00 -0500 + +bitcoin (0.5.2-natty1) natty; urgency=low * Remove mentions on anonymity in package descriptions and manpage. These should never have been there, bitcoin isnt anonymous without a ton of work that virtually no users will ever be willing and capable of doing - * Add GNOME/KDE support for bitcoin-qt's bitcoin: URI support. - Thanks to luke-jr for the KDE .protocol file. - -- Matt Corallo <matt@bluematt.me> Fri, 23 Dec 2011 20:25:00 -0500 + -- Matt Corallo <matt@bluematt.me> Sat, 7 Jan 2012 13:37:00 -0500 + +bitcoin (0.5.2-natty0) natty; urgency=low + + * New upstream release. + + -- Luke Dashjr <luke+bitcoin+deb@dashjr.org> Fri, 16 Dec 2011 17:57:00 -0500 bitcoin (0.5.1-natty0) natty; urgency=low diff --git a/contrib/debian/control b/contrib/debian/control index d0a2d57c9e..c8266f686b 100644 --- a/contrib/debian/control +++ b/contrib/debian/control @@ -5,6 +5,7 @@ Maintainer: Jonas Smedegaard <dr@jones.dk> Uploaders: Micah Anderson <micah@debian.org> Build-Depends: debhelper, devscripts, + bash-completion, libboost-system-dev (>> 1.35) | libboost-system1.35-dev, libdb4.8++-dev, libssl-dev, diff --git a/contrib/debian/patches/1001_use_system_json-spirit.patch b/contrib/debian/patches/1001_use_system_json-spirit.patch deleted file mode 100644 index c6d60393d4..0000000000 --- a/contrib/debian/patches/1001_use_system_json-spirit.patch +++ /dev/null @@ -1,63 +0,0 @@ -Description: Use system JSON Spirit library -Author: Jonas Smedegaard <dr@jones.dk> -Last-Update: 2012-07-05 ---- a/src/bitcoinrpc.h -+++ b/src/bitcoinrpc.h -@@ -9,9 +9,7 @@ - #include <string> - #include <map> - --#include "json/json_spirit_reader_template.h" --#include "json/json_spirit_writer_template.h" --#include "json/json_spirit_utils.h" -+#include <json_spirit.h> - - void ThreadRPCServer(void* parg); - int CommandLineRPC(int argc, char *argv[]); ---- a/src/makefile.unix -+++ b/src/makefile.unix -@@ -31,6 +31,7 @@ LIBS += \ - -l boost_thread$(BOOST_LIB_SUFFIX) \ - -l db_cxx$(BDB_LIB_SUFFIX) \ - -l ssl \ -+ -l json_spirit \ - -l crypto - - ifndef USE_UPNP ---- a/src/rpcdump.cpp -+++ b/src/rpcdump.cpp -@@ -8,9 +8,7 @@ - - #include <boost/lexical_cast.hpp> - --#include "json/json_spirit_reader_template.h" --#include "json/json_spirit_writer_template.h" --#include "json/json_spirit_utils.h" -+#include <json_spirit.h> - - #define printf OutputDebugStringF - ---- a/src/test/rpc_tests.cpp -+++ b/src/test/rpc_tests.cpp -@@ -1,6 +1,8 @@ - #include <boost/test/unit_test.hpp> - #include <boost/foreach.hpp> - -+#include <json_spirit.h> -+ - #include "base58.h" - #include "util.h" - #include "bitcoinrpc.h" ---- a/src/test/script_tests.cpp -+++ b/src/test/script_tests.cpp -@@ -8,9 +8,7 @@ - #include <boost/foreach.hpp> - #include <boost/preprocessor/stringize.hpp> - #include <boost/test/unit_test.hpp> --#include "json/json_spirit_reader_template.h" --#include "json/json_spirit_writer_template.h" --#include "json/json_spirit_utils.h" -+#include <json_spirit.h> - - #include "main.h" - #include "wallet.h" diff --git a/contrib/debian/patches/series b/contrib/debian/patches/series index bbe3685ac2..8b13789179 100644 --- a/contrib/debian/patches/series +++ b/contrib/debian/patches/series @@ -1 +1 @@ -#1001_use_system_json-spirit.patch + diff --git a/contrib/debian/rules b/contrib/debian/rules index 49c7766d13..98bb2bba1c 100755 --- a/contrib/debian/rules +++ b/contrib/debian/rules @@ -9,7 +9,7 @@ DEB_INSTALL_EXAMPLES_bitcoind += debian/examples/* DEB_INSTALL_MANPAGES_bitcoind += debian/manpages/* %: - dh $@ + dh --with bash-completion $@ override_dh_auto_build: cd src; $(MAKE) -f makefile.unix bitcoind diff --git a/contrib/gitian-descriptors/README b/contrib/gitian-descriptors/README index a2d902e210..1d3910b994 100644 --- a/contrib/gitian-descriptors/README +++ b/contrib/gitian-descriptors/README @@ -1,31 +1,86 @@ -Gavin's notes on getting gitian builds up and running: +Gavin's notes on getting gitian builds up and running using KVM: + +These instructions distilled from: + https://help.ubuntu.com/community/KVM/Installation +... see there for complete details. You need the right hardware: you need a 64-bit-capable CPU with hardware virtualization support (Intel VT-x or AMD-V). Not all modern CPUs support hardware virtualization. You probably need to enable hardware virtualization in your machine's BIOS. You need to be running a recent version of 64-bit-Ubuntu, and you need to install several prerequisites: - sudo apt-get install apache2 git apt-cacher-ng python-vm-builder qemu-kvm + sudo apt-get install ruby apache2 git apt-cacher-ng python-vm-builder qemu-kvm Sanity checks: sudo service apt-cacher-ng status # Should return apt-cacher-ng is running ls -l /dev/kvm # Should show a /dev/kvm device + Once you've got the right hardware and software: git clone git://github.com/bitcoin/bitcoin.git git clone git://github.com/devrandom/gitian-builder.git mkdir gitian-builder/inputs - wget 'http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.6.tar.gz' -O gitian-builder/inputs/miniupnpc-1.6.tar.gz + cd gitian-builder/inputs + # Inputs for Linux and Win32: + wget -O miniupnpc-1.6.tar.gz 'http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.6.tar.gz' + wget 'http://fukuchi.org/works/qrencode/qrencode-3.2.0.tar.bz2' + # Inputs for Win32: (Linux has packages for these) + wget 'https://downloads.sourceforge.net/project/boost/boost/1.50.0/boost_1_50_0.tar.bz2' + wget 'http://www.openssl.org/source/openssl-1.0.1c.tar.gz' + wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz' + wget 'https://downloads.sourceforge.net/project/libpng/zlib/1.2.6/zlib-1.2.6.tar.gz' + wget 'https://downloads.sourceforge.net/project/libpng/libpng15/older-releases/1.5.9/libpng-1.5.9.tar.gz' + wget 'http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-4.8.2.tar.gz' + cd ../.. cd gitian-builder bin/make-base-vm --arch i386 bin/make-base-vm --arch amd64 cd .. - # To build + # Build Linux release: cd bitcoin git pull cd ../gitian-builder git pull - ./bin/gbuild --commit bitcoin=HEAD ../bitcoin/contrib/gitian.yml + ./bin/gbuild --commit bitcoin=HEAD ../bitcoin/contrib/gitian-descriptors/gitian.yml + + # Build Win32 dependencies: (only needs to be done once, or when dependency versions change) + ./bin/gbuild --commit bitcoin=HEAD ../bitcoin/contrib/gitian-descriptors/boost-win32.yml + ./bin/gbuild --commit bitcoin=HEAD ../bitcoin/contrib/gitian-descriptors/deps-win32.yml + ./bin/gbuild --commit bitcoin=HEAD ../bitcoin/contrib/gitian-descriptors/qt-win32.yml + + # Build Win32 release: + ./bin/gbuild --commit bitcoin=HEAD ../bitcoin/contrib/gitian-descriptors/gitian-win32.yml + +--------------------- + +gitian-builder now also supports building using LXC. See + https://help.ubuntu.com/12.04/serverguide/lxc.html +... for how to get LXC up and running under Ubuntu. + +If your main machine is a 64-bit Mac or PC with a few gigabytes of memory +and at least 10 gigabytes of free disk space, you can gitian-build using +LXC running inside a virtual machine. + +Here's a description of Gavin's setup on OSX 10.6: + +1. Download and install VirtualBox from https://www.virtualbox.org/ + +2. Download the 64-bit Ubuntu Desktop 12.04 LTS .iso CD image from + http://www.ubuntu.com/ + +3. Run VirtualBox and create a new virtual machine, using the + Ubuntu .iso (see the VirtualBox documentation for details). + Create it with at least 2 gigabytes of memory and a disk + that is at least 20 gigabytes big. + +4. Inside the running Ubuntu desktop, install: + sudo apt-get install debootstrap lxc ruby apache2 git apt-cacher-ng python-vm-builder + +5. Still inside Ubuntu, tell gitian-builder to use LXC, then follow the "Once you've got the right + hardware and software" instructions above: + export USE_LXC=1 + git clone git://github.com/bitcoin/bitcoin.git + ... etc diff --git a/contrib/gitian-descriptors/boost-win32.yml b/contrib/gitian-descriptors/boost-win32.yml index 61ea50e4fe..1eeb9eaa28 100644 --- a/contrib/gitian-descriptors/boost-win32.yml +++ b/contrib/gitian-descriptors/boost-win32.yml @@ -11,12 +11,12 @@ packages: reference_datetime: "2011-01-30 00:00:00" remotes: [] files: -- "boost_1_47_0.tar.bz2" +- "boost_1_50_0.tar.bz2" script: | TMPDIR="$HOME/tmpdir" mkdir -p $TMPDIR/bin/$GBUILD_BITS $TMPDIR/include - tar xjf boost_1_47_0.tar.bz2 - cd boost_1_47_0 + tar xjf boost_1_50_0.tar.bz2 + cd boost_1_50_0 echo "using gcc : 4.4 : i586-mingw32msvc-g++ : <rc>i586-mingw32msvc-windres @@ -34,5 +34,5 @@ script: | cd $TMPDIR export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export FAKETIME=$REFERENCE_DATETIME - zip -r boost-win32-1.47.0-gitian.zip * - cp boost-win32-1.47.0-gitian.zip $OUTDIR + zip -r boost-win32-1.50.0-gitian2.zip * + cp boost-win32-1.50.0-gitian2.zip $OUTDIR diff --git a/contrib/gitian-descriptors/deps-win32.yml b/contrib/gitian-descriptors/deps-win32.yml index df1e3de358..106bd06a9b 100644 --- a/contrib/gitian-descriptors/deps-win32.yml +++ b/contrib/gitian-descriptors/deps-win32.yml @@ -4,7 +4,7 @@ suites: - "lucid" architectures: - "i386" -packages: +packages: - "mingw32" - "git-core" - "zip" @@ -13,7 +13,7 @@ packages: reference_datetime: "2011-01-30 00:00:00" remotes: [] files: -- "openssl-1.0.1b.tar.gz" +- "openssl-1.0.1c.tar.gz" - "db-4.8.30.NC.tar.gz" - "miniupnpc-1.6.tar.gz" - "zlib-1.2.6.tar.gz" @@ -25,8 +25,8 @@ script: | export FAKETIME=$REFERENCE_DATETIME export TZ=UTC # - tar xzf openssl-1.0.1b.tar.gz - cd openssl-1.0.1b + tar xzf openssl-1.0.1c.tar.gz + cd openssl-1.0.1c ./Configure --cross-compile-prefix=i586-mingw32msvc- mingw make cd .. @@ -62,7 +62,7 @@ script: | make $MAKEOPTS cd .. # - zip -r $OUTDIR/bitcoin-deps-0.0.4.zip \ + zip -r $OUTDIR/bitcoin-deps-0.0.5.zip \ $(ls qrencode-*/{qrencode.h,.libs/libqrencode.{,l}a} | sort) \ $(ls db-*/build_unix/{libdb_cxx.a,db.h,db_cxx.h,libdb.a,.libs/libdb_cxx-?.?.a} | sort) \ $(find openssl-* -name '*.a' -o -name '*.h' | sort) \ diff --git a/contrib/gitian-descriptors/gitian-win32.yml b/contrib/gitian-descriptors/gitian-win32.yml index a48e54da85..cef096a81d 100644 --- a/contrib/gitian-descriptors/gitian-win32.yml +++ b/contrib/gitian-descriptors/gitian-win32.yml @@ -4,7 +4,7 @@ suites: - "lucid" architectures: - "i386" -packages: +packages: - "mingw32" - "git-core" - "unzip" @@ -15,21 +15,21 @@ remotes: - "url": "https://git.gitorious.org/+bitcoin-stable-developers/bitcoin/bitcoind-stable.git" "dir": "bitcoin" files: -- "qt-win32-4.7.4-gitian.zip" -- "boost-win32-1.47.0-gitian.zip" -- "bitcoin-deps-0.0.4.zip" +- "qt-win32-4.8.2-gitian-r1.zip" +- "boost-win32-1.50.0-gitian2.zip" +- "bitcoin-deps-0.0.5.zip" script: | # mkdir $HOME/qt cd $HOME/qt - unzip ../build/qt-win32-4.7.4-gitian.zip + unzip ../build/qt-win32-4.8.2-gitian-r1.zip cd $HOME/build/ export PATH=$PATH:$HOME/qt/bin/ # - mkdir boost_1_47_0 - cd boost_1_47_0 + mkdir boost_1_50_0 + cd boost_1_50_0 mkdir -p stage/lib - unzip ../boost-win32-1.47.0-gitian.zip + unzip ../boost-win32-1.50.0-gitian2.zip cd bin/$GBUILD_BITS for lib in *; do i586-mingw32msvc-ar rc ../../stage/lib/libboost_${lib}-mt-s.a $lib/*.o @@ -39,7 +39,7 @@ script: | mv include/boost . cd .. # - unzip bitcoin-deps-0.0.4.zip + unzip bitcoin-deps-0.0.5.zip # find -type f | xargs touch --date="$REFERENCE_DATETIME" # @@ -47,11 +47,11 @@ script: | mkdir -p $OUTDIR/src git archive HEAD | tar -x -C $OUTDIR/src cp $OUTDIR/src/doc/README_windows.txt $OUTDIR/readme.txt - cp $OUTDIR/src/COPYING $OUTDIR/license.txt + cp $OUTDIR/src/COPYING $OUTDIR/COPYING.txt export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export FAKETIME=$REFERENCE_DATETIME export TZ=UTC - $HOME/qt/src/bin/qmake -spec unsupported/win32-g++-cross MINIUPNPC_LIB_PATH=$HOME/build/miniupnpc MINIUPNPC_INCLUDE_PATH=$HOME/build/ BDB_LIB_PATH=$HOME/build/db-4.8.30.NC/build_unix BDB_INCLUDE_PATH=$HOME/build/db-4.8.30.NC/build_unix BOOST_LIB_PATH=$HOME/build/boost_1_47_0/stage/lib BOOST_INCLUDE_PATH=$HOME/build/boost_1_47_0 BOOST_LIB_SUFFIX=-mt-s BOOST_THREAD_LIB_SUFFIX=_win32-mt-s OPENSSL_LIB_PATH=$HOME/build/openssl-1.0.1b OPENSSL_INCLUDE_PATH=$HOME/build/openssl-1.0.1b/include QRENCODE_LIB_PATH=$HOME/build/qrencode-3.2.0/.libs QRENCODE_INCLUDE_PATH=$HOME/build/qrencode-3.2.0 USE_QRCODE=1 INCLUDEPATH=$HOME/build DEFINES=BOOST_THREAD_USE_LIB BITCOIN_NEED_QT_PLUGINS=1 QMAKE_LRELEASE=lrelease QMAKE_CXXFLAGS=-frandom-seed=bitcoin QMAKE_LFLAGS=-frandom-seed=bitcoin USE_BUILD_INFO=1 + $HOME/qt/src/bin/qmake -spec unsupported/win32-g++-cross MINIUPNPC_LIB_PATH=$HOME/build/miniupnpc MINIUPNPC_INCLUDE_PATH=$HOME/build/ BDB_LIB_PATH=$HOME/build/db-4.8.30.NC/build_unix BDB_INCLUDE_PATH=$HOME/build/db-4.8.30.NC/build_unix BOOST_LIB_PATH=$HOME/build/boost_1_50_0/stage/lib BOOST_INCLUDE_PATH=$HOME/build/boost_1_50_0 BOOST_LIB_SUFFIX=-mt-s BOOST_THREAD_LIB_SUFFIX=_win32-mt-s OPENSSL_LIB_PATH=$HOME/build/openssl-1.0.1c OPENSSL_INCLUDE_PATH=$HOME/build/openssl-1.0.1c/include QRENCODE_LIB_PATH=$HOME/build/qrencode-3.2.0/.libs QRENCODE_INCLUDE_PATH=$HOME/build/qrencode-3.2.0 USE_QRCODE=1 INCLUDEPATH=$HOME/build DEFINES=BOOST_THREAD_USE_LIB BITCOIN_NEED_QT_PLUGINS=1 QMAKE_LRELEASE=lrelease QMAKE_CXXFLAGS=-frandom-seed=bitcoin QMAKE_LFLAGS=-frandom-seed=bitcoin USE_BUILD_INFO=1 make $MAKEOPTS cp release/bitcoin-qt.exe $OUTDIR/ # diff --git a/contrib/gitian-descriptors/qt-win32.yml b/contrib/gitian-descriptors/qt-win32.yml index 6eb76b2170..87887dec87 100644 --- a/contrib/gitian-descriptors/qt-win32.yml +++ b/contrib/gitian-descriptors/qt-win32.yml @@ -11,15 +11,15 @@ packages: reference_datetime: "2011-01-30 00:00:00" remotes: [] files: -- "qt-everywhere-opensource-src-4.7.4.tar.gz" +- "qt-everywhere-opensource-src-4.8.2.tar.gz" script: | INSTDIR="$HOME/qt/" mkdir $INSTDIR SRCDIR="$INSTDIR/src/" mkdir $SRCDIR # - tar xzf qt-everywhere-opensource-src-4.7.4.tar.gz - cd qt-everywhere-opensource-src-4.7.4 + tar xzf qt-everywhere-opensource-src-4.8.2.tar.gz + cd qt-everywhere-opensource-src-4.8.2 sed 's/$TODAY/2011-01-30/' -i configure sed 's/i686-pc-mingw32-/i586-mingw32msvc-/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf sed --posix 's|QMAKE_CFLAGS\t\t= -pipe|QMAKE_CFLAGS\t\t= -pipe -isystem /usr/i586-mingw32msvc/include/ -frandom-seed=qtbuild|' -i mkspecs/unsupported/win32-g++-cross/qmake.conf @@ -40,7 +40,7 @@ script: | #export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export FAKETIME=$REFERENCE_DATETIME export TZ=UTC - ./configure -prefix $INSTDIR -confirm-license -release -opensource -static -no-qt3support -xplatform unsupported/win32-g++-cross -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-declarative -no-script -no-scripttools -no-javascript-jit -no-webkit -no-svg -no-xmlpatterns -no-sql-sqlite -no-nis -no-cups -no-iconv -no-dbus -no-gif -no-libtiff -opengl no -nomake examples -nomake demos -nomake docs + ./configure -prefix $INSTDIR -confirm-license -release -opensource -static -no-qt3support -xplatform unsupported/win32-g++-cross -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-declarative -no-script -no-scripttools -no-javascript-jit -no-webkit -no-svg -no-xmlpatterns -no-sql-sqlite -no-nis -no-cups -no-iconv -no-dbus -no-gif -no-libtiff -no-opengl -nomake examples -nomake demos -nomake docs -no-feature-style-plastique -no-feature-style-cleanlooks -no-feature-style-motif -no-feature-style-cde -no-feature-style-windowsce -no-feature-style-windowsmobile -no-feature-style-s60 find . -name *.prl | xargs -l sed 's|/\.||' -i find . -name *.prl | xargs -l sed 's|/$||' -i make $MAKEOPTS install @@ -51,4 +51,4 @@ script: | # as zip stores file timestamps, use faketime to intercept stat calls to set dates for all files to reference date export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - zip -r $OUTDIR/qt-win32-4.7.4-gitian.zip * + zip -r $OUTDIR/qt-win32-4.8.2-gitian-r1.zip * diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index e159f9bbc3..16daa59b08 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -169,6 +169,9 @@ class DeploymentInfo(object): elif os.path.exists(os.path.join(parentDir, "share", "qt4", "translations")): # MacPorts layout, e.g. "/opt/local/share/qt4" self.qtPath = os.path.join(parentDir, "share", "qt4") + elif os.path.exists(os.path.join(os.path.dirname(parentDir), "share", "qt4", "translations")): + # Newer Macports layout + self.qtPath = os.path.join(os.path.dirname(parentDir), "share", "qt4") if self.qtPath is not None: pluginPath = os.path.join(self.qtPath, "plugins") @@ -725,7 +728,7 @@ if config.dmg is not None: disk.close() if bg_path is not None: subprocess.call(["SetFile", "-a", "V", bg_path]) - disk.update(registering_applications=False) +# disk.update(registering_applications=False) sleep(2) disk.eject() diff --git a/contrib/pyminer/pyminer.py b/contrib/pyminer/pyminer.py index 2887aba591..0a2932d66e 100755 --- a/contrib/pyminer/pyminer.py +++ b/contrib/pyminer/pyminer.py @@ -2,7 +2,7 @@ # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying -# file license.txt or http://www.opensource.org/licenses/mit-license.php. +# file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time diff --git a/contrib/testgen/README b/contrib/testgen/README new file mode 100644 index 0000000000..02d6c4cdc2 --- /dev/null +++ b/contrib/testgen/README @@ -0,0 +1 @@ +Utilities to generate test vectors for the data-driven Bitcoin tests diff --git a/contrib/testgen/base58.py b/contrib/testgen/base58.py new file mode 100644 index 0000000000..b716495145 --- /dev/null +++ b/contrib/testgen/base58.py @@ -0,0 +1,104 @@ +''' +Bitcoin base58 encoding and decoding. + +Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) +''' +import hashlib + +# for compatibility with following code... +class SHA256: + new = hashlib.sha256 + +if str != bytes: + # Python 3.x + def ord(c): + return c + def chr(n): + return bytes( (n,) ) + +__b58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +__b58base = len(__b58chars) +b58chars = __b58chars + +def b58encode(v): + """ encode v, which is a string of bytes, to base58. + """ + long_value = 0 + for (i, c) in enumerate(v[::-1]): + long_value += (256**i) * ord(c) + + result = '' + while long_value >= __b58base: + div, mod = divmod(long_value, __b58base) + result = __b58chars[mod] + result + long_value = div + result = __b58chars[long_value] + result + + # Bitcoin does a little leading-zero-compression: + # leading 0-bytes in the input become leading-1s + nPad = 0 + for c in v: + if c == '\0': nPad += 1 + else: break + + return (__b58chars[0]*nPad) + result + +def b58decode(v, length = None): + """ decode v into a string of len bytes + """ + long_value = 0 + for (i, c) in enumerate(v[::-1]): + long_value += __b58chars.find(c) * (__b58base**i) + + result = bytes() + while long_value >= 256: + div, mod = divmod(long_value, 256) + result = chr(mod) + result + long_value = div + result = chr(long_value) + result + + nPad = 0 + for c in v: + if c == __b58chars[0]: nPad += 1 + else: break + + result = chr(0)*nPad + result + if length is not None and len(result) != length: + return None + + return result + +def checksum(v): + """Return 32-bit checksum based on SHA256""" + return SHA256.new(SHA256.new(v).digest()).digest()[0:4] + +def b58encode_chk(v): + """b58encode a string, with 32-bit checksum""" + return b58encode(v + checksum(v)) + +def b58decode_chk(v): + """decode a base58 string, check and remove checksum""" + result = b58decode(v) + if result is None: + return None + h3 = checksum(result[:-4]) + if result[-4:] == checksum(result[:-4]): + return result[:-4] + else: + return None + +def get_bcaddress_version(strAddress): + """ Returns None if strAddress is invalid. Otherwise returns integer version of address. """ + addr = b58decode_chk(strAddress) + if addr is None or len(addr)!=21: return None + version = addr[0] + return ord(version) + +if __name__ == '__main__': + # Test case (from http://gitorious.org/bitcoin/python-base58.git) + assert get_bcaddress_version('15VjRaDX9zpbA8LVnbrCAFzrVzN7ixHNsC') is 0 + _ohai = 'o hai'.encode('ascii') + _tmp = b58encode(_ohai) + assert _tmp == 'DYB3oMS' + assert b58decode(_tmp, 5) == _ohai + print("Tests passed") diff --git a/contrib/testgen/gen_base58_test_vectors.py b/contrib/testgen/gen_base58_test_vectors.py new file mode 100755 index 0000000000..1813436953 --- /dev/null +++ b/contrib/testgen/gen_base58_test_vectors.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python +''' +Generate valid and invalid base58 address and private key test vectors. + +Usage: + gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json + gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json +''' +# 2012 Wladimir J. van der Laan +# Released under MIT License +import os +from itertools import islice +from base58 import b58encode, b58decode, b58encode_chk, b58decode_chk, b58chars +import random +from binascii import b2a_hex + +# key types +PUBKEY_ADDRESS = 0 +SCRIPT_ADDRESS = 5 +PUBKEY_ADDRESS_TEST = 111 +SCRIPT_ADDRESS_TEST = 196 +PRIVKEY = 128 +PRIVKEY_TEST = 239 + +metadata_keys = ['isPrivkey', 'isTestnet', 'addrType', 'isCompressed'] +# templates for valid sequences +templates = [ + # prefix, payload_size, suffix, metadata + # None = N/A + ((PUBKEY_ADDRESS,), 20, (), (False, False, 'pubkey', None)), + ((SCRIPT_ADDRESS,), 20, (), (False, False, 'script', None)), + ((PUBKEY_ADDRESS_TEST,), 20, (), (False, True, 'pubkey', None)), + ((SCRIPT_ADDRESS_TEST,), 20, (), (False, True, 'script', None)), + ((PRIVKEY,), 32, (), (True, False, None, False)), + ((PRIVKEY,), 32, (1,), (True, False, None, True)), + ((PRIVKEY_TEST,), 32, (), (True, True, None, False)), + ((PRIVKEY_TEST,), 32, (1,), (True, True, None, True)) +] + +def is_valid(v): + '''Check vector v for validity''' + result = b58decode_chk(v) + if result is None: + return False + valid = False + for template in templates: + prefix = str(bytearray(template[0])) + suffix = str(bytearray(template[2])) + if result.startswith(prefix) and result.endswith(suffix): + if (len(result) - len(prefix) - len(suffix)) == template[1]: + return True + return False + +def gen_valid_vectors(): + '''Generate valid test vectors''' + while True: + for template in templates: + prefix = str(bytearray(template[0])) + payload = os.urandom(template[1]) + suffix = str(bytearray(template[2])) + rv = b58encode_chk(prefix + payload + suffix) + assert is_valid(rv) + metadata = dict([(x,y) for (x,y) in zip(metadata_keys,template[3]) if y is not None]) + yield (rv, b2a_hex(payload), metadata) + +def gen_invalid_vector(template, corrupt_prefix, randomize_payload_size, corrupt_suffix): + '''Generate possibly invalid vector''' + if corrupt_prefix: + prefix = os.urandom(1) + else: + prefix = str(bytearray(template[0])) + + if randomize_payload_size: + payload = os.urandom(max(int(random.expovariate(0.5)), 50)) + else: + payload = os.urandom(template[1]) + + if corrupt_suffix: + suffix = os.urandom(len(template[2])) + else: + suffix = str(bytearray(template[2])) + + return b58encode_chk(prefix + payload + suffix) + +def randbool(p = 0.5): + '''Return True with P(p)''' + return random.random() < p + +def gen_invalid_vectors(): + '''Generate invalid test vectors''' + # start with some manual edge-cases + yield "", + yield "x", + while True: + # kinds of invalid vectors: + # invalid prefix + # invalid payload length + # invalid (randomized) suffix (add random data) + # corrupt checksum + for template in templates: + val = gen_invalid_vector(template, randbool(0.2), randbool(0.2), randbool(0.2)) + if random.randint(0,10)<1: # line corruption + if randbool(): # add random character to end + val += random.choice(b58chars) + else: # replace random character in the middle + n = random.randint(0, len(val)) + val = val[0:n] + random.choice(b58chars) + val[n+1:] + if not is_valid(val): + yield val, + +if __name__ == '__main__': + import sys, json + iters = {'valid':gen_valid_vectors, 'invalid':gen_invalid_vectors} + try: + uiter = iters[sys.argv[1]] + except IndexError: + uiter = gen_valid_vectors + try: + count = int(sys.argv[2]) + except IndexError: + count = 0 + + data = list(islice(uiter(), count)) + json.dump(data, sys.stdout, sort_keys=True, indent=4) + sys.stdout.write('\n') + |