From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6135C15808B for ; Sat, 19 Feb 2022 22:37:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 67422E07D3; Sat, 19 Feb 2022 22:37:55 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 43A01E07D3 for ; Sat, 19 Feb 2022 22:37:55 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 32D23343654 for ; Sat, 19 Feb 2022 22:37:54 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 692A92E0 for ; Sat, 19 Feb 2022 22:37:52 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1645310256.56a649b1ba943cfa82538fdc9eeb40164d8346eb.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-irc/ergo/files/, net-irc/ergo/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-irc/ergo/ergo-2.9.1-r1.ebuild net-irc/ergo/files/ergo.confd-r1 net-irc/ergo/files/ergo.initd-r1 X-VCS-Directories: net-irc/ergo/ net-irc/ergo/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 56a649b1ba943cfa82538fdc9eeb40164d8346eb X-VCS-Branch: master Date: Sat, 19 Feb 2022 22:37:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ffc7fe45-ea3c-4c48-bec4-c7cc1dd4c5b7 X-Archives-Hash: 36db34f7446972284fd260ca8c8253bc commit: 56a649b1ba943cfa82538fdc9eeb40164d8346eb Author: Sam James gentoo org> AuthorDate: Sat Feb 19 22:33:06 2022 +0000 Commit: Sam James gentoo org> CommitDate: Sat Feb 19 22:37:36 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56a649b1 net-irc/ergo: update EAPI 7 -> 8; init script fixes - Mostly init script fixes: -- Add logging to init script -- Add delay so OpenRC realises if we crashed quickly b/c of e.g. bad config file -- General cleanups (like supporting multiple instances, style changes) - Enable tests (yay! the needed files are included in tarballs now) - Drop obsolete BDEPEND (go-module lower bound is higher) - Drop obsolete src_compile arg to go (default in min Go in eclass) - EAPI 8 Bug: https://github.com/ergochat/ergo/issues/1914 Thanks-to: Douglas Freed mtu.edu> Thanks-to: William Hubbs gentoo.org> Signed-off-by: Sam James gentoo.org> net-irc/ergo/ergo-2.9.1-r1.ebuild | 69 +++++++++++++++++++++++++++++++++++++++ net-irc/ergo/files/ergo.confd-r1 | 3 ++ net-irc/ergo/files/ergo.initd-r1 | 32 ++++++++++++++++++ 3 files changed, 104 insertions(+) diff --git a/net-irc/ergo/ergo-2.9.1-r1.ebuild b/net-irc/ergo/ergo-2.9.1-r1.ebuild new file mode 100644 index 000000000000..a836c2571de1 --- /dev/null +++ b/net-irc/ergo/ergo-2.9.1-r1.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit go-module systemd + +DESCRIPTION="A modern IRC server written in Go" +HOMEPAGE="https://ergo.chat/ https://github.com/ergochat/ergo" +SRC_URI="https://github.com/ergochat/ergo/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0 BSD-2 BSD ISC MIT MPL-2.0" +SLOT="0" +KEYWORDS="~amd64" + +# We may even want to package irctest in future? + +RDEPEND="acct-user/oragono + acct-group/oragono" + +DOCS=( README.md docs/MANUAL.md docs/USERGUIDE.md ) + +src_prepare() { + default + + # Minor fiddling with paths + sed -i \ + -e 's:/home/ergo/ergo:/usr/bin/ergo:' \ + -e 's:/home/ergo:/var/lib/ergo:' \ + -e 's:/var/lib/ergo/ircd.yaml:/etc/ergo/ircd.yaml:' \ + -e 's:User=ergo:User=oragono:' \ + distrib/systemd/ergo.service || die +} + +src_compile() { + go build . || die +} + +src_install() { + einstalldocs + + dobin ergo + + insinto /etc/ergo + doins default.yaml + + # Swap back in next release? + # Forked locally for https://github.com/ergochat/ergo/issues/1914 changes + #newinitd distrib/openrc/ergo.initd ergo + #newconfd distrib/openrc/ergo.confd ergo + + newinitd "${FILESDIR}"/ergo.initd-r1 ergo + newconfd "${FILESDIR}"/ergo.confd-r1 ergo + + keepdir /var/lib/ergo + fowners oragono:oragono /var/lib/ergo + + insinto /var/lib/ergo + doins -r languages/ + + systemd_dounit distrib/systemd/ergo.service +} + +pkg_postinst() { + if [[ -z "${REPLACING_VERSIONS}" ]] ; then + elog "Please copy the example config in ${EROOT}/etc/ergo:" + elog "e.g. cp ${EROOT}/etc/ergo/default.yaml ${EROOT}/etc/ergo/ircd.yaml" + fi +} diff --git a/net-irc/ergo/files/ergo.confd-r1 b/net-irc/ergo/files/ergo.confd-r1 new file mode 100644 index 000000000000..71f4585060e5 --- /dev/null +++ b/net-irc/ergo/files/ergo.confd-r1 @@ -0,0 +1,3 @@ +# /etc/conf.d/ergo: config file for /etc/init.d/ergo +ERGO_CONFIGFILE="/etc/ergo/ircd.yaml" +ERGO_USERNAME="oragono" diff --git a/net-irc/ergo/files/ergo.initd-r1 b/net-irc/ergo/files/ergo.initd-r1 new file mode 100644 index 000000000000..8bd1aba2b230 --- /dev/null +++ b/net-irc/ergo/files/ergo.initd-r1 @@ -0,0 +1,32 @@ +#!/sbin/openrc-run +name=${RC_SVCNAME} +description="ergo IRC daemon" + +command=/usr/bin/ergo +command_args="run --conf ${ERGO_CONFIGFILE:-'/etc/ergo/ircd.yaml'}" +command_user=${ERGO_USERNAME:-ergo} +command_background=true + +pidfile=/var/run/${RC_SVCNAME}.pid + +output_log="/var/log/${RC_SVCNAME}.out" +error_log="/var/log/${RC_SVCNAME}.err" +# --wait: to wait 1 second after launching to see if it survived startup +start_stop_daemon_args="--wait 1000" + +extra_started_commands="reload" + +depend() { + use dns + provide ircd +} + +start_pre() { + checkpath --owner ${command_user}:${command_user} --mode 0640 --file /var/log/${RC_SVCNAME}.out /var/log/${RC_SVCNAME}.err +} + +reload() { + ebegin "Reloading ${RC_SVCNAME}" + start-stop-daemon --signal HUP --pidfile "${pidfile}" + eend $? +}