diff options
author | Matthew Brewer <tomboy64@sina.cn> | 2017-05-29 17:37:31 +0200 |
---|---|---|
committer | Matthew Brewer <tomboy64@sina.cn> | 2017-05-30 00:26:27 +0200 |
commit | e3bf6ad0559b9eb70e0dc4301d75298be7cd758c (patch) | |
tree | 2390edb7378f3b41cde387a64dcc21070d166cac | |
parent | add dev-perl/RPM2-1.300.0.ebuild (diff) | |
download | tbc-e3bf6ad0559b9eb70e0dc4301d75298be7cd758c.tar.gz tbc-e3bf6ad0559b9eb70e0dc4301d75298be7cd758c.tar.bz2 tbc-e3bf6ad0559b9eb70e0dc4301d75298be7cd758c.zip |
net-p2p/monero: new package
Package-Manager: Portage-2.3.6, Repoman-2.3.2
-rw-r--r-- | net-p2p/monero/Manifest | 1 | ||||
-rw-r--r-- | net-p2p/monero/files/monero.conf | 4 | ||||
-rw-r--r-- | net-p2p/monero/files/monerod.conf | 7 | ||||
-rw-r--r-- | net-p2p/monero/files/monerod.runscript | 72 | ||||
-rw-r--r-- | net-p2p/monero/files/monerod.service | 11 | ||||
-rw-r--r-- | net-p2p/monero/metadata.xml | 7 | ||||
-rw-r--r-- | net-p2p/monero/monero-0.10.3.1-r1.ebuild | 80 |
7 files changed, 182 insertions, 0 deletions
diff --git a/net-p2p/monero/Manifest b/net-p2p/monero/Manifest new file mode 100644 index 0000000..5652f58 --- /dev/null +++ b/net-p2p/monero/Manifest @@ -0,0 +1 @@ +DIST monero-0.10.3.1.tar.gz 48956495 SHA256 9bf321dd501a43a34fb647e535e1b1c583a9aa6a639ccab6305dea3253d6b2f2 SHA512 6856e6078eee5a9036cf7276490a00121b6670b417fd9d8ba8360746af320813fb26f3021079483a61a4bb0179627cfe687435a4146a4ce3cf4d4ad5d500ea95 WHIRLPOOL 51b85343a1f50145506cad5c494e91aa694705854cd64da784f3714983c56188dcbf365111a98f991f172dd594bed0be7cbc369b69de4e33d883f3c04d31692c diff --git a/net-p2p/monero/files/monero.conf b/net-p2p/monero/files/monero.conf new file mode 100644 index 0000000..9b9d7e1 --- /dev/null +++ b/net-p2p/monero/files/monero.conf @@ -0,0 +1,4 @@ +#rpcuser=username +#rpcpassword=password +#rpcallowip=127.0.0.1 +#rpcport= diff --git a/net-p2p/monero/files/monerod.conf b/net-p2p/monero/files/monerod.conf new file mode 100644 index 0000000..4950abc --- /dev/null +++ b/net-p2p/monero/files/monerod.conf @@ -0,0 +1,7 @@ +# Config file for monerod + +MONERO_USER="monero" + +MONERO_OPTS="${MONERO_OPTS}" + +NICELEVEL="19" diff --git a/net-p2p/monero/files/monerod.runscript b/net-p2p/monero/files/monerod.runscript new file mode 100644 index 0000000..f89c470 --- /dev/null +++ b/net-p2p/monero/files/monerod.runscript @@ -0,0 +1,72 @@ +#!/sbin/openrc-run +# Distributed under the terms of the GNU General Public License, v2 or later + +VARDIR="/var/lib/monero" +CONFFILE="${VARDIR}/.bitmonero/bitmonero.conf" + +depend() { + need net +} + +start() { + ebegin "Starting Monero daemon" + + pkg-config openrc + if [ $? = 0 ]; then + start_openrc + else + start_baselayout + fi +} + +stop() { + ebegin "Stopping Monero daemon" + + pkg-config openrc + if [ $? = 0 ]; then + stop_openrc + else + stop_baselayout + fi +} + +start_openrc() { + start-stop-daemon \ + --start --user "${MONERO_USER}" --name monerod \ + --pidfile /var/run/monerod.pid --make-pidfile \ + --env HOME="${VARDIR}" --exec /usr/bin/monerod \ + --nicelevel "${NICELEVEL}" \ + --background \ + --wait 2000 \ + -- ${MONERO_OPTS} + eend $? +} + +stop_openrc() { + start-stop-daemon --stop --user "${MONERO_USER}" \ + --name monerod --pidfile /var/run/monerod.pid \ + --wait 30000 \ + --progress + eend $? +} + +start_baselayout() { + start-stop-daemon \ + --start --user "${MONERO_USER}" --name monerod \ + --pidfile /var/run/monerod.pid --make-pidfile \ + --env HOME="${VARDIR}" --exec /usr/bin/monerod \ + --chuid "${MONERO_USER}" \ + --nicelevel "${NICELEVEL}" \ + --background \ + -- ${MONERO_OPTS} + eend $? +} + +stop_baselayout() { + start-stop-daemon \ + --stop \ + --user "${MONERO_USER}" \ + --name monerod \ + --pidfile /var/run/monerod.pid + eend $? +} diff --git a/net-p2p/monero/files/monerod.service b/net-p2p/monero/files/monerod.service new file mode 100644 index 0000000..ef2a731 --- /dev/null +++ b/net-p2p/monero/files/monerod.service @@ -0,0 +1,11 @@ +[Unit] +Description=Monero Daemon +After=network.target + +[Service] +User=monero +ExecStart=/usr/bin/monerod --non-interactive $MONERO_OPTS +ExecReload=/bin/kill -INT $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/net-p2p/monero/metadata.xml b/net-p2p/monero/metadata.xml new file mode 100644 index 0000000..dee4950 --- /dev/null +++ b/net-p2p/monero/metadata.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="person"> + <email>tomboy64@sina.cn</email> +</maintainer> +</pkgmetadata> diff --git a/net-p2p/monero/monero-0.10.3.1-r1.ebuild b/net-p2p/monero/monero-0.10.3.1-r1.ebuild new file mode 100644 index 0000000..3d93c4c --- /dev/null +++ b/net-p2p/monero/monero-0.10.3.1-r1.ebuild @@ -0,0 +1,80 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit cmake-utils eutils systemd user + +DESCRIPTION="A more secure, private, untraceable cryptocurrency" +HOMEPAGE="https://getmonero.org" +SRC_URI="https://github.com/monero-project/bitmonero/archive/v${PV}.tar.gz -> ${P}.tar.gz" +LICENSE="BSD" + +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="debug doc static test" + +RDEPEND=">=net-dns/unbound-1.4.16 + >=dev-libs/libevent-2.0.22 + >=dev-cpp/gtest-1.5 + >=dev-libs/boost-1.58 + dev-libs/openssl:0[-bindist]" +DEPEND="${RDEPEND} + >=dev-util/cmake-3 + >=sys-devel/gcc-4.7.3 + doc? ( app-doc/doxygen + media-gfx/graphviz ) + test? ( >=dev-cpp/gtest-1.5 )" + +pkg_setup() { + enewgroup monero + enewuser monero -1 -1 /var/lib/monero "monero" +} + +src_configure() { + local mycmakeargs=( + -DBUILD_TESTS=$(usex test ON OFF) + -DSTATIC=$(usex static ON OFF) ) + + cmake-utils_src_configure +} + +src_compile() { + cmake-utils_src_configure + + use doc && HAVE_DOT=YES doxygen Doxyfile +} + +src_install() { + cmake-utils_src_install + + insinto /etc/monero + doins "${FILESDIR}/monero.conf" + fowners monero:monero /etc/monero/monero.conf + fperms 600 /etc/monero/monero.conf + + newconfd "${FILESDIR}/monerod.conf" monerod + newinitd "${FILESDIR}/monerod.runscript" monerod + systemd_dounit "${FILESDIR}/monerod.service" + + keepdir /var/lib/monero/.bitmonero + fperms 700 /var/lib/monero + fowners monero:monero /var/lib/monero/ + fowners monero:monero /var/lib/monero/.bitmonero + dosym /etc/monero/monero.conf /var/lib/monero/.bitmonero/bitmonero.conf + + DOCS=( README.md ) + if use doc; then + unset i + for f in "${S}"/doc/html/*.html ; do + HTML_DOCS[i++]="${f}" + done + for f in "${S}"/doc/html/*.png ; do + HTML_DOCS[i++]="${f}" + done + for f in "${S}"/doc/html/*.js ; do + HTML_DOCS[i++]="${f}" + done + fi + einstalldocs +} |