summaryrefslogtreecommitdiff
path: root/net-p2p/ppcoind
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-p2p/ppcoind
reinit the tree, so we can have metadata
Diffstat (limited to 'net-p2p/ppcoind')
-rw-r--r--net-p2p/ppcoind/Manifest14
-rw-r--r--net-p2p/ppcoind/files/ppcoin.conf8
-rw-r--r--net-p2p/ppcoind/files/ppcoin.confd10
-rw-r--r--net-p2p/ppcoind/files/ppcoin.initd104
-rw-r--r--net-p2p/ppcoind/files/ppcoin.initd-r128
-rw-r--r--net-p2p/ppcoind/files/ppcoin.service30
-rw-r--r--net-p2p/ppcoind/files/ppcoind-0.4.0-boost_chrono.patch10
-rw-r--r--net-p2p/ppcoind/files/ppcoind-0.4.0-gcc6.patch11
-rw-r--r--net-p2p/ppcoind/files/ppcoind.logrotate7
-rw-r--r--net-p2p/ppcoind/metadata.xml11
-rw-r--r--net-p2p/ppcoind/ppcoind-0.4.0-r1.ebuild116
-rw-r--r--net-p2p/ppcoind/ppcoind-0.4.0.ebuild118
12 files changed, 467 insertions, 0 deletions
diff --git a/net-p2p/ppcoind/Manifest b/net-p2p/ppcoind/Manifest
new file mode 100644
index 000000000000..93a9e34f1f3c
--- /dev/null
+++ b/net-p2p/ppcoind/Manifest
@@ -0,0 +1,14 @@
+AUX ppcoin.conf 80 SHA256 541ae10cc2246b620de3e7efa97eee59efacf83d28ea5f1297a121d0708226d2 SHA512 43bef890505a1fac88887bb39e9fdd4ec673ae8838a40279b33711e970551f5a75ac25171c41f8c83de2c953b157f7a3f57171e868fd9f626007d9909331a19f WHIRLPOOL 728e38b62da2c7c3a1149ac511b92d156f7b3c51dacfadd7ce74d9e6f915a6547c4cc8d34159243f50eee333c63b35949b311ea5a7f48a6c3bf17a5d4d47c123
+AUX ppcoin.confd 233 SHA256 fb877ae7608b5c2aaae29e522d8cfb42e51e064831c64b228b64da2b11aac64d SHA512 efb8f210143d993e922668e3daffc8bb74406be2f912729f68ebfcbcb3d44e10e0fed495963c4273a95099d37f3afc66b49616724bd827e6b4359b2e3a27d9c3 WHIRLPOOL 12e7a8e82d33b023be054c6c019cc61a5783e32e108e54358c76789e1e89ce441a095561e1a4750cb341350ef7da7a97b6ebfb06f8ec3a7fcd2809e27d5eb110
+AUX ppcoin.initd 2452 SHA256 fa5cad6c54fb6cac4074f23d40c369ea7afbe3e83280a104850983fde1578e79 SHA512 200562252dcb716ff79b2f32de142e5857cc997585a0c96d9f1c89cdced9f46598f15d11616b5ebb368b4e5915ed707be02af6227fe47dc46c022f80583d586d WHIRLPOOL 8347a6d3fd2816a0359cd9424c1ba40e832670271a325a042bab9c9471c36a2ffaa20e2f986e8c7484d5e24bb30cf6a8a11603d8d40bc7277068326a531a9c39
+AUX ppcoin.initd-r1 827 SHA256 08e1267e030db31befd86362e1afe2435c727004f1434f268b0c6721c53e5728 SHA512 8bcf80e668ea549bb1eb641f66ec2349f5e3f32131312eabbfa086586004bacd95527d196d8bbb6b76dd88f6112c633a7b1e418ce50f8f0f33786db0cad20d4d WHIRLPOOL d245d0cf703845f8beb6c2d06713c877c225281c9b26899cb9e1d063aed0e88302fd169a36725e3eea71e80e17dec4bfae9c6c546bfd5b06269ba042392117fb
+AUX ppcoin.service 859 SHA256 df6e7f616816a07efb4d3d627d1ee80699f541bdcbafce7ba7aef2640291bce9 SHA512 8395ef4f5b026757f4202c78eb55b6978d2cdec49f6db801bb6daddea8d8a524afacf53368a78c3a7055ce5cc4ada53ac6c88567b02951fa7a722e5dd9ebd3c1 WHIRLPOOL bbd546e3d7043132f65117e567fe0f0b756f60093184e67316398cc8589f46a5029d9118431a4fa2d5e9e834c1f2beb180f0e5e20f8d7a8ae1fa96273b278076
+AUX ppcoind-0.4.0-boost_chrono.patch 303 SHA256 b46afa25e5f59bbc2c76bb5483ff96be4ed80b00de5d0397c5ff5b3fd82deb23 SHA512 0967f2455e6390ddcf6f38ba2d5f1290e41198ef8d4afa94e21de07771eedfbe89ee6af0c19cd76c0264bcfbe958d6dc0baedc96bef1e8badf613061eba99b6a WHIRLPOOL 9a0e708b7830ff9dfdc01dbf5c0fe79f0d814588b545d6b54381c611c67ca911485d7074d36e2b11dfbed294d0ac8d66bb58e1f8fd7572e2d3c58e68c3fd226c
+AUX ppcoind-0.4.0-gcc6.patch 410 SHA256 a9cae09b9c7e7ae93e65dfdcad94ecebe6e4e9acdb517792d7b86bd53ec13ed3 SHA512 6153d2a3ede27453589e6bc081a36a8962234076b8f87077f41bd9ba913c2c6cd2bfaaba010464d89a7f77e7e1e3682e87164835a24d1145e910f46c66095c25 WHIRLPOOL 9f41377a7e711c8a7ab1042a8360ddc93e1bdb1be13c93fce7cb1915f973920f36ec858e5558497c59b5fd1b258068a37ba9d385554e17b468f0a048938fd67b
+AUX ppcoind.logrotate 107 SHA256 5aefed737e73b6393e2f004318b34429616a35187131bade4743a1c8aa7e7d91 SHA512 bf36d07a6dcebcc50ac7e0b74433333902df6ef22396a876b96289cca90882720ed95ef0cc8fbf3abeea6800cbe2386e56b27bb798922f3be98134dee1caed69 WHIRLPOOL 68521503b26df24b66dd20a9ef3174ffc1427abf483185b709d46fc54d148250e4a85ee887e292398063205737640b7accd7365cd707ea5c3e80b72b503e3880
+DIST ppcoin-0.4.0.tar.gz 12652477 SHA256 561076e8d4e82085d577eb717b9f8b52571556fea2b8181fa8eb6039218d3f06 SHA512 755890e32048f8cdfb9f93706eff952ae2876be394c0a76cf93a79562a28fe03c74c829c97b9234fbc27c03e4b706373f55723564ca7b91a4ff908ca072299c4 WHIRLPOOL eaacd820045fe2a343c45698674096a15228605418cffe61fc9e31eaf330dbb29635d6dbae534a90677fe035a598c7b061c0c3fa05c747514c24cfc24addeef4
+EBUILD ppcoind-0.4.0-r1.ebuild 2515 SHA256 5ab860ab8f73ee7e797cb454ed25624c3619c7057415c5c691d7adb4109c694a SHA512 b73ee2760216447eb0bab425e5c32fdcc2bb454bd737c1b8af635ec6bc3deceb10421ac6b3acaed494da063a0770756698dd1f136d3b008d677a8266d1bed460 WHIRLPOOL 13a663a71f0d3fda0eba24dcb82a7308eacdb1a7b1bd47c104f354c58e71feba2a2e22b09655aa5c1363b7b97461658424152bb148e83345a1db64dd0b89ce7b
+EBUILD ppcoind-0.4.0.ebuild 2619 SHA256 aa9a5a81d946cad0661f59e1b5536a04f632f1407af042bce1cbdec0b6c48255 SHA512 b7e3ac5b89461c3faad3ad3685b7310dc441249a7a149a1c23fcab53788fd913fc908d21e64b1d634a1b0b23a37ba27216487f09f18081081c41c0ff0bb994ae WHIRLPOOL 121ef15bab12fbffff60254dbc1bdded3c4d166659bec736749c56f374f834b2447a0632c42bda7b111f7d07a980cdfb7beccb8a90f3ce3b0eb3cdf30f7a63df
+MISC ChangeLog 2601 SHA256 46693555021331302c13046661ff8f0a089e9b745dc21f82aed1010fea0da4d9 SHA512 732c0489b58b687de596458b11adca41d46d6d36f31ea723142f77644ab7d530ff77ccc4884d5711a0e15a680d507e6c124fb206324ece0fbb7ab635f12eedd9 WHIRLPOOL ae11f8fb65139c7eb2bc3bf9b5db0acc8ff62f6eaa4fddeb4e159ba307e66097acb3bcdf98b92127fa7d0f034abb3b4745670fcbafff70b9206cc8d5e1b18ba5
+MISC ChangeLog-2015 1249 SHA256 f0af3b798c0a5066c1448c2c970264a18a3fe059a6affcf7757a32b0d0468998 SHA512 94c0c44b218cd0b0a27e581697ba92ac4fc80c47d5c3367473b1d3f98e4301c36a1106c64b1e7c609f2bc14a1571abb83cbf4230eb9171b2a2219f959d5af4bc WHIRLPOOL 2ab9750f1c6142b137a73f940b4a3ee5c337a8b07f27a64740128294ed5cfa359a10b5b7007a9aee6db1891430fb2f8c0bf6ed3515cda99e4f7c02a530c1e892
+MISC metadata.xml 332 SHA256 1fc81b2a94caca658b7bc209ecf54da156f261138394d36a35c4cbffa15871c3 SHA512 430c6665189005260d6a07fc0e8185c1ec896177b405a261a851a77a77e58bc35fa693896deedd68589e1d42f48299815cd7e1d9e42e9e54bf2be36d23fcfa84 WHIRLPOOL 3d54fae187d8852730d943da653e5ce8ab58c05ec579c6ba8aa09e2bbf79d918b7a5cacfd91ce6c1fd4c11cc1e2ec20a64533640f68439b4bb4afa71db8da30b
diff --git a/net-p2p/ppcoind/files/ppcoin.conf b/net-p2p/ppcoind/files/ppcoin.conf
new file mode 100644
index 000000000000..c6a55f3d9133
--- /dev/null
+++ b/net-p2p/ppcoind/files/ppcoin.conf
@@ -0,0 +1,8 @@
+# http://www.bitcoin.org/smf/index.php?topic=644.0
+#rpcuser=
+#rpcpassword=
+
+
+
+
+
diff --git a/net-p2p/ppcoind/files/ppcoin.confd b/net-p2p/ppcoind/files/ppcoin.confd
new file mode 100644
index 000000000000..81fbf49e9f38
--- /dev/null
+++ b/net-p2p/ppcoind/files/ppcoin.confd
@@ -0,0 +1,10 @@
+# Config file for /etc/init.d/ppcoind
+
+# owner of ppciond process (don't change, must be existing)
+PPCOIN_USER="ppcoin"
+
+# See http://www.bitcoin.org/smf/index.php?topic=1063
+PPCOIN_OPTS="${PPCOIN_OPTS}"
+
+# nice level
+NICELEVEL="19"
diff --git a/net-p2p/ppcoind/files/ppcoin.initd b/net-p2p/ppcoind/files/ppcoin.initd
new file mode 100644
index 000000000000..e739dc7dba4e
--- /dev/null
+++ b/net-p2p/ppcoind/files/ppcoin.initd
@@ -0,0 +1,104 @@
+#!/sbin/openrc-run
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+VARDIR="/var/lib/ppcoin"
+CONFFILE="${VARDIR}/.ppcoin/ppcoin.conf"
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [[ "${PPCOIN_USER}" == "" ]] ; then
+ eerror "Please edit /etc/conf.d/ppcoind"
+ eerror "A user must be specified to run ppcoind as that user."
+ eerror "Modify USER to your needs (you may also add a group after a colon)"
+ return 1
+ fi
+ if ! `getent passwd | cut -d ':' -f 1 | grep $( echo "${PPCOIN_USER}" | cut -d ':' -f 1 ) -sq` ; then
+ eerror "Please edit /etc/conf.d/ppcoind"
+ eerror "Specified user must exist!"
+ return 1
+ fi
+ if `echo "${PPCOIN_USER}" | grep ':' -sq` ; then
+ if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${PPCOIN_USER}" | cut -d ':' -f 2 ) -sq` ; then
+ eerror "Please edit /etc/conf.d/ppcoind"
+ eerror "Specified group must exist!"
+ return 1
+ fi
+ fi
+ if ! grep -q '^rpcpassword=' "${CONFFILE}"; then
+ eerror "Please edit `readlink -f ${CONFFILE}`"
+ eerror "There must be at least a line assigning rpcpassword=something-secure"
+ return 1
+ fi
+ if ! stat -Lc '%a' "${CONFFILE}" | grep -q '^[4567]00$'; then
+ eerror "`readlink -f ${CONFFILE}` should not be readable by other users"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting PPcoind daemon"
+
+ pkg-config openrc
+ if [ $? = 0 ]; then
+ start_openrc
+ else
+ start_baselayout
+ fi
+}
+
+stop() {
+ ebegin "Stopping PPcoin daemon"
+
+ pkg-config openrc
+ if [ $? = 0 ]; then
+ stop_openrc
+ else
+ stop_baselayout
+ fi
+}
+
+start_openrc() {
+ start-stop-daemon \
+ --start --user "${PPCOIN_USER}" --name ppcoind \
+ --pidfile /var/run/ppcoind.pid --make-pidfile \
+ --env HOME="${VARDIR}" --exec /usr/bin/ppcoind \
+ --nicelevel "${NICELEVEL}" \
+ --background \
+ --wait 2000 \
+ -- ${PPCOIN_OPTS}
+ eend $?
+}
+
+stop_openrc() {
+ start-stop-daemon --stop --user "${PPCOIN_USER}" \
+ --name ppcoind --pidfile /var/run/ppcoind.pid \
+ --wait 30000 \
+ --progress
+ eend $?
+}
+
+start_baselayout() {
+ start-stop-daemon \
+ --start --user "${PPCOIN_USER}" --name ppcoind \
+ --pidfile /var/run/ppcoind.pid --make-pidfile \
+ --env HOME="${VARDIR}" --exec /usr/bin/ppcoind \
+ --chuid "${PPCOIN_USER}" \
+ --nicelevel "${NICELEVEL}" \
+ --background \
+ -- ${PPCOIN_OPTS}
+ eend $?
+}
+
+stop_baselayout() {
+ start-stop-daemon \
+ --stop \
+ --user "${PPCOIN_USER}" \
+ --name ppcoind \
+ --pidfile /var/run/ppcoind.pid
+ eend $?
+}
diff --git a/net-p2p/ppcoind/files/ppcoin.initd-r1 b/net-p2p/ppcoind/files/ppcoin.initd-r1
new file mode 100644
index 000000000000..8023f1f0d378
--- /dev/null
+++ b/net-p2p/ppcoind/files/ppcoin.initd-r1
@@ -0,0 +1,28 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+vardir="/var/lib/ppcoin"
+conffile="${vardir}/.ppcoin/ppcoin.conf"
+ppcoind_user="${PPCOIN_USER:-nobody:nobody}"
+
+description="Cryptocurrency forked from Bitcoin which aims to be energy efficiency."
+pidfile="/run/${SVCNAME}.pid"
+command="/usr/bin/ppcoind"
+command_args="${PPCOIN_OPTS}"
+command_background="true"
+start_stop_daemon_args="-u ${ppcoind_user} -e HOME=${vardir} -N ${NICELEVEL:-0} -w 2000"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -f -o ${ppcoind_user} -m 0400 ${conffile} || return 1
+
+ if ! grep -q '^rpcpassword=' "${conffile}"; then
+ eerror "Please edit `readlink -f ${conffile}`"
+ eerror "There must be at least a line assigning rpcpassword=something-secure"
+ return 1
+ fi
+}
diff --git a/net-p2p/ppcoind/files/ppcoin.service b/net-p2p/ppcoind/files/ppcoin.service
new file mode 100644
index 000000000000..3a83178fe04e
--- /dev/null
+++ b/net-p2p/ppcoind/files/ppcoin.service
@@ -0,0 +1,30 @@
+# It's not recommended to modify this file in-place, because it will be
+# overwritten during package upgrades. If you want to customize, the
+# best way is to create file
+# "/etc/systemd/system/ppcoind.service.d/*.conf"
+# containing your changes
+
+# For example, if you want to change some daemon and/or unit options,
+# create a file named
+# "/etc/systemd/system/ppcoind.service.d/myopts.conf"
+# containing:
+# [Service]
+# Environment="PPCOIN_OPTS=-debug -logtimestamps"
+# Nice=10
+# This will override the setting appearing below.
+
+# Note that almost all daemon options could be specified in
+# /etc/ppcoin/ppcoin.conf
+
+[Unit]
+Description=PPcoin Daemon
+After=network.target
+
+[Service]
+User=ppcoin
+Environment=PPCOIN_OPTS=
+ExecStart=/usr/bin/ppcoind -daemon=0 $PPCOIN_OPTS
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-p2p/ppcoind/files/ppcoind-0.4.0-boost_chrono.patch b/net-p2p/ppcoind/files/ppcoind-0.4.0-boost_chrono.patch
new file mode 100644
index 000000000000..390d5c7c94b1
--- /dev/null
+++ b/net-p2p/ppcoind/files/ppcoind-0.4.0-boost_chrono.patch
@@ -0,0 +1,10 @@
+--- a/src/makefile.unix
++++ b/src/makefile.unix
+@@ -30,6 +30,7 @@
+ -l boost_filesystem$(BOOST_LIB_SUFFIX) \
+ -l boost_program_options$(BOOST_LIB_SUFFIX) \
+ -l boost_thread$(BOOST_LIB_SUFFIX) \
++ -l boost_chrono$(BOOST_LIB_SUFFIX) \
+ -l db_cxx$(BDB_LIB_SUFFIX) \
+ -l ssl \
+ -l crypto
diff --git a/net-p2p/ppcoind/files/ppcoind-0.4.0-gcc6.patch b/net-p2p/ppcoind/files/ppcoind-0.4.0-gcc6.patch
new file mode 100644
index 000000000000..76bad3feb5a4
--- /dev/null
+++ b/net-p2p/ppcoind/files/ppcoind-0.4.0-gcc6.patch
@@ -0,0 +1,11 @@
+--- a/src/net.cpp
++++ b/src/net.cpp
+@@ -51,7 +51,7 @@ CAddress addrLocalHost(CService("0.0.0.0", 0), nLocalServices);
+ CAddress addrSeenByPeer(CService("0.0.0.0", 0), nLocalServices);
+ static CNode* pnodeLocalHost = NULL;
+ uint64 nLocalHostNonce = 0;
+-array<int, THREAD_MAX> vnThreadsRunning;
++boost::array<int, THREAD_MAX> vnThreadsRunning;
+ static SOCKET hListenSocket = INVALID_SOCKET;
+ CAddrMan addrman;
+
diff --git a/net-p2p/ppcoind/files/ppcoind.logrotate b/net-p2p/ppcoind/files/ppcoind.logrotate
new file mode 100644
index 000000000000..4ea060b0f0f7
--- /dev/null
+++ b/net-p2p/ppcoind/files/ppcoind.logrotate
@@ -0,0 +1,7 @@
+/var/lib/ppcoin/.ppcoin/debug.log {
+ weekly
+ sharedscripts
+ postrotate
+ killall -HUP ppcoind
+ endscript
+}
diff --git a/net-p2p/ppcoind/metadata.xml b/net-p2p/ppcoind/metadata.xml
new file mode 100644
index 000000000000..f08d8cf453eb
--- /dev/null
+++ b/net-p2p/ppcoind/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <use>
+ <flag name="logrotate">Use app-admin/logrotate for rotating logs</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">ppcoin</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/ppcoind/ppcoind-0.4.0-r1.ebuild b/net-p2p/ppcoind/ppcoind-0.4.0-r1.ebuild
new file mode 100644
index 000000000000..1a5131498abd
--- /dev/null
+++ b/net-p2p/ppcoind/ppcoind-0.4.0-r1.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DB_VER="4.8"
+
+inherit db-use eutils systemd user
+
+MyPV="${PV/_/-}"
+MyPN="ppcoin"
+MyP="${MyPN}-${MyPV}"
+
+DESCRIPTION="Cryptocurrency forked from Bitcoin which aims to be energy efficiency"
+HOMEPAGE="http://peercoin.net/"
+SRC_URI="mirror://sourceforge/${MyPN}/${MyP}-linux.tar.gz -> ${MyP}.tar.gz"
+
+LICENSE="MIT ISC GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples ipv6 logrotate upnp"
+
+RDEPEND="
+ dev-libs/boost:=[threads(+)]
+ dev-libs/openssl:0[-bindist]
+ logrotate? (
+ app-admin/logrotate
+ )
+ upnp? (
+ net-libs/miniupnpc
+ )
+ sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
+"
+DEPEND="${RDEPEND}
+ >=app-shells/bash-4.1
+ sys-apps/sed
+"
+
+DOCS=( ../README README.md )
+
+PATCHES=(
+ "${FILESDIR}"/${P}-gcc6.patch
+ "${FILESDIR}"/${P}-boost_chrono.patch
+)
+
+S="${WORKDIR}/${MyP}-linux/src"
+
+pkg_setup() {
+ local UG='ppcoin'
+ enewgroup "${UG}"
+ enewuser "${UG}" -1 -1 /var/lib/ppcoin "${UG}"
+}
+
+src_configure() {
+ OPTS=()
+
+ OPTS+=("DEBUGFLAGS=")
+ OPTS+=("CXXFLAGS=${CXXFLAGS}")
+ OPTS+=("LDFLAGS=${LDFLAGS}")
+
+ if use upnp; then
+ OPTS+=("USE_UPNP=1")
+ else
+ OPTS+=("USE_UPNP=-")
+ fi
+
+ use ipv6 || OPTS+=("USE_IPV6=-")
+
+ OPTS+=("USE_SYSTEM_LEVELDB=1")
+ OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
+ OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
+
+ emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -C src -f makefile.unix "${OPTS[@]}" ${PN}
+}
+
+#Tests are broken
+#src_test() {
+# cd src || die
+# emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" test_ppcoin
+# ./test_ppcoin || die 'Tests failed'
+#}
+
+src_install() {
+ dobin src/${PN}
+
+ insinto /etc/ppcoin
+ doins "${FILESDIR}/ppcoin.conf"
+ fowners ppcoin:ppcoin /etc/ppcoin/ppcoin.conf
+ fperms 600 /etc/ppcoin/ppcoin.conf
+
+ newconfd "${FILESDIR}/ppcoin.confd" ${PN}
+ newinitd "${FILESDIR}/ppcoin.initd-r1" ${PN}
+ systemd_dounit "${FILESDIR}/ppcoin.service"
+
+ keepdir /var/lib/ppcoin/.ppcoin
+ fperms 700 /var/lib/ppcoin
+ fowners ppcoin:ppcoin /var/lib/ppcoin/
+ fowners ppcoin:ppcoin /var/lib/ppcoin/.ppcoin
+ dosym /etc/ppcoin/ppcoin.conf /var/lib/ppcoin/.ppcoin/ppcoin.conf
+
+ newman contrib/debian/manpages/bitcoind.1 ppcoind.1
+ newman contrib/debian/manpages/bitcoin.conf.5 ppcoin.conf.5
+
+ einstalldocs
+
+ if use examples; then
+ docinto examples
+ dodoc -r contrib/{bitrpc,gitian-descriptors,gitian-downloader,pyminer,wallettools}
+
+ fi
+
+ if use logrotate; then
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/ppcoind.logrotate" ppcoind
+ fi
+}
diff --git a/net-p2p/ppcoind/ppcoind-0.4.0.ebuild b/net-p2p/ppcoind/ppcoind-0.4.0.ebuild
new file mode 100644
index 000000000000..f0cc1712c908
--- /dev/null
+++ b/net-p2p/ppcoind/ppcoind-0.4.0.ebuild
@@ -0,0 +1,118 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+DB_VER="4.8"
+
+inherit db-use eutils systemd user
+
+MyPV="${PV/_/-}"
+MyPN="ppcoin"
+MyP="${MyPN}-${MyPV}"
+
+DESCRIPTION="Cryptocurrency forked from Bitcoin which aims to be energy efficiency"
+HOMEPAGE="http://peercoin.net/"
+SRC_URI="mirror://sourceforge/${MyPN}/${MyP}-linux.tar.gz -> ${MyP}.tar.gz"
+
+LICENSE="MIT ISC GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples ipv6 logrotate upnp"
+
+RDEPEND="
+ dev-libs/boost[threads(+)]
+ dev-libs/openssl:0[-bindist]
+ logrotate? (
+ app-admin/logrotate
+ )
+ upnp? (
+ net-libs/miniupnpc
+ )
+ sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
+"
+DEPEND="${RDEPEND}
+ >=app-shells/bash-4.1
+ sys-apps/sed
+"
+
+S="${WORKDIR}/${MyP}-linux/src"
+
+pkg_setup() {
+ local UG='ppcoin'
+ enewgroup "${UG}"
+ enewuser "${UG}" -1 -1 /var/lib/ppcoin "${UG}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gcc6.patch
+
+ if has_version '>=dev-libs/boost-1.52'; then
+ sed -i 's/\(-l db_cxx\)/-l boost_chrono$(BOOST_LIB_SUFFIX) \1/' src/makefile.unix
+ fi
+}
+
+src_configure() {
+ OPTS=()
+
+ OPTS+=("DEBUGFLAGS=")
+ OPTS+=("CXXFLAGS=${CXXFLAGS}")
+ OPTS+=("LDFLAGS=${LDFLAGS}")
+
+ if use upnp; then
+ OPTS+=("USE_UPNP=1")
+ else
+ OPTS+=("USE_UPNP=-")
+ fi
+
+ use ipv6 || OPTS+=("USE_IPV6=-")
+
+ OPTS+=("USE_SYSTEM_LEVELDB=1")
+ OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
+ OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
+
+ cd src || die
+ emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" ${PN}
+}
+
+#Tests are broken
+#src_test() {
+# cd src || die
+# emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" test_ppcoin
+# ./test_ppcoin || die 'Tests failed'
+#}
+
+src_install() {
+ dobin src/${PN}
+
+ insinto /etc/ppcoin
+ doins "${FILESDIR}/ppcoin.conf"
+ fowners ppcoin:ppcoin /etc/ppcoin/ppcoin.conf
+ fperms 600 /etc/ppcoin/ppcoin.conf
+
+ newconfd "${FILESDIR}/ppcoin.confd" ${PN}
+ newinitd "${FILESDIR}/ppcoin.initd-r1" ${PN}
+ systemd_dounit "${FILESDIR}/ppcoin.service"
+
+ keepdir /var/lib/ppcoin/.ppcoin
+ fperms 700 /var/lib/ppcoin
+ fowners ppcoin:ppcoin /var/lib/ppcoin/
+ fowners ppcoin:ppcoin /var/lib/ppcoin/.ppcoin
+ dosym /etc/ppcoin/ppcoin.conf /var/lib/ppcoin/.ppcoin/ppcoin.conf
+
+ dodoc ../README
+ dodoc README.md
+ newman contrib/debian/manpages/bitcoind.1 ppcoind.1
+ newman contrib/debian/manpages/bitcoin.conf.5 ppcoin.conf.5
+
+ if use examples; then
+ docinto examples
+ dodoc -r contrib/{bitrpc,gitian-descriptors,gitian-downloader,pyminer,wallettools}
+
+ fi
+
+ if use logrotate; then
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/ppcoind.logrotate" ppcoind
+ fi
+}