Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-irc/ngircd/files/, net-irc/ngircd/
Date: Sun, 20 Feb 2022 21:10:23
Message-Id: 1645391037.df75ebf4605ac1b0b38f1025bb965d1dffb07431.sam@gentoo
1 commit: df75ebf4605ac1b0b38f1025bb965d1dffb07431
2 Author: Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
3 AuthorDate: Sat Feb 19 21:00:26 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 20 21:03:57 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=df75ebf4
7
8 net-irc/ngircd: add new OpenRC service
9
10 Ebuild changes (r3):
11 * update EAPI 7 -> 8
12 * uncomment PIDFile, ServerUID and ServerGID
13 * correct ngircd.conf's owner
14
15 Service changes (r2):
16 * use pidfile
17 * use declarative config
18 * add configtest command
19 * add reload command
20
21 Signed-off-by: Anna Vyalkova <cyber+gentoo <AT> sysrq.in>
22 Closes: https://github.com/gentoo/gentoo/pull/24277
23 Signed-off-by: Sam James <sam <AT> gentoo.org>
24
25 net-irc/ngircd/files/ngircd.conf.d | 8 +++
26 net-irc/ngircd/files/ngircd.init-r2.d | 52 ++++++++++++++++
27 net-irc/ngircd/ngircd-26.1-r3.ebuild | 111 ++++++++++++++++++++++++++++++++++
28 3 files changed, 171 insertions(+)
29
30 diff --git a/net-irc/ngircd/files/ngircd.conf.d b/net-irc/ngircd/files/ngircd.conf.d
31 new file mode 100644
32 index 000000000000..6088e5dae69a
33 --- /dev/null
34 +++ b/net-irc/ngircd/files/ngircd.conf.d
35 @@ -0,0 +1,8 @@
36 +# Configuration file
37 +#NGIRCD_CONFIGFILE="/etc/ngircd/ngircd.conf"
38 +
39 +# PID file
40 +#NGIRCD_PIDFILE="/var/run/ngircd/ngircd.pid"
41 +
42 +# Options for ngircd
43 +#NGIRCD_OPTS="-d -s"
44
45 diff --git a/net-irc/ngircd/files/ngircd.init-r2.d b/net-irc/ngircd/files/ngircd.init-r2.d
46 new file mode 100644
47 index 000000000000..1a54154ff417
48 --- /dev/null
49 +++ b/net-irc/ngircd/files/ngircd.init-r2.d
50 @@ -0,0 +1,52 @@
51 +#!/sbin/openrc-run
52 +# Copyright 1999-2022 Gentoo Authors
53 +# Distributed under the terms of the GNU General Public License v2
54 +
55 +extra_commands="configtest"
56 +extra_started_commands="reload"
57 +
58 +description="IRC server"
59 +description_configtest="Run ngircd's internal config check."
60 +description_reload="Reload the ngircd's configuration."
61 +
62 +: ${NGIRCD_CONFIGFILE:=/etc/ngircd/${RC_SVCNAME}.conf}
63 +
64 +command="/usr/sbin/ngircd"
65 +command_args="${NGIRCD_OPTS} -f \"${NGIRCD_CONFIGFILE}\""
66 +command_args_foreground="-n"
67 +command_user="ngircd:ngircd"
68 +pidfile="${NGIRCD_PIDFILE:-/var/run/ngircd/${RC_SVCNAME}.pid}"
69 +
70 +depend() {
71 + need net
72 + use logger
73 + provide ircd
74 +}
75 +
76 +start_pre() {
77 + checkpath -f "${pidfile}" -o ${command_user} || return 1
78 + if [ "${RC_CMD}" != "restart" ]; then
79 + configtest || return 1
80 + fi
81 +}
82 +
83 +stop_pre() {
84 + if [ "${RC_CMD}" = "restart" ]; then
85 + configtest || return 1
86 + fi
87 +}
88 +
89 +reload() {
90 + configtest || return 1
91 + ebegin "Refreshing ${RC_SVCNAME}'s configuration"
92 + start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
93 + eend $? "Failed to reload ${RC_SVCNAME}"
94 +}
95 +
96 +configtest() {
97 + ebegin "Checking ${RC_SVCNAME}'s configuration"
98 + # "press enter to continue"
99 + echo | ${command} -f "${NGIRCD_CONFIGFILE}" -t >/dev/null
100 +
101 + eend $? "failed, please correct errors in the config file"
102 +}
103
104 diff --git a/net-irc/ngircd/ngircd-26.1-r3.ebuild b/net-irc/ngircd/ngircd-26.1-r3.ebuild
105 new file mode 100644
106 index 000000000000..579814e2b0e5
107 --- /dev/null
108 +++ b/net-irc/ngircd/ngircd-26.1-r3.ebuild
109 @@ -0,0 +1,111 @@
110 +# Copyright 1999-2022 Gentoo Authors
111 +# Distributed under the terms of the GNU General Public License v2
112 +
113 +EAPI=8
114 +
115 +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/alexbarton.asc"
116 +inherit verify-sig
117 +
118 +DESCRIPTION="An IRC server written from scratch"
119 +HOMEPAGE="https://ngircd.barton.de/"
120 +SRC_URI="https://arthur.barton.de/pub/${PN}/${P}.tar.gz"
121 +SRC_URI+=" verify-sig? ( https://arthur.barton.de/pub/${PN}/${P}.tar.gz.sig )"
122 +
123 +LICENSE="GPL-2"
124 +SLOT="0"
125 +KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~x64-macos"
126 +IUSE="debug gnutls ident irc-plus +ipv6 pam +ssl strict-rfc tcpd test zlib"
127 +
128 +# Flaky test needs investigation (bug 719256)
129 +RESTRICT="test"
130 +
131 +RDEPEND="
132 + acct-user/ngircd
133 + irc-plus? ( virtual/libiconv )
134 + ident? ( net-libs/libident )
135 + pam? ( sys-libs/pam )
136 + ssl? (
137 + gnutls? ( net-libs/gnutls:= )
138 + !gnutls? (
139 + dev-libs/openssl:0=
140 + )
141 + )
142 + tcpd? ( sys-apps/tcp-wrappers )
143 + zlib? ( sys-libs/zlib )
144 +"
145 +DEPEND="${RDEPEND}"
146 +BDEPEND="
147 + test? (
148 + dev-tcltk/expect
149 + net-misc/netkit-telnetd
150 + )
151 + verify-sig? ( sec-keys/openpgp-keys-alexbarton )
152 +"
153 +
154 +src_prepare() {
155 + default
156 +
157 + if ! use prefix ; then
158 + sed -i \
159 + -e "/;ServerUID = /s/65534/ngircd/" \
160 + -e "/;ServerGID = /s/65534/ngircd/" \
161 + doc/sample-ngircd.conf.tmpl || die
162 + fi
163 +
164 + # make pidfiles work out-of-the-box
165 + sed -i \
166 + -e "/;PidFile = /s/;//" \
167 + -e "/;ServerUID = /s/;//" \
168 + -e "/;ServerGID = /s/;//" \
169 + doc/sample-ngircd.conf.tmpl || die
170 +
171 + # Note that if we need to use automake, we need a certain version (for now):
172 + # https://github.com/ngircd/ngircd/issues/261
173 + # WANT_AUTOMAKE=1.11
174 + # eautomake
175 +}
176 +
177 +src_configure() {
178 + local myeconf=(
179 + --sysconfdir="${EPREFIX}"/etc/${PN}
180 + $(use_enable debug sniffer)
181 + $(use_enable debug)
182 + $(use_enable irc-plus ircplus)
183 + $(use_enable ipv6)
184 + $(use_enable strict-rfc)
185 + $(use_with irc-plus iconv)
186 + $(use_with ident)
187 + $(use_with pam)
188 + $(use_with tcpd tcp-wrappers)
189 + $(use_with zlib)
190 + )
191 +
192 + if use ssl ; then
193 + if use gnutls ; then
194 + myeconf+=(
195 + $( use_with gnutls )
196 + )
197 + else
198 + myeconf+=(
199 + $( use_with !gnutls openssl )
200 + )
201 + fi
202 + fi
203 +
204 + econf "${myeconf[@]}"
205 +}
206 +
207 +src_install() {
208 + default
209 +
210 + fowners ngircd:ngircd /etc/ngircd/ngircd.conf
211 + newinitd "${FILESDIR}"/ngircd.init-r2.d ngircd
212 + newconfd "${FILESDIR}"/ngircd.conf.d ngircd
213 +}
214 +
215 +pkg_postinst() {
216 + if [[ -z ${REPLACING_VERSIONS} ]] && use pam ; then
217 + elog "ngircd will use PAMIsOptionalPAM by default, please change this option."
218 + elog "You may not be able to login until you change this."
219 + fi
220 +}