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[-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}")
76 # if has_version '>=dev-libs/boost-1.52'; then
77 # OPTS+=("LIBS+=-lboost_chrono\$\$BOOST_LIB_SUFFIX")
81 emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" ${PN}
84 #Tests are broken with and without our dogecoin-sys_leveldb.patch.
85 #When tests work, make sure to inherit toolchain-funcs
88 # emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" test_dogecoin
89 # ./test_dogecoin || die 'Tests failed'
96 doins "${FILESDIR}/dogecoin.conf"
97 fowners dogecoin:dogecoin /etc/dogecoin/dogecoin.conf
98 fperms 600 /etc/dogecoin/dogecoin.conf
100 newconfd "${FILESDIR}/dogecoin.confd" ${PN}
101 newinitd "${FILESDIR}/dogecoin.initd" ${PN}
102 systemd_dounit "${FILESDIR}/dogecoin.service"
104 keepdir /var/lib/dogecoin/.dogecoin
105 fperms 700 /var/lib/dogecoin
106 fowners dogecoin:dogecoin /var/lib/dogecoin/
107 fowners dogecoin:dogecoin /var/lib/dogecoin/.dogecoin
108 dosym /etc/dogecoin/dogecoin.conf /var/lib/dogecoin/.dogecoin/dogecoin.conf
110 # dodoc doc/README.md doc/release-notes.md
111 # newman contrib/debian/manpages/bitcoind.1 dogecoind.1
112 # newman contrib/debian/manpages/bitcoin.conf.5 dogecoin.conf.5
114 if use bash-completion; then
116 # newbashcomp contrib/bitcoind.bash-completion ${PN}.bash-completion
119 if use examples; then
121 # dodoc -r contrib/{bitrpc,pyminer,spendfrom,tidy_datadir.sh,wallettools}
124 if use logrotate; then
125 insinto /etc/logrotate.d
126 newins "${FILESDIR}/dogecoind.logrotate" dogecoind