commit 22462a24d052b60854eeb2a8430f76b3c32d5ca7 parent 43af73ec85aae9a218758e566f1dab2437d266a5 Author: parazyd <parazyd@dyne.org> Date: Tue, 9 Feb 2021 17:48:36 +0100 net-p2p/electrum-personal-server: Add OpenRC initscripts. Diffstat:
M | net-p2p/electrum-personal-server/electrum-personal-server-9999.ebuild | | | 18 | +++++++++++++++++- |
A | net-p2p/electrum-personal-server/files/electrum-personal-server.confd | | | 9 | +++++++++ |
A | net-p2p/electrum-personal-server/files/electrum-personal-server.initd | | | 24 | ++++++++++++++++++++++++ |
3 files changed, 50 insertions(+), 1 deletion(-)
diff --git a/net-p2p/electrum-personal-server/electrum-personal-server-9999.ebuild b/net-p2p/electrum-personal-server/electrum-personal-server-9999.ebuild @@ -8,15 +8,31 @@ inherit distutils-r1 git-r3 DESCRIPTION="Maximally lightweight electrum server for a single user" HOMEPAGE="https://github.com/chris-belcher/electrum-personal-server/" -#SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" +# Enable when patches are upstreamed +#EGIT_REPO_URI="https://github.com/chris-belcher/electrum-personal-server" EGIT_REPO_URI="https://git.parazyd.org/electrum-personal-server" LICENSE="MIT" SLOT="0" KEYWORDS="~amd64 ~x86" +DEPEND="net-p2p/bitcoind[wallet]" +RDEPEND="${DEPEND}" + src_prepare() { default sed -e "s@share/doc/electrum-personal-server@&-${PV}@" -i setup.py distutils-r1_src_prepare } + +src_install() { + default + distutils-r1_src_install + newconfd "${FILESDIR}/${PN}.confd" "electrum-personal-server" + newinitd "${FILESDIR}/${PN}.initd" "electrum-personal-server" +} + +pkg_postinst() { + einfo "Example configuration has been installed in /usr/share/doc/${P}" + einfo "Copy it to /etc/electrum-personal-server.ini and configure it." +} diff --git a/net-p2p/electrum-personal-server/files/electrum-personal-server.confd b/net-p2p/electrum-personal-server/files/electrum-personal-server.confd @@ -0,0 +1,9 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +eps_user="bitcoin" +eps_group="bitcoin" + +eps_config="/etc/electrum-personal-server.ini" + +eps_args="${eps_config}" diff --git a/net-p2p/electrum-personal-server/files/electrum-personal-server.initd b/net-p2p/electrum-personal-server/files/electrum-personal-server.initd @@ -0,0 +1,24 @@ +#!/sbin/openrc +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +pidfile="/var/run/electrum-personal-server.pid" +command="/usr/bin/electrum-personal-server" +command_args="${eps_args}" +start_stop_daemon_args="-u ${eps_user} -b -m -p ${pidfile}" + +name="Electrum Personal Server" +description="Connects to the bitcoind RPC" + +depend() { + need bitcoind +} + +start_pre() { + if ! [ -e "${eps_config}" ]; then + eerror "" + eerror "Please create a configuration in ${eps_config}" + eerror "" + return 1 + fi +}