fixed dogecoin init.d for 1.8, removed old versions
[portage-squeep] / net-p2p / dogecoind / dogecoind-1.8.0.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 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="debug examples logrotate upnp +wallet test"
21
22 RDEPEND="
23 >=dev-libs/boost-1.48.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 eautoreconf
48 }
49
50 src_configure() {
51 econf \
52 $(use_enable wallet) \
53 $(use_enable test tests) \
54 --disable-hardening \
55 $(use_enable debug) \
56 $(use_with upnp miniupnpc) \
57 --with-gui=no
58 }
59
60 src_test() {
61 emake check
62 }
63
64 src_install() {
65 dobin "src/${PN}"
66 dobin "src/dogecoin-cli"
67
68 insinto /etc/dogecoin
69 newins "${FILESDIR}/dogecoin.conf" dogecoin.conf
70 fowners dogecoin:dogecoin /etc/dogecoin/dogecoin.conf
71 fperms 600 /etc/dogecoin/dogecoin.conf
72
73 newconfd "${FILESDIR}/dogecoin.confd" "${PN}"
74 newinitd "${FILESDIR}/dogecoin.initd" "${PN}"
75 # systemd_dounit "${FILESDIR}/dogecoind.service"
76
77 keepdir /var/lib/dogecoin/.dogecoin
78 fperms 700 /var/lib/dogecoin
79 fowners dogecoin:dogecoin /var/lib/dogecoin/
80 fowners dogecoin:dogecoin /var/lib/dogecoin/.dogecoin
81 dosym /etc/dogecoin/dogecoin.conf /var/lib/dogecoin/.dogecoin/dogecoin.conf
82
83 dodoc doc/README.md RELEASE_NOTES_1_8.md
84 # doman contrib/debian/manpages/{dogecoind.1,dogecoin.conf.5}
85
86 # if use bash-completion; then
87 # newbashcomp "contrib/${PN}.bash-completion" "${PN}"
88 # fi
89
90 if use examples; then
91 docinto examples
92 dodoc -r contrib/{README.md,bitrpc,pyminer,spendfrom,linearize,qos}
93 fi
94
95 if use logrotate; then
96 insinto /etc/logrotate.d
97 newins "${FILESDIR}/dogecoind.logrotate" dogecoind
98 fi
99 }