911ea5f83bc13824661b03ad2e9a39df37a5f895
[portage-squeep] / net-p2p / dogecoind / dogecoind-1.7.0-r1.ebuild
1 # Distributed under the terms of the GNU General Public License v2
2
3 EAPI="5"
4
5 DB_VER="5.1"
6
7 inherit autotools bash-completion-r1 db-use eutils versionator systemd user
8
9 MyPV="${PV/_/}"
10 MyPN="dogecoin"
11 MyP="${MyPN}-${MyPV}"
12
13 DESCRIPTION="P2P Internet currency based on Bitcoin but wow such doge"
14 HOMEPAGE="https://dogecoin.com/"
15 SRC_URI="https://github.com/${MyPN}/${MyPN}/archive/v${MyPV}.tar.gz -> ${MyPN}-v${PV}.tgz"
16
17 LICENSE="MIT ISC GPL-2"
18 SLOT="0"
19 KEYWORDS="~amd64 ~x86"
20 IUSE="bash-completion debug examples ipv6 logrotate upnp +wallet"
21
22 RDEPEND="
23 >=dev-libs/boost-1.41.0[threads(+)]
24 dev-libs/openssl:0[-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 sys-apps/sed
36 "
37
38 S="${WORKDIR}/${MyP}"
39
40 pkg_setup() {
41 local UG='dogecoin'
42 enewgroup "${UG}"
43 enewuser "${UG}" -1 -1 /var/lib/dogecoin "${UG}"
44 }
45
46 src_prepare() {
47 # bitcoin for some reason doesn't use embedded leveldb
48 # but we will, because version/bug pinning is a good thing
49 # rm -r src/leveldb
50 # sed -e 's/^\(LIBLEVELDB=\).*$/\1-lleveldb/' \
51 # -e 's/^\(LIBMEMENV=\).*$/\1-lmemenv/' \
52 # -e 's/^\(AM_CONDITIONAL(\[EMBEDDED_LEVELDB\],\[\).*\(\])\)$/\1false\2/' \
53 # -i configure.ac
54
55 eautoreconf
56 }
57
58 src_configure() {
59 econf \
60 --disable-silent-rules \
61 $(use_enable wallet) \
62 $(use_enable ipv6) \
63 $(use_enable test tests) \
64 --disable-hardening \
65 --disable-ccache \
66 $(use_enable debug) \
67 $(use_with upnp miniupnpc) \
68 --without-gui
69 }
70
71 src_test() {
72 emake check
73 }
74
75 src_install() {
76 dobin "src/${PN}"
77
78 insinto /etc/dogecoin
79 newins "${FILESDIR}/dogecoin.conf" dogecoin.conf
80 fowners dogecoin:dogecoin /etc/dogecoin/dogecoin.conf
81 fperms 600 /etc/dogecoin/dogecoin.conf
82
83 newconfd "${FILESDIR}/dogecoin.confd" "${PN}"
84 newinitd "${FILESDIR}/dogecoin.initd-r1" "${PN}"
85 systemd_dounit "${FILESDIR}/dogecoind.service"
86
87 keepdir /var/lib/dogecoin/.dogecoin
88 fperms 700 /var/lib/dogecoin
89 fowners dogecoin:dogecoin /var/lib/dogecoin/
90 fowners dogecoin:dogecoin /var/lib/dogecoin/.dogecoin
91 dosym /etc/dogecoin/dogecoin.conf /var/lib/dogecoin/.dogecoin/dogecoin.conf
92
93 dodoc doc/README.md doc/release-notes.md
94 doman contrib/debian/manpages/{dogecoind.1,dogecoin.conf.5}
95
96 if use bash-completion; then
97 newbashcomp "contrib/${PN}.bash-completion" "${PN}"
98 fi
99
100 if use examples; then
101 docinto examples
102 dodoc -r contrib/{README.md,bitrpc,pyminer,spendfrom,linearize,qos}
103 fi
104
105 if use logrotate; then
106 insinto /etc/logrotate.d
107 newins "${FILESDIR}/dogecoind.logrotate" dogecoind
108 fi
109 }