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"
20 KEYWORDS="~amd64 ~x86"
21 IUSE="bash-completion examples ipv6 logrotate upnp system_leveldb"
24 dev-libs/boost[threads(+)]
25 dev-libs/openssl:0[-bindist]
32 sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
34 =dev-libs/leveldb-1.15.0[-snappy]
47 enewuser "${UG}" -1 -1 /var/lib/dogecoin "${UG}"
51 # epatch "${FILESDIR}"/${MyPN}-sys_leveldb.patch
54 if has_version '>=dev-libs/boost-1.52'; then
55 sed -i 's/\(-l db_cxx\)/-l boost_chrono$(BOOST_LIB_SUFFIX) \1/' src/makefile.unix
63 OPTS+=("CXXFLAGS=${CXXFLAGS}")
64 OPTS+=("LDFLAGS=${LDFLAGS}")
72 use ipv6 || OPTS+=("USE_IPV6=-")
74 use system_leveldb && OPTS+=("USE_SYSTEM_LEVELDB=1")
76 OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
77 OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
80 emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" ${PN}
83 #Tests are broken with and without our dogecoin-sys_leveldb.patch.
84 #When tests work, make sure to inherit toolchain-funcs
87 # emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" test_dogecoin
88 # ./test_dogecoin || die 'Tests failed'
95 doins "${FILESDIR}/dogecoin.conf"
96 fowners dogecoin:dogecoin /etc/dogecoin/dogecoin.conf
97 fperms 600 /etc/dogecoin/dogecoin.conf
99 newconfd "${FILESDIR}/dogecoin.confd" ${PN}
100 newinitd "${FILESDIR}/dogecoin.initd" ${PN}
101 systemd_dounit "${FILESDIR}/dogecoin.service"
103 keepdir /var/lib/dogecoin/.dogecoin
104 fperms 700 /var/lib/dogecoin
105 fowners dogecoin:dogecoin /var/lib/dogecoin/
106 fowners dogecoin:dogecoin /var/lib/dogecoin/.dogecoin
107 dosym /etc/dogecoin/dogecoin.conf /var/lib/dogecoin/.dogecoin/dogecoin.conf
109 # dodoc doc/README.md doc/release-notes.md
110 # newman contrib/debian/manpages/bitcoind.1 dogecoind.1
111 # newman contrib/debian/manpages/bitcoin.conf.5 dogecoin.conf.5
113 if use bash-completion; then
115 # newbashcomp contrib/bitcoind.bash-completion ${PN}.bash-completion
118 if use examples; then
120 # dodoc -r contrib/{bitrpc,pyminer,spendfrom,tidy_datadir.sh,wallettools}
123 if use logrotate; then
124 insinto /etc/logrotate.d
125 newins "${FILESDIR}/dogecoind.logrotate" dogecoind