aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Shelton <stuart@shelton.me>2014-03-18 01:26:19 +0000
committerStuart Shelton <stuart@shelton.me>2014-03-18 01:26:19 +0000
commit90d6f7eb62e42589d0ba666e66eed2103da4d2f9 (patch)
treee57d17659cf41c54719f6d920e30b4cad67a5784 /net-p2p
parentUpdate net-dns/bind-tools (diff)
parentAdd net-p2p/bitcoind-0.8.6-r1 (diff)
downloadsrcshelton-90d6f7eb62e42589d0ba666e66eed2103da4d2f9.tar.gz
srcshelton-90d6f7eb62e42589d0ba666e66eed2103da4d2f9.tar.bz2
srcshelton-90d6f7eb62e42589d0ba666e66eed2103da4d2f9.zip
Update app-admin/monit, net-misc/dhcpcd, net-p2p/bitcoind
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/bitcoind/Manifest8
-rw-r--r--net-p2p/bitcoind/bitcoind-0.8.6-r1.ebuild121
-rw-r--r--net-p2p/bitcoind/files/0.8.2-sys_leveldb.patch185
-rw-r--r--net-p2p/bitcoind/files/bitcoin.conf8
-rw-r--r--net-p2p/bitcoind/files/bitcoin.confd10
-rw-r--r--net-p2p/bitcoind/files/bitcoin.initd-r129
-rw-r--r--net-p2p/bitcoind/files/bitcoind.logrotate7
-rw-r--r--net-p2p/bitcoind/files/bitcoind.service30
8 files changed, 398 insertions, 0 deletions
diff --git a/net-p2p/bitcoind/Manifest b/net-p2p/bitcoind/Manifest
new file mode 100644
index 00000000..4a5fa21d
--- /dev/null
+++ b/net-p2p/bitcoind/Manifest
@@ -0,0 +1,8 @@
+AUX 0.8.2-sys_leveldb.patch 6726 SHA256 11322fc7715b9b552075babf60c8261e0343e5ec834188013fb7d77cacf3b4d9 SHA512 e371b6da685c916c5941cfc094d01237f18502597e778b35e1c31cbf93cda1118a97272b56605f7c6da1f2873190415974ebdb4e7ce08a5d04e94dac675a4112 WHIRLPOOL 8579c73d18281b3910c260ef0708842380f8c5001982c94ea51e6b8f99111b11959ffb04fc7812e0c90ba8a919071b13e975ed95ec207017e34bef5844f65068
+AUX bitcoin.conf 80 SHA256 541ae10cc2246b620de3e7efa97eee59efacf83d28ea5f1297a121d0708226d2 SHA512 43bef890505a1fac88887bb39e9fdd4ec673ae8838a40279b33711e970551f5a75ac25171c41f8c83de2c953b157f7a3f57171e868fd9f626007d9909331a19f WHIRLPOOL 728e38b62da2c7c3a1149ac511b92d156f7b3c51dacfadd7ce74d9e6f915a6547c4cc8d34159243f50eee333c63b35949b311ea5a7f48a6c3bf17a5d4d47c123
+AUX bitcoin.confd 238 SHA256 72300b41d57325de5a5f2ddea449d5f414f278549fb665d60746707ee5de2549 SHA512 2b010d8c773a76868a11626ba0552f122cd51293cb39e06b7ed7e17be47f9e3790cc090f8311b32d441d3ff1eb4db266a4b2cd08693f7edbe2dde178254838d1 WHIRLPOOL f51d97b828b4b096d1ca924cb7256f648b94ae098a4f10dcfbac7d6045cf84da0c203b1e2d5569f3b304ba193501c9b9239c5ee1a1c11fbdb62bb9909c384358
+AUX bitcoin.initd-r1 938 SHA256 990eca502e34d43b27dc99ce81c1e89e8c3e2c2e92e5da7862a8eb7acf08cb66 SHA512 7c27ad2ed438dfbf7a03067806781ac04a3867997707374546e60dab24833a3943d90f8e790c3fe9fed3a81c4208d6c60dbc7939e8dedf8425bff2848013057d WHIRLPOOL f3acdfb5a2667088371f32eb419ffeb3e60014bbd725c6e28820514aad9bd958d242e6404521a1b89ff9c5d054c535676063b638c8e50dca0e259008598217f4
+AUX bitcoind.logrotate 110 SHA256 9b469c67e7af914199d699ac76279f194010f154be91f8136eddeeddf623a475 SHA512 b0e0634fc33979695fc0f37057f76b264ff3eb2655a8828d505a38621a5bba9fd4eafe47b012e5cb3863d607146b5a2d1a995787ed55cb6d5e6147ab795e1949 WHIRLPOOL 5ebd73178d3228b9477b5eae51ee783857d3a88a765c6802923f2a1d682c00cd4cefbf39e1f2d5192704ff2c72e8b91a38755cece6e139371ea2e75cab461e32
+AUX bitcoind.service 869 SHA256 c24332570f8ac155847372a4f9019a47a2e3c8c15435584dac4153b8eb300bc7 SHA512 d0e23b98bc9109e7e4d8a6459f73d1f9a06a3da71593613e22c5d0f31a8ad7473242b07690c6f22f35358ed869ffa7160d0daa65937462442bfc9028794321ea WHIRLPOOL 7992f776ac36277ce83898920ed5a8abc6b031f1d88214150c362c6f5befc869eb9901bd346da74da9fb56bda500fe9d3d9ff8dd46f1b3f257691cb106754a93
+DIST bitcoin-v0.8.6.tgz 3194026 SHA256 26fd485823ee15a823ca51a5ac7ed8664079ef15356a030e74a01f1a7a157170 SHA512 88e1d5dece485beaa95571016f41239db616323508038ea59d0fa3608639c03af06c0d782df3bf5a67d45d25c976bc07b977504ca6390e147e3b8605f3d3ce86 WHIRLPOOL 86a5118dda3f68226d30794bc1b363a75479fd55648146e4347017416d730c23ef4168553a5e70d95466157bf89055def81647790fe414d6182c1baf3e397344
+EBUILD bitcoind-0.8.6-r1.ebuild 2942 SHA256 0779f0dd683c57a5496e20d646d4a21004d6fee023c8765011df02fe8f29cca3 SHA512 c26d39263c237999a124b39df3f740eaa108b6d65c6dd13267fc0ba447502107e0aadbcb4d4f4829e3e425b50a524945734f3afab5dbb227aa2254806b29b028 WHIRLPOOL f825f1cb6b9d48ad32df5a829514833041670aa9e172eaac3dbd377f2bc938cbdb2c753536d41ce05076eba856611cc54da72d8f084ce7adcf557bfca9b6bb01
diff --git a/net-p2p/bitcoind/bitcoind-0.8.6-r1.ebuild b/net-p2p/bitcoind/bitcoind-0.8.6-r1.ebuild
new file mode 100644
index 00000000..eca1c1df
--- /dev/null
+++ b/net-p2p/bitcoind/bitcoind-0.8.6-r1.ebuild
@@ -0,0 +1,121 @@
+# Copyright 2010-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-p2p/bitcoind/bitcoind-0.8.6-r1.ebuild,v 1.1 2014/02/21 14:22:42 blueness Exp $
+
+EAPI="4"
+
+DB_VER="4.8"
+
+inherit bash-completion-r1 db-use eutils versionator systemd toolchain-funcs user
+
+MyPV="${PV/_/}"
+MyPN="bitcoin"
+MyP="${MyPN}-${MyPV}"
+
+DESCRIPTION="Original Bitcoin crypto-currency wallet for automated services"
+HOMEPAGE="http://bitcoin.org/"
+SRC_URI="https://github.com/${MyPN}/${MyPN}/archive/v${MyPV}.tar.gz -> ${MyPN}-v${PV}.tgz"
+
+LICENSE="MIT ISC GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="bash-completion examples ipv6 logrotate systemd upnp"
+
+RDEPEND="
+ >=dev-libs/boost-1.41.0[threads(+)]
+ dev-libs/openssl:0[-bindist]
+ logrotate? (
+ app-admin/logrotate
+ )
+ 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
+"
+
+S="${WORKDIR}/${MyP}"
+
+pkg_setup() {
+ local UG='bitcoin'
+ enewgroup "${UG}"
+ enewuser "${UG}" -1 -1 /var/lib/bitcoin "${UG}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/0.8.2-sys_leveldb.patch"
+ rm -r src/leveldb
+
+ 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_compile() {
+ OPTS=()
+
+ OPTS+=("DEBUGFLAGS=")
+ OPTS+=("CXXFLAGS=${CXXFLAGS}")
+ OPTS+=("LDFLAGS=${LDFLAGS}")
+
+ OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
+ OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
+
+ if use upnp; then
+ OPTS+=(USE_UPNP=1)
+ else
+ OPTS+=(USE_UPNP=)
+ fi
+ use ipv6 || OPTS+=("USE_IPV6=-")
+
+ OPTS+=("USE_SYSTEM_LEVELDB=1")
+
+ cd src || die
+ emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" ${PN}
+}
+
+src_test() {
+ cd src || die
+ emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" test_bitcoin
+ ./test_bitcoin || die 'Tests failed'
+}
+
+src_install() {
+ dobin src/${PN}
+
+ insinto /etc/bitcoin
+ newins "${FILESDIR}/bitcoin.conf" bitcoin.conf
+ fowners bitcoin:bitcoin /etc/bitcoin/bitcoin.conf
+ fperms 600 /etc/bitcoin/bitcoin.conf
+
+ newconfd "${FILESDIR}/bitcoin.confd" ${PN}
+ newinitd "${FILESDIR}/bitcoin.initd-r1" ${PN}
+ use systemd && systemd_dounit "${FILESDIR}/bitcoind.service"
+
+ keepdir /var/lib/bitcoin/.bitcoin
+ fperms 700 /var/lib/bitcoin
+ fowners bitcoin:bitcoin /var/lib/bitcoin/
+ fowners bitcoin:bitcoin /var/lib/bitcoin/.bitcoin
+ dosym /etc/bitcoin/bitcoin.conf /var/lib/bitcoin/.bitcoin/bitcoin.conf
+
+ dodoc doc/README.md doc/release-notes.md
+ doman contrib/debian/manpages/{bitcoind.1,bitcoin.conf.5}
+
+ if use bash-completion; then
+ newbashcomp contrib/${PN}.bash-completion ${PN}
+ fi
+
+ 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}/bitcoind.logrotate" bitcoind
+ fi
+}
diff --git a/net-p2p/bitcoind/files/0.8.2-sys_leveldb.patch b/net-p2p/bitcoind/files/0.8.2-sys_leveldb.patch
new file mode 100644
index 00000000..2b9ab1a6
--- /dev/null
+++ b/net-p2p/bitcoind/files/0.8.2-sys_leveldb.patch
@@ -0,0 +1,185 @@
+diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro
+index cf80986..520b5df 100644
+--- a/bitcoin-qt.pro
++++ b/bitcoin-qt.pro
+@@ -4,7 +4,7 @@ macx:TARGET = "Bitcoin-Qt"
+ VERSION = 0.8.0
+ 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
+
+@@ -98,25 +98,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 b41764f..30c524d 100644
+--- a/src/leveldb.cpp
++++ b/src/leveldb.cpp
+@@ -8,7 +8,9 @@
+ #include <leveldb/env.h>
+ #include <leveldb/cache.h>
+ #include <leveldb/filter_policy.h>
+-#include <memenv/memenv.h>
++#ifndef LEVELDB_WITHOUT_MEMENV
++#include <memenv.h>
++#endif
+
+ #include <boost/filesystem.hpp>
+
+@@ -42,8 +44,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 081edaf..27f2199 100644
+--- a/src/makefile.unix
++++ b/src/makefile.unix
+@@ -104,8 +104,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 \
+@@ -114,7 +113,6 @@ OBJS= \
+ obj/crypter.o \
+ obj/key.o \
+ obj/db.o \
+- obj/init.o \
+ obj/keystore.o \
+ obj/main.o \
+ obj/net.o \
+@@ -134,24 +132,43 @@ OBJS= \
+ obj/hash.o \
+ obj/bloom.o \
+ obj/noui.o \
+- obj/leveldb.o \
+ obj/txdb.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: bitcoind
+
+ test check: test_bitcoin FORCE
+ ./test_bitcoin
+
++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)
++DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers/memenv)
+ 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
+@@ -162,26 +179,28 @@ 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)
+
+-bitcoind: $(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))
++bitcoind: $(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)
++ $(P_TO_D)
++
++obj-test/leveldb.o: leveldb.cpp
++ $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
+
+-test_bitcoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
++test_bitcoin: $(TESTOBJS)
+ $(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ $(TESTLIBS) $(xLDFLAGS) $(LIBS)
+
+ clean:
diff --git a/net-p2p/bitcoind/files/bitcoin.conf b/net-p2p/bitcoind/files/bitcoin.conf
new file mode 100644
index 00000000..c6a55f3d
--- /dev/null
+++ b/net-p2p/bitcoind/files/bitcoin.conf
@@ -0,0 +1,8 @@
+# http://www.bitcoin.org/smf/index.php?topic=644.0
+#rpcuser=
+#rpcpassword=
+
+
+
+
+
diff --git a/net-p2p/bitcoind/files/bitcoin.confd b/net-p2p/bitcoind/files/bitcoin.confd
new file mode 100644
index 00000000..7c0868c3
--- /dev/null
+++ b/net-p2p/bitcoind/files/bitcoin.confd
@@ -0,0 +1,10 @@
+# Config file for /etc/init.d/bitcoin
+
+# owner of bitcoind process (don't change, must be existing)
+BITCOIN_USER="bitcoin"
+
+# See http://www.bitcoin.org/smf/index.php?topic=1063
+BITCOIN_OPTS="${BITCOIN_OPTS}"
+
+# nice level
+NICELEVEL="19"
diff --git a/net-p2p/bitcoind/files/bitcoin.initd-r1 b/net-p2p/bitcoind/files/bitcoin.initd-r1
new file mode 100644
index 00000000..57dc6d46
--- /dev/null
+++ b/net-p2p/bitcoind/files/bitcoin.initd-r1
@@ -0,0 +1,29 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-p2p/bitcoind/files/bitcoin.initd-r1,v 1.1 2014/02/21 14:22:42 blueness Exp $
+
+vardir="/var/lib/bitcoin"
+conffile="${vardir}/.bitcoin/bitcoin.conf"
+bitcoind_user="${BITCOIN_USER:-nobody:nobody}"
+
+description="Bitcoin crypto-currency wallet for automated services"
+pidfile="/var/run/${SVCNAME}.pid"
+command="/usr/bin/bitcoind"
+command_args="${BITCOIN_OPTS}"
+command_background="true"
+start_stop_daemon_args="-u ${bitcoind_user} -e HOME=${vardir} -N ${NICELEVEL:-0} -w 2000"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -f -o ${bitcoind_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/bitcoind/files/bitcoind.logrotate b/net-p2p/bitcoind/files/bitcoind.logrotate
new file mode 100644
index 00000000..36d8dc2b
--- /dev/null
+++ b/net-p2p/bitcoind/files/bitcoind.logrotate
@@ -0,0 +1,7 @@
+/var/lib/bitcoin/.bitcoin/debug.log {
+ weekly
+ sharedscripts
+ postrotate
+ killall -HUP bitcoind
+ endscript
+}
diff --git a/net-p2p/bitcoind/files/bitcoind.service b/net-p2p/bitcoind/files/bitcoind.service
new file mode 100644
index 00000000..97747009
--- /dev/null
+++ b/net-p2p/bitcoind/files/bitcoind.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/bitcoind.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/bitcoind.service.d/myopts.conf"
+# containing:
+# [Service]
+# Environment="BITCOIN_OPTS=-debug -logtimestamps"
+# Nice=10
+# This will override the setting appearing below.
+
+# Note that almost all daemon options could be specified in
+# /etc/bitcoin/bitcoin.conf
+
+[Unit]
+Description=Bitcoin Daemon
+After=network.target
+
+[Service]
+User=bitcoin
+Environment=BITCOIN_OPTS=
+ExecStart=/usr/bin/bitcoind -daemon=0 $BITCOIN_OPTS
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target