From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- net-p2p/datacoin-hp/Manifest | 10 ++ net-p2p/datacoin-hp/datacoin-hp-9999.ebuild | 122 ++++++++++++++ .../files/datacoin-hp-sys_leveldb.patch | 179 +++++++++++++++++++++ net-p2p/datacoin-hp/files/datacoin.conf | 5 + net-p2p/datacoin-hp/files/datacoin.confd | 9 ++ net-p2p/datacoin-hp/files/datacoin.initd | 28 ++++ net-p2p/datacoin-hp/files/datacoin.service | 30 ++++ net-p2p/datacoin-hp/files/datacoind.logrotate | 7 + net-p2p/datacoin-hp/metadata.xml | 19 +++ 9 files changed, 409 insertions(+) create mode 100644 net-p2p/datacoin-hp/Manifest create mode 100644 net-p2p/datacoin-hp/datacoin-hp-9999.ebuild create mode 100644 net-p2p/datacoin-hp/files/datacoin-hp-sys_leveldb.patch create mode 100644 net-p2p/datacoin-hp/files/datacoin.conf create mode 100644 net-p2p/datacoin-hp/files/datacoin.confd create mode 100644 net-p2p/datacoin-hp/files/datacoin.initd create mode 100644 net-p2p/datacoin-hp/files/datacoin.service create mode 100644 net-p2p/datacoin-hp/files/datacoind.logrotate create mode 100644 net-p2p/datacoin-hp/metadata.xml (limited to 'net-p2p/datacoin-hp') diff --git a/net-p2p/datacoin-hp/Manifest b/net-p2p/datacoin-hp/Manifest new file mode 100644 index 000000000000..eb7aec8c849f --- /dev/null +++ b/net-p2p/datacoin-hp/Manifest @@ -0,0 +1,10 @@ +AUX datacoin-hp-sys_leveldb.patch 6653 SHA256 67bd9bd4b3d0f90688aa8635588b296d326032be5474581397f263f75a3e9ba5 SHA512 b8cfc741682df5b3f1330a2dbc01c47b4c597b8cd7e7d97c150eec66e1659b056cfa3f3703bb95d21f82e349d220a75bc7c1a97916d84d25261bffb165a3627c WHIRLPOOL eb9a0104975eee4223eeaec3751514df22e7669161265c4534abe692ab1148a6ea1648570cd3ba22e9662fbf33c05dfd6541c5e0f14f9d0f3f70406379286f3c +AUX datacoin.conf 108 SHA256 490bd98e4fae82d04aac70d030f8d5c8aa9fd22a8ff5d2c8238e49c26fb215b2 SHA512 e1c34d0a2799d618fb0b5dd17a5117957fb18532a1ecd223e3dfd6f815352c71abaaa7653715491f8e10ab6684b793da43e1841a1c63f5b5ed20c82dddee9ff6 WHIRLPOOL d1dd055b338c5fa5d0b94a1cd4f9ba686a310a0012788585ff1b73942284fbd4d87c4ebad8f11eb446a39b0ed1039994bf4eff4a7c01bd17995ba26836a59a70 +AUX datacoin.confd 194 SHA256 7415d875efd0b19a0f28abddaa9b54ad4748b91d543ca9791331c55078a7f884 SHA512 696a884f4f8b38d330547cf72c5f113b82a2a3e3583fa7fe4803ad4d90c25fc2a5a5536700b4e0f0a83be6fbeb51c61fe3d27973fe6fda530dba7e31e5f6ceb6 WHIRLPOOL cca73de6c5e32b384e9ca5dd0b67460b822ffa62b1064e7a8ed1feba9d750e0f9fee04e291e456d0696b4af3f50670aaa332de95cbd87459bd528d5366aec1fa +AUX datacoin.initd 828 SHA256 fcdb9afe1f260a131607d47d6a396be96bf5eb0f84e45c270f3349b859e92491 SHA512 967e0e3d419df13af23a3981a5d54f42aa027d39993cea7a9b6b4b4be808ef14a7391e02c405f5de92eeccb2d00f3852821bf0f784413fb8d9b1b0ae9bd280fe WHIRLPOOL d0a53909c2abf678f7c28aa4ebd1e360a5cdf8abf89840ec3e72e75e432a7de99036fee8f194b33ee7106683dccb8ae6b5fd46b3d8e43dd72a4d84d1bc1e676f +AUX datacoin.service 880 SHA256 a5840f12b558ef99cddfba4360a92064ebe4b88c5626cfe2c5e189a205e2d512 SHA512 3bb8639e1d95fb89949d65f7d0dffdcd9562b4a4d6cfd5523a4832f46091b6fe16ca84557e358c330e26f45701d2279f5b3cd06f29990b7457535e53b3f5df9c WHIRLPOOL be8767e02c7508d0789bc65d8cd67642831bd131cb3d0c4665ec541432235f0f23adc0dc847c0054794ea5889d2fac158290a433501e7a03a0c89e62ca5d1426 +AUX datacoind.logrotate 113 SHA256 b87dad90d7a14f6715f173b79dff9fbb8c751e5db56cda31e246476be46a3c71 SHA512 f77f8aca6ea979374e2d0a8661afab8bff0d3b65ad903a3bbdee0339271f947e0c0dd41aa884175ef6837b54227ad02e48b91255362dabb1fc16b038af1ede59 WHIRLPOOL 568bde8af0f7a852f53834c89a124f3584619dc6ff32f273b7efa6f70cb871f8951cbaa48ccfc35b36430732c3d0986501d691ef8e17c88d6c8cbe12f5100da7 +EBUILD datacoin-hp-9999.ebuild 2999 SHA256 a17f152fef6caa0cb8c89d340b85f78111a26a0267ca0df02c4fd351f8c0807c SHA512 1ea06e7d2754b3ad19792eea7cd3f44e809a5d21db16155f9a20f956accf15ea1d0ac7fe74f1f6b16cda31c72218e72b06fa9900d6a44ddf7c2436c2b6192cf2 WHIRLPOOL 18977b425cbf7102517e2485c23afd7c5de92ff7caa1b47388fd3d289997fde2f0a68965aebf1efce1fa46153b0daf9da7d83fe943c4c827c14b2fbaf2232a6e +MISC ChangeLog 2625 SHA256 8a6361e246cfa1405ee3554d6e162ca9cf0bbe7e194dd256934f44def2841f4b SHA512 ed631cf1001c511b566cfd58d23d2a815ed59cfacbfb06a9cb806549ee8fc6e210cd5d80e36fa8bdf3bc7076b141551f2c4dd10cdd2f58d9da1f2376e8a21fb9 WHIRLPOOL d9631b2903e837ead6e7c91ceadb965da8c59c2f7314e0c576cac46469125fbf30a8da5978767b0132a8bc8243d4963df62d0bd00a93800aca3791fc8d20b95b +MISC ChangeLog-2015 1168 SHA256 bba56fcbeab211039f56caed553c8f623b8612fa2816a6a1609527f8f8c76e1f SHA512 a16b9111cd2f8e1aea8090009d86be427f9f8eb4d1a5a633ed942d6ea20cd8933fe014a7dcb313f41a7425a6efbbc9f0b0dbbd70462031fbe73026e7a60610dc WHIRLPOOL b4c01f3383e6725be829e5aa926f6b9ecaccd64eef2d5f8447b79d054356d3d6db5ff00bfe8a6153c18bd27a3a61348ff98c1b7aa225863aaf64939410e922be +MISC metadata.xml 605 SHA256 66c259d413f63c79c12443c27b74ca6db8fee7393690644623a0a84a8f9f1a37 SHA512 bb3835e8527beb5ebe3fc913ec42addbe3c11accc91d99ee88cd82bb7840e89883ce77ce06481258629822d1f1ac3fc7c21a3f3a91482aa32d299e1f48932b8c WHIRLPOOL 40681e839a9dcb795328845df9a967e27f99bdcc31a3701ee805fe89e3c04fc79cd9b4903570ad44baab05045d705530edeedc351292b3401853173a55b59cb3 diff --git a/net-p2p/datacoin-hp/datacoin-hp-9999.ebuild b/net-p2p/datacoin-hp/datacoin-hp-9999.ebuild new file mode 100644 index 000000000000..5b7933868506 --- /dev/null +++ b/net-p2p/datacoin-hp/datacoin-hp-9999.ebuild @@ -0,0 +1,122 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +DB_VER="4.8" + +inherit bash-completion-r1 git-2 eutils db-use systemd user + +MyPV="${PV/_/-}" +MyPN="${PN/-hp/d}" +MyP="primecoin-${MyPV}" + +DESCRIPTION="High-performance version of datacoin (primecoin-hp fork)" +HOMEPAGE="https://github.com/foo1inge/datacoin-hp" +EGIT_REPO_URI="https://github.com/foo1inge/${PN}.git" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="" +IUSE="examples upnp ipv6 examples logrotate hardened" + +RDEPEND=" + dev-libs/boost[threads(+)] + dev-libs/openssl:0[-bindist] + upnp? ( + net-libs/miniupnpc + ) + sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx] + <=dev-libs/leveldb-1.12.0[-snappy] +" +DEPEND="${RDEPEND} + >=app-shells/bash-4.1 + sys-apps/sed + net-p2p/bitcoind +" + +S="${WORKDIR}/${MyP}-linux/src" + +src_prepare() { + epatch "${FILESDIR}"/${PN}-sys_leveldb.patch + rm -r src/leveldd + + 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 +} + +pkg_setup() { + local UG="${PN}" + enewgroup "${UG}" + enewuser "${UG}" -1 -1 /var/lib/datacoin "${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=0") + + use hardened || OPTS+=("PIE=1") + + 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[@]}" ${MyPN} +} + +#Tests are broken with and without our primecoin-sys_leveldb.patch. +#When tests work, make sure to inherit toolchain-funcs +#src_test() { +# cd src || die +# emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" test_primecoin +# ./test_primecoin || die 'Tests failed' +#} + +src_install() { + dobin src/${MyPN} + + insinto /etc/datacoin + doins "${FILESDIR}/datacoin.conf" + fowners ${PN}:${PN} /etc/datacoin/datacoin.conf + fperms 600 /etc/datacoin/datacoin.conf + + newconfd "${FILESDIR}/datacoin.confd" ${PN} + newinitd "${FILESDIR}/datacoin.initd" ${PN} + systemd_dounit "${FILESDIR}/datacoin.service" + + keepdir /var/lib/datacoin/.datacoin + fperms 700 /var/lib/datacoin + fowners ${PN}:${PN} /var/lib/datacoin/ + fowners ${PN}:${PN} /var/lib/datacoin/.datacoin + dosym /etc/datacoin/datacoin.conf /var/lib/datacoin/.datacoin/datacoin.conf + + dodoc doc/README.md doc/release-notes.md + newman contrib/debian/manpages/bitcoind.1 ${MyPN}.1 + newman contrib/debian/manpages/bitcoin.conf.5 datacoin.conf.5 + + sed -i -e 's/bitcoin/datacoin-hp/g' contrib/bitcoind.bash-completion + newbashcomp contrib/bitcoind.bash-completion ${PN}.bash-completion + + if use examples; then + docinto examples + dodoc -r contrib/{bitrpc,pyminer,spendfrom,tidy_datadir.sh,wallettools} + fi + + if use logrotate; then + insinto /etc/logrotate.d + newins "${FILESDIR}/datacoind.logrotate" ${MyPN} + fi +} diff --git a/net-p2p/datacoin-hp/files/datacoin-hp-sys_leveldb.patch b/net-p2p/datacoin-hp/files/datacoin-hp-sys_leveldb.patch new file mode 100644 index 000000000000..2f85d6a11993 --- /dev/null +++ b/net-p2p/datacoin-hp/files/datacoin-hp-sys_leveldb.patch @@ -0,0 +1,179 @@ +diff --git a/datacoin-qt.pro b/datacoin-qt.pro +index f531607..df0ecc4 100644 +--- a/datacoin-qt.pro ++++ b/datacoin-qt.pro +@@ -4,7 +4,7 @@ macx:TARGET = "Datacoin-Qt" + VERSION = 0.8.3 + INCLUDEPATH += src src/json src/qt + QT += network +-DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE ++DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE LEVELDB_WITHOUT_MEMENV + CONFIG += no_include_pwd + CONFIG += thread + +@@ -104,25 +104,29 @@ contains(BITCOIN_NEED_QT_PLUGINS, 1) { + QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets + } + ++contains(USE_SYSTEM_LEVELDB, 1) { ++ LIBS += -lleveldb ++} else { + INCLUDEPATH += src/leveldb/include src/leveldb/helpers +-LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a ++LIBS += $$PWD/src/leveldb/libleveldb.a + !win32 { + # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences +- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a ++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a + } else { + # make an educated guess about what the ranlib command is called + isEmpty(QMAKE_RANLIB) { + QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib) + } + LIBS += -lshlwapi +- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a ++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a + } + genleveldb.target = $$PWD/src/leveldb/libleveldb.a + genleveldb.depends = FORCE + PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a + QMAKE_EXTRA_TARGETS += genleveldb ++} + # Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it. +-QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb ; $(MAKE) clean ++QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb && $(MAKE) clean || true + + # regenerate src/build.h + !win32|contains(USE_BUILD_INFO, 1) { +diff --git a/src/leveldb.cpp b/src/leveldb.cpp +index e66f851..2856d70 100644 +--- a/src/leveldb.cpp ++++ b/src/leveldb.cpp +@@ -8,7 +8,9 @@ + #include + #include + #include +-#include ++#ifndef LEVELDB_WITHOUT_MEMENV ++#include ++#endif + + #include + +@@ -43,8 +45,12 @@ CLevelDB::CLevelDB(const boost::filesystem::path &path, size_t nCacheSize, bool + options = GetOptions(nCacheSize); + options.create_if_missing = true; + if (fMemory) { ++#ifndef LEVELDB_WITHOUT_MEMENV + penv = leveldb::NewMemEnv(leveldb::Env::Default()); + options.env = penv; ++#else ++ throw std::runtime_error("CLevelDB(): compiled without memenv support"); ++#endif + } else { + if (fWipe) { + printf("Wiping LevelDB in %s\n", path.string().c_str()); +diff --git a/src/makefile.unix b/src/makefile.unix +index 359ac3d..ec1e075 100644 +--- a/src/makefile.unix ++++ b/src/makefile.unix +@@ -120,8 +120,7 @@ xCXXFLAGS=-O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-para + # adds some defaults in front. Unfortunately, LDFLAGS=... $(LDFLAGS) does not work. + xLDFLAGS=$(LDHARDENING) $(LDFLAGS) + +-OBJS= \ +- leveldb/libleveldb.a \ ++BASEOBJS := \ + obj/alert.o \ + obj/version.o \ + obj/checkpoints.o \ +@@ -130,7 +129,6 @@ OBJS= \ + obj/crypter.o \ + obj/key.o \ + obj/db.o \ +- obj/init.o \ + obj/keystore.o \ + obj/main.o \ + obj/net.o \ +@@ -150,25 +148,44 @@ OBJS= \ + obj/hash.o \ + obj/bloom.o \ + obj/noui.o \ +- obj/leveldb.o \ + obj/txdb.o \ + obj/prime.o \ + obj/checkpointsync.o + ++OBJS := \ ++ obj/leveldb.o \ ++ obj/init.o \ ++ $(BASEOBJS) ++ ++TESTOBJS := \ ++ obj-test/leveldb.o \ ++ $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) \ ++ $(BASEOBJS) ++ + all: datacoind + + test check: test_primecoin FORCE + ./test_primecoin + ++ifdef USE_SYSTEM_LEVELDB ++ LIBS += -lleveldb ++ TESTLIBS += -lmemenv ++else + # + # LevelDB support + # + MAKEOVERRIDES = +-LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a ++LIBS += $(CURDIR)/leveldb/libleveldb.a ++TESTLIBS += $(CURDIR)/leveldb/libmemenv.a + DEFS += $(addprefix -I,$(CURDIR)/leveldb/include) + DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers) + leveldb/libleveldb.a: +- @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && cd .. ++ @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a && cd .. ++leveldb/libmemenv.a: ++ @echo "Building LevelDB memenv ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libmemenv.a && cd .. ++OBJS += leveldb/libleveldb.a ++TESTOBJS += leveldb/libmemenv.a ++endif + + # auto-generated dependencies: + -include obj/*.P +@@ -179,24 +196,22 @@ obj/build.h: FORCE + version.cpp: obj/build.h + DEFS += -DHAVE_BUILD_INFO + +-obj/%.o: %.cpp +- $(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $< ++P_TO_D = \ + @cp $(@:%.o=%.d) $(@:%.o=%.P); \ +- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ ++ sed -e 's/\#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \ + rm -f $(@:%.o=%.d) + +-datacoind: $(OBJS:obj/%=obj/%) +- $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS) ++obj/%.o: %.cpp ++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $< ++ $(P_TO_D) + +-TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) ++datacoind: $(OBJS) ++ $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS) + + obj-test/%.o: test/%.cpp +- $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $< +- @cp $(@:%.o=%.d) $(@:%.o=%.P); \ +- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ +- -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \ +- rm -f $(@:%.o=%.d) ++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $< ++ $(P_TO_D) + + test_primecoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%)) + $(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ $(TESTLIBS) $(xLDFLAGS) $(LIBS) diff --git a/net-p2p/datacoin-hp/files/datacoin.conf b/net-p2p/datacoin-hp/files/datacoin.conf new file mode 100644 index 000000000000..65c9767ea571 --- /dev/null +++ b/net-p2p/datacoin-hp/files/datacoin.conf @@ -0,0 +1,5 @@ +# see https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File +# + +#rpcuser= +#rpcpassword= diff --git a/net-p2p/datacoin-hp/files/datacoin.confd b/net-p2p/datacoin-hp/files/datacoin.confd new file mode 100644 index 000000000000..95939b8b19a3 --- /dev/null +++ b/net-p2p/datacoin-hp/files/datacoin.confd @@ -0,0 +1,9 @@ +# Config file for /etc/init.d/datacoind + +# owner of datacoind process (don't change, must be existing) +DATACOIN_USER="datacoin-hp" + +DATACOIN_OPTS="${DATACOIN_OPTS}" + +# nice level +NICELEVEL="19" diff --git a/net-p2p/datacoin-hp/files/datacoin.initd b/net-p2p/datacoin-hp/files/datacoin.initd new file mode 100644 index 000000000000..1c380b7d12e1 --- /dev/null +++ b/net-p2p/datacoin-hp/files/datacoin.initd @@ -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/datacoin" +conffile="${vardir}/.datacoin/datacoin.conf" +datacoind_user="${DATACOIN_USER:-nobody:nobody}" + +description="Bitcoin crypto-currency wallet for automated services" +pidfile="/run/${SVCNAME}.pid" +command="/usr/bin/datacoind" +command_args="${DATACOIN_OPTS}" +command_background="true" +start_stop_daemon_args="-u ${datacoind_user} -e HOME=${vardir} -N ${NICELEVEL:-0} -w 2000" + +depend() { + need net +} + +start_pre() { + checkpath -f -o ${datacoind_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/datacoin-hp/files/datacoin.service b/net-p2p/datacoin-hp/files/datacoin.service new file mode 100644 index 000000000000..e0cb83190a11 --- /dev/null +++ b/net-p2p/datacoin-hp/files/datacoin.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/datacoind.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/datacoind.service.d/myopts.conf" +# containing: +# [Service] +# Environment="DATACOIN_OPTS=-debug -logtimestamps" +# Nice=10 +# This will override the setting appearing below. + +# Note that almost all daemon options could be specified in +# /etc/primecoin/datacoin.conf + +[Unit] +Description=Datacoin Daemon +After=network.target + +[Service] +User=datacoin +Environment=DATACOIN_OPTS= +ExecStart=/usr/bin/datacoind -daemon=0 $DATACOIN_OPTS +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/net-p2p/datacoin-hp/files/datacoind.logrotate b/net-p2p/datacoin-hp/files/datacoind.logrotate new file mode 100644 index 000000000000..910bafe7de1d --- /dev/null +++ b/net-p2p/datacoin-hp/files/datacoind.logrotate @@ -0,0 +1,7 @@ +/var/lib/datacoin/.datacoin/debug.log { + weekly + sharedscripts + postrotate + killall -HUP datacoind + endscript +} diff --git a/net-p2p/datacoin-hp/metadata.xml b/net-p2p/datacoin-hp/metadata.xml new file mode 100644 index 000000000000..b93b686a45d8 --- /dev/null +++ b/net-p2p/datacoin-hp/metadata.xml @@ -0,0 +1,19 @@ + + + + + email@missionaccomplish.com + Fernando V. + Maintainer. Assign bugs to him + + + proxy-maint@gentoo.org + Proxy Maintainers + + + Use app-admin/logrotate for rotating logs + + + foo1inge/datacoin-hp + + -- cgit v1.2.3