public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-irc/ergo/files/, net-irc/ergo/
Date: Sat, 19 Feb 2022 22:37:52 +0000 (UTC)	[thread overview]
Message-ID: <1645310256.56a649b1ba943cfa82538fdc9eeb40164d8346eb.sam@gentoo> (raw)

commit:     56a649b1ba943cfa82538fdc9eeb40164d8346eb
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 19 22:33:06 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> 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 <dwfreed <AT> mtu.edu>
Thanks-to: William Hubbs <williamh <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> 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 $?
+}


             reply	other threads:[~2022-02-19 22:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-19 22:37 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-04-17 16:44 [gentoo-commits] repo/gentoo:master commit in: net-irc/ergo/files/, net-irc/ergo/ Sam James
2021-06-29  4:52 Sam James
2021-06-08  5:12 Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1645310256.56a649b1ba943cfa82538fdc9eeb40164d8346eb.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox