Created
September 9, 2013 01:44
-
-
Save manpages/6490467 to your computer and use it in GitHub Desktop.
PKGBUILD-like script to install bitcoind and bitcoin-qt on Ubuntu LTS 12.04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# PKGBUILD-like script to install bitcoind and bitcoin-qt on Ubuntu LTS 12.04 | |
install_bitcoin() { | |
pkgbase=bitcoin | |
pkgname=('bitcoin-daemon' 'bitcoin-qt') | |
pkgver=0.8.4 | |
pkgrel=3 | |
arch=('i686' 'x86_64') | |
url="http://www.bitcoin.org/" | |
makedepends=('sudo' \ | |
'libboost-dev' \ | |
'libboost-filesystem-dev' \ | |
'libboost-system-dev' \ | |
'libboost-program-options-dev' \ | |
'libboost-thread-dev' \ | |
'automoc' \ | |
'libqrencode-dev' \ | |
'libminiupnpc-dev' \ | |
'libdb++-dev') | |
depends=('openssl' 'qrencode' 'miniupnpc' 'libboost-dev') | |
license=('MIT') | |
sourcetar="bitcoin-$pkgver-linux.tar.gz" | |
source=(http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-$pkgver/$sourcetar) | |
sha256sums=('cd746a4ab3b656e41e3f09722a7336fb978eb726bae55591314f1dad60759ecc') | |
echo "Downloading bitcoind sources..." | |
[ ! -f $sourcetar ] && wget $source || echo "(Already downloaded)" | |
echo "Verifying hash..." | |
localsha=($(sha256sum $sourcetar)) | |
[ "${localsha[0]}" == "${sha256sums[0]}" ] && echo "OK" || return 142 | |
echo "Unpacking sources..." | |
[ ! -d "$pkgbase-$pkgver-linux" ] &&\ | |
tar -xzvf $sourcetar || echo "(Already extracted)" | |
cd "$pkgbase-$pkgver-linux/src" | |
echo "Checking make-dependencies..." | |
for x in ${makedepends[@]}; do | |
echo "Checking $x..." | |
dpkg-query -l $x && echo "OK" || yes | sudo apt-get install $x | |
done | |
echo | |
echo "Making Qt GUI..." | |
qmake-qt4 USE_QRCODE=1 &&\ | |
make && echo "OK" || return 142 | |
echo "Making Bitcoind..." | |
make -f makefile.unix -C src CXXFLAGS="$CXXFLAGS" && echo "OK" || return 142 | |
echo "Checking dependencies..." | |
for x in ${depends[@]}; do | |
echo "Checking $x..." | |
dpkg-query -l $x && echo "OK" || yes | sudo apt-get install $x | |
done | |
echo | |
echo "Installing bitcoin-qt to /usr/bin/bitcoin-qt..." | |
sudo install -Dm755 bitcoin-qt /usr/bin/bitcoin-qt && echo "OK" || return 142 | |
echo "Installing .desktop..." | |
sudo install -Dm644 contrib/debian/bitcoin-qt.desktop \ | |
/usr/share/applications/bitcoin.desktop && echo "OK" || return 142 | |
echo "Installing pixmap..." | |
sudo install -Dm644 share/pixmaps/bitcoin128.png \ | |
/usr/share/pixmaps/bitcoin128.png && echo "OK" || return 142 | |
echo "Installing bitcoind to /usr/bin/bitcoind..." | |
sudo install -Dm755 src/bitcoind /usr/bin/bitcoind && echo "OK" || return 142 | |
echo "Installing example bitcoin.conf to /usr/share/doc/$pkgname/examples/bitcoin.conf..." | |
sudo mkdir -p "/usr/share/doc/$pkgname/examples" | |
sudo install -Dm644 contrib/debian/examples/bitcoin.conf \ | |
"/usr/share/doc/$pkgname/examples/bitcoin.conf" && echo "OK" || return 142 | |
echo "Installing manpage 1..." | |
sudo install -Dm644 contrib/debian/manpages/bitcoind.1 \ | |
/usr/share/man/man1/bitcoind.1 && echo "OK" || return 142 | |
echo "Installing manpage 2..." | |
sudo install -Dm644 contrib/debian/manpages/bitcoin.conf.5 \ | |
/usr/share/man/man5/bitcoin.conf.5 | |
} | |
install_bitcoin && echo "Success!" || echo "Fail, look for the last procedure description “e.g Making Bitcoind...” and see what went wrong." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment