| 1 |
blueness |
1.1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
|
|
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
blueness |
1.2 |
# $Header: /var/cvsroot/gentoo-x86/net-p2p/bitcoind/bitcoind-0.7.0.ebuild,v 1.1 2012/10/08 18:04:56 blueness Exp $
|
| 4 |
blueness |
1.1 |
|
| 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="https://nodeload.github.com/bitcoin/bitcoin/tarball/v${PV/_/} -> bitcoin-v${PV}.tgz
|
| 14 |
|
|
eligius? ( http://luke.dashjr.org/programs/bitcoin/files/bitcoind/eligius/sendfee/0.7.0-eligius_sendfee.patch.xz )
|
| 15 |
|
|
"
|
| 16 |
|
|
|
| 17 |
|
|
LICENSE="MIT ISC GPL-2"
|
| 18 |
|
|
SLOT="0"
|
| 19 |
|
|
KEYWORDS="~amd64 ~arm ~x86"
|
| 20 |
|
|
IUSE="+eligius examples ipv6 logrotate upnp"
|
| 21 |
|
|
|
| 22 |
|
|
RDEPEND="
|
| 23 |
|
|
>=dev-libs/boost-1.41.0
|
| 24 |
|
|
dev-libs/openssl[-bindist]
|
| 25 |
|
|
logrotate? (
|
| 26 |
|
|
app-admin/logrotate
|
| 27 |
|
|
)
|
| 28 |
|
|
upnp? (
|
| 29 |
|
|
net-libs/miniupnpc
|
| 30 |
|
|
)
|
| 31 |
|
|
sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
|
| 32 |
|
|
"
|
| 33 |
|
|
DEPEND="${RDEPEND}
|
| 34 |
|
|
>=app-shells/bash-4.1
|
| 35 |
|
|
"
|
| 36 |
|
|
|
| 37 |
|
|
S="${WORKDIR}/bitcoin-bitcoin-a76c22e"
|
| 38 |
|
|
|
| 39 |
|
|
pkg_setup() {
|
| 40 |
|
|
local UG='bitcoin'
|
| 41 |
|
|
enewgroup "${UG}"
|
| 42 |
|
|
enewuser "${UG}" -1 -1 /var/lib/bitcoin "${UG}"
|
| 43 |
|
|
}
|
| 44 |
|
|
|
| 45 |
|
|
src_prepare() {
|
| 46 |
|
|
cd src || die
|
| 47 |
|
|
use eligius && epatch "${WORKDIR}/0.7.0-eligius_sendfee.patch"
|
| 48 |
|
|
}
|
| 49 |
|
|
|
| 50 |
|
|
src_compile() {
|
| 51 |
|
|
OPTS=()
|
| 52 |
|
|
local BOOST_PKG BOOST_VER BOOST_INC
|
| 53 |
|
|
|
| 54 |
|
|
OPTS+=("DEBUGFLAGS=")
|
| 55 |
|
|
OPTS+=("CXXFLAGS=${CXXFLAGS}")
|
| 56 |
|
|
OPTS+=("LDFLAGS=${LDFLAGS}")
|
| 57 |
|
|
|
| 58 |
|
|
OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
|
| 59 |
|
|
OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
|
| 60 |
|
|
|
| 61 |
|
|
BOOST_PKG="$(best_version 'dev-libs/boost')"
|
| 62 |
|
|
BOOST_VER="$(get_version_component_range 1-2 "${BOOST_PKG/*boost-/}")"
|
| 63 |
|
|
BOOST_VER="$(replace_all_version_separators _ "${BOOST_VER}")"
|
| 64 |
|
|
BOOST_INC="/usr/include/boost-${BOOST_VER}"
|
| 65 |
|
|
OPTS+=("BOOST_INCLUDE_PATH=${BOOST_INC}")
|
| 66 |
|
|
OPTS+=("BOOST_LIB_SUFFIX=-${BOOST_VER}")
|
| 67 |
|
|
|
| 68 |
|
|
if use upnp; then
|
| 69 |
|
|
OPTS+=(USE_UPNP=1)
|
| 70 |
|
|
else
|
| 71 |
|
|
OPTS+=(USE_UPNP=)
|
| 72 |
|
|
fi
|
| 73 |
|
|
use ipv6 || OPTS+=("USE_IPV6=-")
|
| 74 |
|
|
|
| 75 |
blueness |
1.2 |
# Workaround for bug #440034
|
| 76 |
|
|
share/genbuild.sh src/obj/build.h
|
| 77 |
|
|
|
| 78 |
blueness |
1.1 |
cd src || die
|
| 79 |
|
|
emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" ${PN}
|
| 80 |
|
|
}
|
| 81 |
|
|
|
| 82 |
|
|
src_test() {
|
| 83 |
|
|
cd src || die
|
| 84 |
|
|
emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" test_bitcoin
|
| 85 |
|
|
./test_bitcoin || die 'Tests failed'
|
| 86 |
|
|
}
|
| 87 |
|
|
|
| 88 |
|
|
src_install() {
|
| 89 |
|
|
dobin src/${PN}
|
| 90 |
|
|
|
| 91 |
|
|
insinto /etc/bitcoin
|
| 92 |
|
|
newins "${FILESDIR}/bitcoin.conf" bitcoin.conf
|
| 93 |
|
|
fowners bitcoin:bitcoin /etc/bitcoin/bitcoin.conf
|
| 94 |
|
|
fperms 600 /etc/bitcoin/bitcoin.conf
|
| 95 |
|
|
|
| 96 |
|
|
newconfd "${FILESDIR}/bitcoin.confd" ${PN}
|
| 97 |
|
|
newinitd "${FILESDIR}/bitcoin.initd" ${PN}
|
| 98 |
|
|
|
| 99 |
|
|
keepdir /var/lib/bitcoin/.bitcoin
|
| 100 |
|
|
fperms 700 /var/lib/bitcoin
|
| 101 |
|
|
fowners bitcoin:bitcoin /var/lib/bitcoin/
|
| 102 |
|
|
fowners bitcoin:bitcoin /var/lib/bitcoin/.bitcoin
|
| 103 |
|
|
dosym /etc/bitcoin/bitcoin.conf /var/lib/bitcoin/.bitcoin/bitcoin.conf
|
| 104 |
|
|
|
| 105 |
|
|
dodoc doc/README
|
| 106 |
|
|
|
| 107 |
|
|
if use examples; then
|
| 108 |
|
|
docinto examples
|
| 109 |
|
|
dodoc -r contrib/{bitrpc,pyminer,wallettools}
|
| 110 |
|
|
fi
|
| 111 |
|
|
|
| 112 |
|
|
if use logrotate; then
|
| 113 |
|
|
insinto /etc/logrotate.d
|
| 114 |
|
|
newins "${FILESDIR}/bitcoind.logrotate" bitcoind
|
| 115 |
|
|
fi
|
| 116 |
|
|
}
|