net-p2p/bitcoind-0.13.1-r0: stable on amd64
[gentoo.git] / net-p2p / bitcoind / bitcoind-0.13.1.ebuild
1 # Copyright 2010-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 BITCOINCORE_COMMITHASH="03422e564b552c1d3c16ae854f8471f7cb39e25d"
8 BITCOINCORE_LJR_DATE="20161027"
9 BITCOINCORE_IUSE="examples ljr test upnp +wallet zeromq"
10 BITCOINCORE_POLICY_PATCHES="+rbf spamfilter"
11 BITCOINCORE_NEED_LEVELDB=1
12 BITCOINCORE_NEED_LIBSECP256K1=1
13 inherit bash-completion-r1 bitcoincore user systemd
14
15 DESCRIPTION="Original Bitcoin crypto-currency wallet for automated services"
16 LICENSE="MIT"
17 SLOT="0"
18 KEYWORDS="amd64 ~arm ~arm64 ~mips ~ppc ~x86 ~amd64-linux ~x86-linux"
19
20 pkg_setup() {
21         local UG='bitcoin'
22         enewgroup "${UG}"
23         enewuser "${UG}" -1 -1 /var/lib/bitcoin "${UG}"
24 }
25
26 src_prepare() {
27         sed -i 's/have bitcoind &&//;s/^\(complete -F _bitcoind bitcoind\) bitcoin-cli$/\1/' contrib/${PN}.bash-completion || die
28         bitcoincore_src_prepare
29 }
30
31 src_configure() {
32         bitcoincore_conf \
33                 --with-daemon
34 }
35
36 src_install() {
37         bitcoincore_src_install
38
39         insinto /etc/bitcoin
40         newins "${FILESDIR}/bitcoin.conf" bitcoin.conf
41         fowners bitcoin:bitcoin /etc/bitcoin/bitcoin.conf
42         fperms 600 /etc/bitcoin/bitcoin.conf
43
44         newconfd "contrib/init/bitcoind.openrcconf" ${PN}
45         newinitd "contrib/init/bitcoind.openrc" ${PN}
46         systemd_dounit "${FILESDIR}/bitcoind.service"
47
48         keepdir /var/lib/bitcoin/.bitcoin
49         fperms 700 /var/lib/bitcoin
50         fowners bitcoin:bitcoin /var/lib/bitcoin/
51         fowners bitcoin:bitcoin /var/lib/bitcoin/.bitcoin
52         dosym /etc/bitcoin/bitcoin.conf /var/lib/bitcoin/.bitcoin/bitcoin.conf
53
54         dodoc doc/assets-attribution.md doc/bips.md doc/tor.md
55         doman contrib/debian/manpages/{bitcoind.1,bitcoin.conf.5}
56
57         use zeromq && dodoc doc/zmq.md
58
59         newbashcomp contrib/${PN}.bash-completion ${PN}
60
61         if use examples; then
62                 docinto examples
63                 dodoc -r contrib/{qos,spendfrom,tidy_datadir.sh}
64                 use zeromq && dodoc -r contrib/zmq
65         fi
66
67         insinto /etc/logrotate.d
68         newins "${FILESDIR}/bitcoind.logrotate-r1" bitcoind
69 }