| 1 |
# Copyright 1999-2013 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.4.8_rc3.ebuild,v 1.2 2013/01/13 22:34:40 blueness Exp $ |
| 4 |
|
| 5 |
EAPI=4 |
| 6 |
|
| 7 |
DB_VER="4.8" |
| 8 |
|
| 9 |
inherit db-use eutils versionator |
| 10 |
|
| 11 |
DESCRIPTION="Original Bitcoin crypto-currency wallet for automated services" |
| 12 |
HOMEPAGE="http://bitcoin.org/" |
| 13 |
SRC_URI="http://gitorious.org/bitcoin/${PN}-stable/archive-tarball/v${PV/_/} -> bitcoin-v${PV}.tgz |
| 14 |
bip16? ( http://luke.dashjr.org/programs/bitcoin/files/bip16/0.4.7-Minimal-support-for-mining-BIP16-pay-to-script-hash-.patch.xz ) |
| 15 |
eligius? ( |
| 16 |
!bip16? ( http://luke.dashjr.org/programs/bitcoin/files/eligius_sendfee/0.4.5rc1-eligius_sendfee.patch.xz ) |
| 17 |
) |
| 18 |
" |
| 19 |
|
| 20 |
LICENSE="MIT ISC GPL-2" |
| 21 |
SLOT="0" |
| 22 |
KEYWORDS="~amd64 ~x86" |
| 23 |
IUSE="+bip16 +eligius logrotate ssl upnp" |
| 24 |
|
| 25 |
RDEPEND=" |
| 26 |
>=dev-libs/boost-1.41.0[threads(+)] |
| 27 |
dev-libs/crypto++ |
| 28 |
dev-libs/openssl[-bindist] |
| 29 |
logrotate? ( |
| 30 |
app-admin/logrotate |
| 31 |
) |
| 32 |
upnp? ( |
| 33 |
net-libs/miniupnpc |
| 34 |
) |
| 35 |
sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx] |
| 36 |
" |
| 37 |
DEPEND="${RDEPEND} |
| 38 |
>=app-shells/bash-4.1 |
| 39 |
" |
| 40 |
|
| 41 |
S="${WORKDIR}/bitcoin-${PN}-stable" |
| 42 |
|
| 43 |
pkg_setup() { |
| 44 |
local UG='bitcoin' |
| 45 |
enewgroup "${UG}" |
| 46 |
enewuser "${UG}" -1 -1 /var/lib/bitcoin "${UG}" |
| 47 |
} |
| 48 |
|
| 49 |
src_prepare() { |
| 50 |
cd src || die |
| 51 |
cp "${FILESDIR}/0.4.2-Makefile.gentoo" "Makefile" || die |
| 52 |
if use bip16; then |
| 53 |
epatch "${WORKDIR}/0.4.7-Minimal-support-for-mining-BIP16-pay-to-script-hash-.patch" |
| 54 |
use eligius && epatch "${FILESDIR}/0.4.4+bip16-eligius_sendfee.patch" |
| 55 |
else |
| 56 |
use eligius && epatch "${WORKDIR}/0.4.5rc1-eligius_sendfee.patch" |
| 57 |
fi |
| 58 |
use logrotate && epatch "${FILESDIR}/0.4.7-reopen_log_file.patch" |
| 59 |
} |
| 60 |
|
| 61 |
src_compile() { |
| 62 |
local OPTS=() |
| 63 |
|
| 64 |
OPTS+=("CXXFLAGS=${CXXFLAGS}") |
| 65 |
OPTS+=( "LDFLAGS=${LDFLAGS}") |
| 66 |
|
| 67 |
OPTS+=("DB_CXXFLAGS=-I$(db_includedir "${DB_VER}")") |
| 68 |
OPTS+=("DB_LDFLAGS=-ldb_cxx-${DB_VER}") |
| 69 |
|
| 70 |
use ssl && OPTS+=(USE_SSL=1) |
| 71 |
use upnp && OPTS+=(USE_UPNP=1) |
| 72 |
|
| 73 |
cd src || die |
| 74 |
emake "${OPTS[@]}" ${PN} |
| 75 |
} |
| 76 |
|
| 77 |
src_install() { |
| 78 |
dobin src/${PN} |
| 79 |
|
| 80 |
insinto /etc/bitcoin |
| 81 |
newins "${FILESDIR}/bitcoin.conf" bitcoin.conf |
| 82 |
fowners bitcoin:bitcoin /etc/bitcoin/bitcoin.conf |
| 83 |
fperms 600 /etc/bitcoin/bitcoin.conf |
| 84 |
|
| 85 |
newconfd "${FILESDIR}/bitcoin.confd" ${PN} |
| 86 |
newinitd "${FILESDIR}/bitcoin.initd" ${PN} |
| 87 |
|
| 88 |
keepdir /var/lib/bitcoin/.bitcoin |
| 89 |
fperms 700 /var/lib/bitcoin |
| 90 |
fowners bitcoin:bitcoin /var/lib/bitcoin/ |
| 91 |
fowners bitcoin:bitcoin /var/lib/bitcoin/.bitcoin |
| 92 |
dosym /etc/bitcoin/bitcoin.conf /var/lib/bitcoin/.bitcoin/bitcoin.conf |
| 93 |
|
| 94 |
dodoc doc/README |
| 95 |
|
| 96 |
if use logrotate; then |
| 97 |
insinto /etc/logrotate.d |
| 98 |
newins "${FILESDIR}/bitcoind.logrotate" bitcoind |
| 99 |
fi |
| 100 |
} |