diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2011-12-23 19:19:38 +0000 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2011-12-23 19:19:38 +0000 |
commit | 021975bb6d4b9ddef72d40dd09fd9af0747b3f33 (patch) | |
tree | 9334cdc621ff926cf28564f0e8c021ac33352874 /net-p2p | |
parent | Stable for AMD64, wrt bug #395703 (diff) | |
download | gentoo-2-021975bb6d4b9ddef72d40dd09fd9af0747b3f33.tar.gz gentoo-2-021975bb6d4b9ddef72d40dd09fd9af0747b3f33.tar.bz2 gentoo-2-021975bb6d4b9ddef72d40dd09fd9af0747b3f33.zip |
Initial commit, proxy maintaining for Luke Dashjr, bug #328391
(Portage version: 2.1.10.41/cvs/Linux x86_64)
Diffstat (limited to 'net-p2p')
-rw-r--r-- | net-p2p/bitcoind/ChangeLog | 11 | ||||
-rw-r--r-- | net-p2p/bitcoind/bitcoind-0.4.2.ebuild | 91 | ||||
-rw-r--r-- | net-p2p/bitcoind/bitcoind-0.5.1.ebuild | 98 | ||||
-rw-r--r-- | net-p2p/bitcoind/files/0.4.2-Makefile.gentoo | 85 | ||||
-rw-r--r-- | net-p2p/bitcoind/files/bitcoin.conf | 8 | ||||
-rw-r--r-- | net-p2p/bitcoind/files/bitcoin.confd | 10 | ||||
-rw-r--r-- | net-p2p/bitcoind/files/bitcoin.initd | 104 | ||||
-rw-r--r-- | net-p2p/bitcoind/metadata.xml | 16 |
8 files changed, 423 insertions, 0 deletions
diff --git a/net-p2p/bitcoind/ChangeLog b/net-p2p/bitcoind/ChangeLog new file mode 100644 index 000000000000..0fa3ead85a32 --- /dev/null +++ b/net-p2p/bitcoind/ChangeLog @@ -0,0 +1,11 @@ + + +*bitcoind-0.5.1 (23 Dec 2011) +*bitcoind-0.4.2 (23 Dec 2011) + + 23 Dec 2011; Anthony G. Basile <blueness@gentoo.org> + +files/0.4.2-Makefile.gentoo, +bitcoind-0.4.2.ebuild, +bitcoind-0.5.1.ebuild, + +files/bitcoin.conf, +files/bitcoin.confd, +files/bitcoin.initd, + +metadata.xml: + Initial commit, proxy maintaining for Luke Dashjr, bug #328391 + diff --git a/net-p2p/bitcoind/bitcoind-0.4.2.ebuild b/net-p2p/bitcoind/bitcoind-0.4.2.ebuild new file mode 100644 index 000000000000..0617c8a03951 --- /dev/null +++ b/net-p2p/bitcoind/bitcoind-0.4.2.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-p2p/bitcoind/bitcoind-0.4.2.ebuild,v 1.1 2011/12/23 19:19:38 blueness Exp $ + +EAPI=4 + +DB_VER="4.8" + +inherit db-use eutils versionator + +DESCRIPTION="Original Bitcoin crypto-currency wallet for automated services" +HOMEPAGE="http://bitcoin.org/" +SRC_URI="http://gitorious.org/bitcoin/${PN}-stable/archive-tarball/v${PV/_/} -> bitcoin-v${PV}.tgz + eligius? ( http://luke.dashjr.org/programs/bitcoin/files/0.5-eligius_sendfee.patch ) +" + +LICENSE="MIT ISC" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+eligius ssl upnp" + +RDEPEND=" + >=dev-libs/boost-1.41.0 + dev-libs/crypto++ + dev-libs/openssl[-bindist] + upnp? ( + net-libs/miniupnpc + ) + sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx] +" +DEPEND="${RDEPEND} + >=app-shells/bash-4.1 +" + +S="${WORKDIR}/bitcoin-${PN}-stable" + +pkg_setup() { + local UG='bitcoin' + enewgroup "${UG}" + enewuser "${UG}" -1 -1 /var/lib/bitcoin "${UG}" +} + +src_prepare() { + cd src || die + cp "${FILESDIR}/0.4.2-Makefile.gentoo" "Makefile" || die + use eligius && epatch "${DISTDIR}/0.5-eligius_sendfee.patch" +} + +src_compile() { + local OPTS=() + local BOOST_PKG BOOST_VER BOOST_INC + + OPTS+=("CXXFLAGS=${CXXFLAGS}") + OPTS+=( "LDFLAGS=${LDFLAGS}") + + OPTS+=("DB_CXXFLAGS=-I$(db_includedir "${DB_VER}")") + OPTS+=("DB_LDFLAGS=-ldb_cxx-${DB_VER}") + + BOOST_PKG="$(best_version 'dev-libs/boost')" + BOOST_VER="$(get_version_component_range 1-2 "${BOOST_PKG/*boost-/}")" + BOOST_VER="$(replace_all_version_separators _ "${BOOST_VER}")" + BOOST_INC="/usr/include/boost-${BOOST_VER}" + OPTS+=("BOOST_CXXFLAGS=-I${BOOST_INC}") + OPTS+=("BOOST_LIB_SUFFIX=-${BOOST_VER}") + + use ssl && OPTS+=(USE_SSL=1) + use upnp && OPTS+=(USE_UPNP=1) + + cd src || die + emake "${OPTS[@]}" ${PN} +} + +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" ${PN} + + 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 +} diff --git a/net-p2p/bitcoind/bitcoind-0.5.1.ebuild b/net-p2p/bitcoind/bitcoind-0.5.1.ebuild new file mode 100644 index 000000000000..2b43a9257234 --- /dev/null +++ b/net-p2p/bitcoind/bitcoind-0.5.1.ebuild @@ -0,0 +1,98 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-p2p/bitcoind/bitcoind-0.5.1.ebuild,v 1.1 2011/12/23 19:19:38 blueness Exp $ + +EAPI=4 + +DB_VER="4.8" + +inherit db-use eutils versionator + +DESCRIPTION="Original Bitcoin crypto-currency wallet for automated services" +HOMEPAGE="http://bitcoin.org/" +SRC_URI="https://github.com/bitcoin/bitcoin/tarball/v${PV/_/} -> bitcoin-v${PV}.tgz + eligius? ( http://luke.dashjr.org/programs/bitcoin/files/0.5-eligius_sendfee.patch ) +" + +LICENSE="MIT ISC" +SLOT="0" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="+eligius examples ssl upnp" + +RDEPEND=" + >=dev-libs/boost-1.41.0 + dev-libs/openssl[-bindist] + upnp? ( + net-libs/miniupnpc + ) + sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx] +" +DEPEND="${RDEPEND} + >=app-shells/bash-4.1 +" + +S="${WORKDIR}/bitcoin-bitcoin-5623ee7" + +pkg_setup() { + local UG='bitcoin' + enewgroup "${UG}" + enewuser "${UG}" -1 -1 /var/lib/bitcoin "${UG}" +} + +src_prepare() { + cd src || die + use eligius && epatch "${DISTDIR}/0.5-eligius_sendfee.patch" +} + +src_compile() { + local OPTS=() + local BOOST_PKG BOOST_VER BOOST_INC + + OPTS+=("CXXFLAGS=${CXXFLAGS}") + OPTS+=("LDFLAGS=${LDFLAGS}") + + OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")") + OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}") + + BOOST_PKG="$(best_version 'dev-libs/boost')" + BOOST_VER="$(get_version_component_range 1-2 "${BOOST_PKG/*boost-/}")" + BOOST_VER="$(replace_all_version_separators _ "${BOOST_VER}")" + BOOST_INC="/usr/include/boost-${BOOST_VER}" + OPTS+=("BOOST_INCLUDE_PATH=${BOOST_INC}") + OPTS+=("BOOST_LIB_SUFFIX=-${BOOST_VER}") + + use ssl && OPTS+=(USE_SSL=1) + if use upnp; then + OPTS+=(USE_UPNP=1) + else + OPTS+=(USE_UPNP=) + fi + + cd src || die + emake -f makefile.unix "${OPTS[@]}" ${PN} +} + +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" ${PN} + + 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 + + if use examples; then + docinto examples + dodoc -r contrib/{bitrpc,pyminer,wallettools} + fi +} diff --git a/net-p2p/bitcoind/files/0.4.2-Makefile.gentoo b/net-p2p/bitcoind/files/0.4.2-Makefile.gentoo new file mode 100644 index 000000000000..fc0bf5abf2f3 --- /dev/null +++ b/net-p2p/bitcoind/files/0.4.2-Makefile.gentoo @@ -0,0 +1,85 @@ +# Copyright (c) 2009-2010 Satoshi Nakamoto, 2010 Myckel Habets, 2011 Luke Dashjr +# Distributed under the MIT/X11 software license, see the accompanying +# file license.txt or http://www.opensource.org/licenses/mit-license.php. + +USE_SSL := +USE_UPNP := + +WXINCLUDEPATHS=$(shell wx-config --cxxflags) +WXLIBS=$(shell wx-config --libs) + +CXXFLAGS := -g -O2 +LDFLAGS := + +xLDFLAGS += \ + -Wl,-Bdynamic \ + -l boost_system$(BOOST_LIB_SUFFIX) \ + -l boost_filesystem$(BOOST_LIB_SUFFIX) \ + -l boost_program_options$(BOOST_LIB_SUFFIX) \ + -l boost_thread$(BOOST_LIB_SUFFIX) \ + -l ssl \ + -l crypto \ + -l crypto++ \ + -l z \ + -l dl + +xCXXFLAGS += -pthread +xLDFLAGS += -pthread + +xCXXFLAGS += $(BOOST_CXXFLAGS) +xLDFLAGS += $(BOOST_LDFLAGS) + +xCXXFLAGS += $(DB_CXXFLAGS) +xLDFLAGS += $(DB_LDFLAGS) + +ifneq ($(USE_SSL),) + xCXXFLAGS += -DUSE_SSL +endif + +ifneq ($(USE_UPNP),) + xLDFLAGS += -l miniupnpc + xCXXFLAGS += -DUSE_UPNP=$(USE_UPNP) +endif + +xCXXFLAGS += -D__WXDEBUG__ +xCXXFLAGS += -DNOPCH +xCXXFLAGS += -Wno-invalid-offsetof -Wformat + +xCXXFLAGS += $(CXXFLAGS) +xLDFLAGS += $(LDFLAGS) + +HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \ + checkpoints.h crypter.h keystore.h wallet.h protocol.h \ + script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h + +OBJS= \ + obj/checkpoints.o \ + obj/crypter.o \ + obj/util.o \ + obj/script.o \ + obj/db.o \ + obj/net.o \ + obj/protocol.o \ + obj/irc.o \ + obj/keystore.o \ + obj/main.o \ + obj/wallet.o \ + obj/rpc.o \ + obj/init.o + + +all: bitcoin + + +obj/%.o: %.cpp $(HEADERS) + $(CXX) -c $(xCXXFLAGS) $(WXINCLUDEPATHS) -DGUI -o $@ $< + +bitcoin: $(OBJS) obj/ui.o obj/uibase.o + $(CXX) -o $@ $^ $(WXLIBS) $(xLDFLAGS) + + +obj/nogui/%.o: %.cpp $(HEADERS) + $(CXX) -c $(xCXXFLAGS) -o $@ $< + +bitcoind: $(OBJS:obj/%=obj/nogui/%) + $(CXX) -o $@ $^ $(xLDFLAGS) diff --git a/net-p2p/bitcoind/files/bitcoin.conf b/net-p2p/bitcoind/files/bitcoin.conf new file mode 100644 index 000000000000..c6a55f3d9133 --- /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 000000000000..7c0868c3f535 --- /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 b/net-p2p/bitcoind/files/bitcoin.initd new file mode 100644 index 000000000000..33c88d1bb731 --- /dev/null +++ b/net-p2p/bitcoind/files/bitcoin.initd @@ -0,0 +1,104 @@ +#!/sbin/runscript +# Distributed under the terms of the GNU General Public License, v2 or later + +VARDIR="/var/lib/bitcoin" +CONFFILE="${VARDIR}/.bitcoin/bitcoin.conf" + +depend() { + need net +} + +checkconfig() { + if [[ "${BITCOIN_USER}" == "" ]] ; then + eerror "Please edit /etc/conf.d/bitcoind" + eerror "A user must be specified to run bitcoind 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 "${BITCOIN_USER}" | cut -d ':' -f 1 ) -sq` ; then + eerror "Please edit /etc/conf.d/bitcoind" + eerror "Specified user must exist!" + return 1 + fi + if `echo "${BITCOIN_USER}" | grep ':' -sq` ; then + if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${BITCOIN_USER}" | cut -d ':' -f 2 ) -sq` ; then + eerror "Please edit /etc/conf.d/bitcoind" + 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 Bitcoind daemon" + + pkg-config openrc + if [ $? = 0 ]; then + start_openrc + else + start_baselayout + fi +} + +stop() { + ebegin "Stopping Bitcoin daemon" + + pkg-config openrc + if [ $? = 0 ]; then + stop_openrc + else + stop_baselayout + fi +} + +start_openrc() { + start-stop-daemon \ + --start --user "${BITCOIN_USER}" --name bitcoind \ + --pidfile /var/run/bitcoind.pid --make-pidfile \ + --env HOME="${VARDIR}" --exec /usr/bin/bitcoind \ + --nicelevel "${NICELEVEL}" \ + --background \ + --wait 2000 \ + -- ${BITCOIN_OPTS} + eend $? +} + +stop_openrc() { + start-stop-daemon --stop --user "${BITCOIN_USER}" \ + --name bitcoind --pidfile /var/run/bitcoind.pid \ + --wait 30000 \ + --progress + eend $? +} + +start_baselayout() { + start-stop-daemon \ + --start --user "${BITCOIN_USER}" --name bitcoind \ + --pidfile /var/run/bitcoind.pid --make-pidfile \ + --env HOME="${VARDIR}" --exec /usr/bin/bitcoind \ + --chuid "${BITCOIN_USER}" \ + --nicelevel "${NICELEVEL}" \ + --background \ + -- ${BITCOIN_OPTS} + eend $? +} + +stop_baselayout() { + start-stop-daemon \ + --stop \ + --user "${BITCOIN_USER}" \ + --name bitcoind \ + --pidfile /var/run/bitcoind.pid + eend $? +} diff --git a/net-p2p/bitcoind/metadata.xml b/net-p2p/bitcoind/metadata.xml new file mode 100644 index 000000000000..e5803dcd78bf --- /dev/null +++ b/net-p2p/bitcoind/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>blueness@gentoo.org</email> + <name>Anthony G. Basile</name> + </maintainer> + <maintainer> + <email>luke_gentoo_bitcoin@dashjr.org</email> + <name>Luke Dashjr</name> + </maintainer> + <use> + <flag name='eligius'>Enable using lower fees accepted by Eligius</flag> + <flag name='upnp'>Enable Universal Plug and Play</flag> + </use> +</pkgmetadata> |