1 # Distributed under the terms of the GNU General Public License v2
7 inherit bash-completion-r1 db-use eutils systemd user
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"
18 LICENSE="MIT ISC GPL-2"
21 IUSE="bash-completion examples ipv6 logrotate upnp"
24 dev-libs/boost[threads(+)]
25 dev-libs/openssl:0[-bindist]
32 sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
33 <=dev-libs/leveldb-1.12.0[-snappy]
45 enewuser "${UG}" -1 -1 /var/lib/dogecoin "${UG}"
49 # epatch "${FILESDIR}"/${MyPN}-sys_leveldb.patch
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
61 OPTS+=("CXXFLAGS=${CXXFLAGS}")
62 OPTS+=("LDFLAGS=${LDFLAGS}")
70 use ipv6 || OPTS+=("USE_IPV6=-")
72 OPTS+=("USE_SYSTEM_LEVELDB=1")
73 OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
74 OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
77 emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" ${PN}
80 #Tests are broken with and without our dogecoin-sys_leveldb.patch.
81 #When tests work, make sure to inherit toolchain-funcs
84 # emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" test_dogecoin
85 # ./test_dogecoin || die 'Tests failed'
92 doins "${FILESDIR}/dogecoin.conf"
93 fowners dogecoin:dogecoin /etc/dogecoin/dogecoin.conf
94 fperms 600 /etc/dogecoin/dogecoin.conf
96 newconfd "${FILESDIR}/dogecoin.confd" ${PN}
97 newinitd "${FILESDIR}/dogecoin.initd" ${PN}
98 systemd_dounit "${FILESDIR}/dogecoin.service"
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
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
110 if use bash-completion; then
112 # newbashcomp contrib/bitcoind.bash-completion ${PN}.bash-completion
115 if use examples; then
117 # dodoc -r contrib/{bitrpc,pyminer,spendfrom,tidy_datadir.sh,wallettools}
120 if use logrotate; then
121 insinto /etc/logrotate.d
122 newins "${FILESDIR}/dogecoind.logrotate" dogecoind