dogecoind-1.7.0-r1 manifest updated
[portage-squeep] / net-p2p / dogecoind / dogecoind-1.5.1.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 bash-completion-r1 db-use eutils 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}-project/${MyPN}/archive/${MyPV}.tar.gz -> ${MyP}.tar.gz"
16 SRC_URI="https://github.com/${MyPN}/${MyPN}/archive/${MyPV}.tar.gz -> ${MyP}.tar.gz"
17
18 LICENSE="MIT ISC GPL-2"
19 SLOT="0"
20 KEYWORDS="amd64 x86"
21 IUSE="bash-completion examples ipv6 logrotate upnp"
22
23 RDEPEND="
24 dev-libs/boost[threads(+)]
25 dev-libs/openssl:0[-bindist]
26 logrotate? (
27 app-admin/logrotate
28 )
29 upnp? (
30 net-libs/miniupnpc
31 )
32 sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
33 <=dev-libs/leveldb-1.12.0[-snappy]
34 "
35 DEPEND="${RDEPEND}
36 >=app-shells/bash-4.1
37 sys-apps/sed
38 "
39
40 S="${WORKDIR}/${MyP}"
41
42 pkg_setup() {
43 local UG='dogecoin'
44 enewgroup "${UG}"
45 enewuser "${UG}" -1 -1 /var/lib/dogecoin "${UG}"
46 }
47
48 src_prepare() {
49 # epatch "${FILESDIR}"/${MyPN}-sys_leveldb.patch
50 # rm -r src/leveldb
51
52 if has_version '>=dev-libs/boost-1.52'; then
53 sed -i 's/\(-l db_cxx\)/-l boost_chrono$(BOOST_LIB_SUFFIX) \1/' src/makefile.unix
54 fi
55 }
56
57 src_configure() {
58 OPTS=()
59
60 OPTS+=("DEBUGFLAGS=")
61 OPTS+=("CXXFLAGS=${CXXFLAGS}")
62 OPTS+=("LDFLAGS=${LDFLAGS}")
63
64 if use upnp; then
65 OPTS+=("USE_UPNP=1")
66 else
67 OPTS+=("USE_UPNP=-")
68 fi
69
70 use ipv6 || OPTS+=("USE_IPV6=-")
71
72 OPTS+=("USE_SYSTEM_LEVELDB=1")
73 OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
74 OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
75
76 cd src || die
77 emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" ${PN}
78 }
79
80 #Tests are broken with and without our dogecoin-sys_leveldb.patch.
81 #When tests work, make sure to inherit toolchain-funcs
82 #src_test() {
83 # cd src || die
84 # emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" test_dogecoin
85 # ./test_dogecoin || die 'Tests failed'
86 #}
87
88 src_install() {
89 dobin src/${PN}
90
91 insinto /etc/dogecoin
92 doins "${FILESDIR}/dogecoin.conf"
93 fowners dogecoin:dogecoin /etc/dogecoin/dogecoin.conf
94 fperms 600 /etc/dogecoin/dogecoin.conf
95
96 newconfd "${FILESDIR}/dogecoin.confd" ${PN}
97 newinitd "${FILESDIR}/dogecoin.initd" ${PN}
98 systemd_dounit "${FILESDIR}/dogecoin.service"
99
100 keepdir /var/lib/dogecoin/.dogecoin
101 fperms 700 /var/lib/dogecoin
102 fowners dogecoin:dogecoin /var/lib/dogecoin/
103 fowners dogecoin:dogecoin /var/lib/dogecoin/.dogecoin
104 dosym /etc/dogecoin/dogecoin.conf /var/lib/dogecoin/.dogecoin/dogecoin.conf
105
106 # dodoc doc/README.md doc/release-notes.md
107 # newman contrib/debian/manpages/bitcoind.1 dogecoind.1
108 # newman contrib/debian/manpages/bitcoin.conf.5 dogecoin.conf.5
109
110 if use bash-completion; then
111 :;
112 # newbashcomp contrib/bitcoind.bash-completion ${PN}.bash-completion
113 fi
114
115 if use examples; then
116 docinto examples
117 # dodoc -r contrib/{bitrpc,pyminer,spendfrom,tidy_datadir.sh,wallettools}
118 fi
119
120 if use logrotate; then
121 insinto /etc/logrotate.d
122 newins "${FILESDIR}/dogecoind.logrotate" dogecoind
123 fi
124 }