diff options
Diffstat (limited to 'net-p2p')
-rw-r--r-- | net-p2p/mincoin/files/mincoin.conf | 3 | ||||
-rw-r--r-- | net-p2p/mincoin/files/mincoin.confd | 10 | ||||
-rw-r--r-- | net-p2p/mincoin/files/mincoin.initd | 104 | ||||
-rw-r--r-- | net-p2p/mincoin/files/mincoin.logrotate | 8 | ||||
-rw-r--r-- | net-p2p/mincoin/files/mincoin.service | 30 | ||||
-rw-r--r-- | net-p2p/mincoin/metadata.xml | 8 | ||||
-rw-r--r-- | net-p2p/mincoin/mincoin-0.6.1_p709_beta-r9.ebuild | 133 | ||||
-rw-r--r-- | net-p2p/mincoin/mincoin-9999.ebuild | 127 |
8 files changed, 423 insertions, 0 deletions
diff --git a/net-p2p/mincoin/files/mincoin.conf b/net-p2p/mincoin/files/mincoin.conf new file mode 100644 index 0000000..199c1bc --- /dev/null +++ b/net-p2p/mincoin/files/mincoin.conf @@ -0,0 +1,3 @@ +# http://www.bitcoin.org/smf/index.php?topic=644.0 +#rpcuser= +#rpcpassword= diff --git a/net-p2p/mincoin/files/mincoin.confd b/net-p2p/mincoin/files/mincoin.confd new file mode 100644 index 0000000..be881c1 --- /dev/null +++ b/net-p2p/mincoin/files/mincoin.confd @@ -0,0 +1,10 @@ +# Config file for /etc/init.d/mincoin + +# owner of mincion process (don't change, must be existing) +MINCOIN_USER="mincoin" + +# See http://www.bitcoin.org/smf/index.php?topic=1063 +MINCOIN_OPTS="${MINCOIN_OPTS}" + +# nice level +NICELEVEL="19" diff --git a/net-p2p/mincoin/files/mincoin.initd b/net-p2p/mincoin/files/mincoin.initd new file mode 100644 index 0000000..27c6e80 --- /dev/null +++ b/net-p2p/mincoin/files/mincoin.initd @@ -0,0 +1,104 @@ +#!/sbin/runscript +# Distributed under the terms of the GNU General Public License, v2 or later + +VARDIR="/var/lib/mincoin" +CONFFILE="${VARDIR}/.mincoin/mincoin.conf" + +depend() { + need net +} + +checkconfig() { + if [[ "${MINCOIN_USER}" == "" ]] ; then + eerror "Please edit /etc/conf.d/mincoin" + eerror "A user must be specified to run mincoin 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 "${MINCOIN_USER}" | cut -d ':' -f 1 ) -sq` ; then + eerror "Please edit /etc/conf.d/mincoin" + eerror "Specified user must exist!" + return 1 + fi + if `echo "${MINCOIN_USER}" | grep ':' -sq` ; then + if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${MINCOIN_USER}" | cut -d ':' -f 2 ) -sq` ; then + eerror "Please edit /etc/conf.d/mincoin" + 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 MinCoin daemon" + + pkg-config openrc + if [ $? = 0 ]; then + start_openrc + else + start_baselayout + fi +} + +stop() { + ebegin "Stopping MinCoin daemon" + + pkg-config openrc + if [ $? = 0 ]; then + stop_openrc + else + stop_baselayout + fi +} + +start_openrc() { + start-stop-daemon \ + --start --user "${MINCOIN_USER}" --name mincoin \ + --pidfile /var/run/mincoin.pid --make-pidfile \ + --env HOME="${VARDIR}" --exec /usr/bin/mincoin \ + --nicelevel "${NICELEVEL}" \ + --background \ + --wait 2000 \ + -- ${MINCOIN_OPTS} + eend $? +} + +stop_openrc() { + start-stop-daemon --stop --user "${MINCOIN_USER}" \ + --name mincoin --pidfile /var/run/mincoin.pid \ + --wait 30000 \ + --progress + eend $? +} + +start_baselayout() { + start-stop-daemon \ + --start --user "${MINCOIN_USER}" --name mincoin \ + --pidfile /var/run/mincoin.pid --make-pidfile \ + --env HOME="${VARDIR}" --exec /usr/bin/mincoin \ + --chuid "${MINCOIN_USER}" \ + --nicelevel "${NICELEVEL}" \ + --background \ + -- ${MINCOIN_OPTS} + eend $? +} + +stop_baselayout() { + start-stop-daemon \ + --stop \ + --user "${MINCOIN_USER}" \ + --name mincoin \ + --pidfile /var/run/mincoin.pid + eend $? +} diff --git a/net-p2p/mincoin/files/mincoin.logrotate b/net-p2p/mincoin/files/mincoin.logrotate new file mode 100644 index 0000000..5022cad --- /dev/null +++ b/net-p2p/mincoin/files/mincoin.logrotate @@ -0,0 +1,8 @@ +/var/lib/mincoin/.mincoin/debug.log { + weekly + sharedscripts + postrotate + killall -HUP mincoin + endscript +} + diff --git a/net-p2p/mincoin/files/mincoin.service b/net-p2p/mincoin/files/mincoin.service new file mode 100644 index 0000000..c4b154e --- /dev/null +++ b/net-p2p/mincoin/files/mincoin.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/mincoin.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/mincoin.service.d/myopts.conf" +# containing: +# [Service] +# Environment="MINCOIN_OPTS=-debug -logtimestamps" +# Nice=10 +# This will override the setting appearing below. + +# Note that almost all daemon options could be specified in +# /etc/mincoin/mincoin.conf + +[Unit] +Description=MinCoin Daemon +After=network.target + +[Service] +User=mincoin +Environment=MINCOIN_OPTS= +ExecStart=/usr/bin/mincoin -daemon=0 $MINCOIN_OPTS +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/net-p2p/mincoin/metadata.xml b/net-p2p/mincoin/metadata.xml new file mode 100644 index 0000000..b90fce6 --- /dev/null +++ b/net-p2p/mincoin/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>openstack</herd> + <use> + <flag name="logrotate">Install PyGobject binding</flag> + </use> +</pkgmetadata> diff --git a/net-p2p/mincoin/mincoin-0.6.1_p709_beta-r9.ebuild b/net-p2p/mincoin/mincoin-0.6.1_p709_beta-r9.ebuild new file mode 100644 index 0000000..4b3008c --- /dev/null +++ b/net-p2p/mincoin/mincoin-0.6.1_p709_beta-r9.ebuild @@ -0,0 +1,133 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: + +EAPI=5 + +DB_VER="4.8" + +inherit bash-completion-r1 db-use eutils systemd git-2 user + +MyPV="${PV/_/-}" +MyPN="mincoin" +MyP="${MyPN}-${MyPV}" + +DESCRIPTION="P2P Internet currency based on Bitcoin but easier to mine." +HOMEPAGE="http://mincoinforum.com/" +HOMEPAGE="http://www.min-coin.org/" +#SRC_URI="https://github.com/${MyPN}-project/${MyPN}/archive/v${MyPV}.tar.gz -> ${MyP}.tar.gz" +EGIT_REPO_URI="https://github.com/vipah/mincoin.git" +EGIT_HAS_SUBMODULES=1 + +LICENSE="MIT ISC GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="bash-completion examples ipv6 logrotate upnp" + +RDEPEND=" + dev-libs/boost[threads(+)] + dev-libs/openssl:0[-bindist] + logrotate? ( + app-admin/logrotate + ) + upnp? ( + <=net-libs/miniupnpc-1.7 + ) + sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx] + <=dev-libs/leveldb-1.14.0 +" +DEPEND="${RDEPEND} + >=app-shells/bash-4.1 + sys-apps/sed +" + +S="${WORKDIR}/${MyP}" + +pkg_setup() { + local UG='mincoin' + enewgroup "${UG}" + enewuser "${UG}" -1 -1 /var/lib/mincoin "${UG}" +} + +src_prepare() { +# epatch "${FILESDIR}"/${MyPN}-MAX_OUTBOUND_CONNECTIONS.patch +# epatch "${FILESDIR}"/${MyPN}-NO_DEBUGFLAGS_O3.patch + #epatch "${FILESDIR}"/${MyPN}-NODEBUG_NOIPV6.patch +# epatch "${FILESDIR}"/${MyPN}-CheckDiskSpace.patch + #epatch "${FILESDIR}"/${MyPN}-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_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[@]}" ${MyPN} +} + +#Tests are broken with and without our litecoin-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_litecoin +# ./test_litecoin || die 'Tests failed' +#} + +src_install() { + dobin src/${MyPN} + + insinto /etc/mincoin + doins "${FILESDIR}/mincoin.conf" + fowners mincoin:mincoin /etc/mincoin/mincoin.conf + fperms 600 /etc/mincoin/mincoin.conf + + newconfd "${FILESDIR}/mincoin.confd" ${PN} + newinitd "${FILESDIR}/mincoin.initd" ${PN} + systemd_dounit "${FILESDIR}/mincoin.service" + + keepdir /var/lib/mincoin/.mincoin + fperms 700 /var/lib/mincoin + fowners mincoin:mincoin /var/lib/mincoin/ + fowners mincoin:mincoin /var/lib/mincoin/.mincoin + dosym /etc/mincoin/mincoin.conf /var/lib/mincoin/.mincoin/mincoin.conf + dosym /var/log/mincoin.log /var/lib/mincoin/.mincoin/debug.log + + dodoc doc/README # doc/release-notes.md + newman contrib/debian/manpages/bitcoind.1 mincoin.1 + newman contrib/debian/manpages/bitcoin.conf.5 mincoin.conf.5 + + if use bash-completion; then + newbashcomp contrib/bitcoind.bash-completion ${PN}.bash-completion + fi + + if use examples; then + docinto examples + dodoc -r contrib/{bitrpc,pyminer,wallettools} + fi + + if use logrotate; then + insinto /etc/logrotate.d + newins "${FILESDIR}/mincoin.logrotate" mincoin + fi +} + diff --git a/net-p2p/mincoin/mincoin-9999.ebuild b/net-p2p/mincoin/mincoin-9999.ebuild new file mode 100644 index 0000000..9ab37ec --- /dev/null +++ b/net-p2p/mincoin/mincoin-9999.ebuild @@ -0,0 +1,127 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +DB_VER="4.8" + +inherit bash-completion-r1 db-use eutils systemd git-2 + +MyPV="${PV/_/-}" +MyPN="mincoin" +MyP="${MyPN}-${MyPV}" + +DESCRIPTION="P2P Internet currency based on Bitcoin but easier to mine." +HOMEPAGE="http://mincoinforum.com/" +HOMEPAGE="http://www.min-coin.org/" +#SRC_URI="https://github.com/${MyPN}-project/${MyPN}/archive/v${MyPV}.tar.gz -> ${MyP}.tar.gz" +EGIT_REPO_URI="https://github.com/vipah/mincoin.git" +EGIT_HAS_SUBMODULES=1 + +LICENSE="MIT ISC GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="bash-completion 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] + <=dev-libs/leveldb-1.12.0[-snappy] +" +DEPEND="${RDEPEND} + >=app-shells/bash-4.1 + sys-apps/sed +" + +S="${WORKDIR}/${MyP}" + +pkg_setup() { +# local UG='mincoin' + enewgroup "${PN}" + enewuser "${PN}" -1 -1 /var/lib/"${PN}" "${PN}" +} + +src_prepare() { + #epatch "${FILESDIR}"/${MyPN}-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_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[@]}" ${MyPN} +} + +#Tests are broken with and without our litecoin-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_litecoin +# ./test_litecoin || die 'Tests failed' +#} + +src_install() { + dobin src/${MyPN} + + insinto /etc/mincoin + doins "${FILESDIR}/mincoin.conf" + fowners mincoin:mincoin /etc/mincoin/mincoin.conf + fperms 600 /etc/mincoin/mincoin.conf + + newconfd "${FILESDIR}/mincoin.confd" ${PN} + newinitd "${FILESDIR}/mincoin.initd" ${PN} + systemd_dounit "${FILESDIR}/mincoin.service" + + keepdir /var/lib/mincoin/.mincoin + fperms 700 /var/lib/mincoin + fowners mincoin:mincoin /var/lib/mincoin/ + fowners mincoin:mincoin /var/lib/mincoin/.mincoin + dosym /etc/mincoin/mincoin.conf /var/lib/mincoin/.mincoin/mincoin.conf + + dodoc doc/README # doc/release-notes.md + newman contrib/debian/manpages/bitcoind.1 mincoin.1 + newman contrib/debian/manpages/bitcoin.conf.5 mincoin.conf.5 + + if use bash-completion; then + newbashcomp contrib/bitcoind.bash-completion ${PN}.bash-completion + fi + + if use examples; then + docinto examples + dodoc -r contrib/{bitrpc,pyminer,wallettools} + fi + + if use logrotate; then + insinto /etc/logrotate.d + newins "${FILESDIR}/mincoin.logrotate" mincoin + fi +} |