| 1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/net-p2p/bitcoind/bitcoind-0.5.3.ebuild,v 1.5 2012/03/25 10:34:09 tomka Exp $ |
| 4 |
|
| 5 |
EAPI="4" |
| 6 |
|
| 7 |
DB_VER="4.8" |
| 8 |
|
| 9 |
inherit db-use eutils versionator toolchain-funcs |
| 10 |
|
| 11 |
DESCRIPTION="Original Bitcoin crypto-currency wallet for automated services" |
| 12 |
HOMEPAGE="http://bitcoin.org/" |
| 13 |
SRC_URI="http://gitorious.org/bitcoin/bitcoind-stable/archive-tarball/v${PV/_/} -> bitcoin-v${PV}.tgz |
| 14 |
eligius? ( http://luke.dashjr.org/programs/bitcoin/files/0.5.2-eligius_sendfee.patch.xz ) |
| 15 |
" |
| 16 |
|
| 17 |
LICENSE="MIT ISC" |
| 18 |
SLOT="0" |
| 19 |
KEYWORDS="amd64 ~arm x86" |
| 20 |
IUSE="+eligius examples ssl upnp" |
| 21 |
|
| 22 |
RDEPEND=" |
| 23 |
>=dev-libs/boost-1.41.0 |
| 24 |
dev-libs/openssl[-bindist] |
| 25 |
upnp? ( |
| 26 |
net-libs/miniupnpc |
| 27 |
) |
| 28 |
sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx] |
| 29 |
" |
| 30 |
DEPEND="${RDEPEND} |
| 31 |
>=app-shells/bash-4.1 |
| 32 |
" |
| 33 |
|
| 34 |
S="${WORKDIR}/bitcoin-bitcoind-stable" |
| 35 |
|
| 36 |
pkg_setup() { |
| 37 |
local UG='bitcoin' |
| 38 |
enewgroup "${UG}" |
| 39 |
enewuser "${UG}" -1 -1 /var/lib/bitcoin "${UG}" |
| 40 |
} |
| 41 |
|
| 42 |
src_prepare() { |
| 43 |
cd src || die |
| 44 |
epatch "${FILESDIR}"/${PN}-remove-debug.patch |
| 45 |
use eligius && epatch "${WORKDIR}/0.5.2-eligius_sendfee.patch" |
| 46 |
} |
| 47 |
|
| 48 |
src_compile() { |
| 49 |
local OPTS=() |
| 50 |
local BOOST_PKG BOOST_VER BOOST_INC |
| 51 |
|
| 52 |
OPTS+=("CXXFLAGS=${CXXFLAGS}") |
| 53 |
OPTS+=("LDFLAGS=${LDFLAGS}") |
| 54 |
|
| 55 |
OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")") |
| 56 |
OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}") |
| 57 |
|
| 58 |
BOOST_PKG="$(best_version 'dev-libs/boost')" |
| 59 |
BOOST_VER="$(get_version_component_range 1-2 "${BOOST_PKG/*boost-/}")" |
| 60 |
BOOST_VER="$(replace_all_version_separators _ "${BOOST_VER}")" |
| 61 |
BOOST_INC="/usr/include/boost-${BOOST_VER}" |
| 62 |
OPTS+=("BOOST_INCLUDE_PATH=${BOOST_INC}") |
| 63 |
OPTS+=("BOOST_LIB_SUFFIX=-${BOOST_VER}") |
| 64 |
|
| 65 |
use ssl && OPTS+=(USE_SSL=1) |
| 66 |
if use upnp; then |
| 67 |
OPTS+=(USE_UPNP=1) |
| 68 |
else |
| 69 |
OPTS+=(USE_UPNP=) |
| 70 |
fi |
| 71 |
|
| 72 |
cd src || die |
| 73 |
emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" ${PN} |
| 74 |
} |
| 75 |
|
| 76 |
src_install() { |
| 77 |
dobin src/${PN} |
| 78 |
|
| 79 |
insinto /etc/bitcoin |
| 80 |
newins "${FILESDIR}/bitcoin.conf" bitcoin.conf |
| 81 |
fowners bitcoin:bitcoin /etc/bitcoin/bitcoin.conf |
| 82 |
fperms 600 /etc/bitcoin/bitcoin.conf |
| 83 |
|
| 84 |
newconfd "${FILESDIR}/bitcoin.confd" ${PN} |
| 85 |
newinitd "${FILESDIR}/bitcoin.initd" ${PN} |
| 86 |
|
| 87 |
keepdir /var/lib/bitcoin/.bitcoin |
| 88 |
fperms 700 /var/lib/bitcoin |
| 89 |
fowners bitcoin:bitcoin /var/lib/bitcoin/ |
| 90 |
fowners bitcoin:bitcoin /var/lib/bitcoin/.bitcoin |
| 91 |
dosym /etc/bitcoin/bitcoin.conf /var/lib/bitcoin/.bitcoin/bitcoin.conf |
| 92 |
|
| 93 |
dodoc doc/README |
| 94 |
|
| 95 |
if use examples; then |
| 96 |
docinto examples |
| 97 |
dodoc -r contrib/{bitrpc,pyminer,wallettools} |
| 98 |
fi |
| 99 |
} |