Gentoo Archives: gentoo-commits

From: Anna Vyalkova <cyber+gentoo@×××××.in>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: net-nntp/inn/files/, net-nntp/inn/
Date: Thu, 06 Jan 2022 14:14:57
Message-Id: 1641478203.d6482d5f54daf37101c0e4f56eb8f06d4de77fa5.cybertailor@gentoo
1 commit: d6482d5f54daf37101c0e4f56eb8f06d4de77fa5
2 Author: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
3 AuthorDate: Thu Jan 6 14:09:34 2022 +0000
4 Commit: Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
5 CommitDate: Thu Jan 6 14:10:03 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=d6482d5f
7
8 net-nntp/inn: revbump
9
10 Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>
11
12 net-nntp/inn/files/30inn | 1 +
13 net-nntp/inn/files/cnfsstat.confd | 8 +++
14 net-nntp/inn/files/cnfsstat.initd | 7 ++
15 net-nntp/inn/files/innd.confd | 8 +++
16 net-nntp/inn/files/innd.initd | 81 ++++++++++++++++++++++
17 net-nntp/inn/files/innd.service | 27 ++++++++
18 net-nntp/inn/files/innwatch.confd | 8 +++
19 net-nntp/inn/files/innwatch.initd | 11 +++
20 net-nntp/inn/files/ovdb.initd | 16 +++++
21 .../inn/{inn-2.6.4.ebuild => inn-2.6.4-r1.ebuild} | 50 +++++++++----
22 10 files changed, 205 insertions(+), 12 deletions(-)
23
24 diff --git a/net-nntp/inn/files/30inn b/net-nntp/inn/files/30inn
25 new file mode 100644
26 index 000000000..747f31d15
27 --- /dev/null
28 +++ b/net-nntp/inn/files/30inn
29 @@ -0,0 +1 @@
30 +CONFIG_PROTECT=/var/db/news
31
32 diff --git a/net-nntp/inn/files/cnfsstat.confd b/net-nntp/inn/files/cnfsstat.confd
33 new file mode 100644
34 index 000000000..82ff22305
35 --- /dev/null
36 +++ b/net-nntp/inn/files/cnfsstat.confd
37 @@ -0,0 +1,8 @@
38 +# Copyright 2022 Gentoo Authors
39 +# Distributed under the terms of the GNU General Public License v2
40 +
41 +# Initial sleep at startup (in seconds)
42 +#CNFSSTAT_DELAY=60
43 +
44 +# Options for cnfsstat
45 +#CNFSSTAT_OPTS=""
46
47 diff --git a/net-nntp/inn/files/cnfsstat.initd b/net-nntp/inn/files/cnfsstat.initd
48 new file mode 100644
49 index 000000000..51f84d056
50 --- /dev/null
51 +++ b/net-nntp/inn/files/cnfsstat.initd
52 @@ -0,0 +1,7 @@
53 +#!/sbin/openrc-run
54 +# Copyright 2022 Gentoo Authors
55 +# Distributed under the terms of the GNU General Public License v2
56 +
57 +command=/opt/inn/bin/cnfsstat
58 +command_args="-i ${CNFSSTAT_DELAY:=60} -s -l -P ${CNFSSTAT_OPTS}"
59 +pidfile=/run/news/cnfsstat.pid
60
61 diff --git a/net-nntp/inn/files/innd.confd b/net-nntp/inn/files/innd.confd
62 new file mode 100644
63 index 000000000..e9080ebb0
64 --- /dev/null
65 +++ b/net-nntp/inn/files/innd.confd
66 @@ -0,0 +1,8 @@
67 +# Copyright 2022 Gentoo Authors
68 +# Distributed under the terms of the GNU General Public License v2
69 +
70 +# Options for innd
71 +#INND_OPTS=""
72 +
73 +# Options for news.daily
74 +#INND_NEWSDAILY_OPTS=""
75
76 diff --git a/net-nntp/inn/files/innd.initd b/net-nntp/inn/files/innd.initd
77 new file mode 100644
78 index 000000000..e0643146e
79 --- /dev/null
80 +++ b/net-nntp/inn/files/innd.initd
81 @@ -0,0 +1,81 @@
82 +#!/sbin/openrc-run
83 +# Copyright 2022 Gentoo Authors
84 +# Distributed under the terms of the GNU General Public License v2
85 +#
86 +# Derived from the rc.news shell script.
87 +# shellcheck shell=bash
88 +
89 +extra_commands="daily"
90 +extra_started_commands="reload"
91 +
92 +description_reload="Reload the INN configuration."
93 +description_daily="Perform daily Usenet maintenance tasks."
94 +
95 +command=/opt/inn/bin/innd
96 +command_args="${INND_OPTS}"
97 +pidfile=/run/news/innd.pid
98 +
99 +depend() {
100 + need net
101 + use ovdb innwatch cnfsstat
102 +}
103 +
104 +daily() {
105 + ebegin "Executing news.daily"
106 + /opt/inn/bin/news.daily ${INND_NEWSDAILY_OPTS}
107 + eend $?
108 +}
109 +
110 +expirerm() {
111 + local rmfile=/var/log/news/expire.rm
112 + for f in ${rmfile} ${rmfile}.*; do
113 + if [[ -s ${f} ]]; then
114 + /opt/inn/bin/expirerm "${f}"
115 + fi
116 + done
117 +}
118 +
119 +start_pre() {
120 + local active=/var/db/news/active
121 + local old_newsdaily=$(find /var/db/news/.news.daily -mtime +1 -print 2>/dev/null)
122 + if [[ ! -f /var/db/news/.news.daily ]] || [[ -n ${old_newsdaily} ]]; then
123 + daily
124 + fi
125 +
126 + if [[ -f ${pidfile} ]] || [[ -f /run/news/.rebuildoverview ]] || [[ ! -s ${active} ]] ; then
127 + # active needs to be renumbered
128 + command_args+=" -r"
129 + fi
130 +
131 + # active file recovery
132 + if [[ ! -s ${active} ]] ; then
133 + if [[ -s ${active}.tmp ]]; then
134 + mv ${active}.tmp ${active} || return 1
135 + elif [[ -s ${active}.old ]]; then
136 + cp ${active}.old ${active} || return 1
137 + else
138 + eerror "${RC_SVCNAME} failed to start: ${active} does not exist"
139 + return 1
140 + fi
141 + fi
142 +
143 + # remove temporary batchfiles and lock files
144 + rm -f /var/spool/news/outgoing/bch*
145 + rm -f /run/news/LOCK*
146 + rm -f /run/news/{control,nntpin,.rebuildoverview}
147 +
148 + expirerm
149 +}
150 +
151 +stop() {
152 + ebegin "Stopping ${RC_SVCNAME}"
153 + /opt/inn/bin/ctlinnd throttle "OpenRC service stop"
154 + /opt/inn/bin/ctlinnd shutdown "OpenRC service stop"
155 + eend $?
156 +}
157 +
158 +reload() {
159 + ebegin "Reloading innd configuration"
160 + /opt/inn/bin/ctlinnd -t 20 reload "" "OpenRC service reload"
161 + eend $?
162 +}
163
164 diff --git a/net-nntp/inn/files/innd.service b/net-nntp/inn/files/innd.service
165 new file mode 100644
166 index 000000000..ae7db3a44
167 --- /dev/null
168 +++ b/net-nntp/inn/files/innd.service
169 @@ -0,0 +1,27 @@
170 +[Unit]
171 +Description=InterNetNews News Server
172 +Documentation=https://www.eyrie.org/~eagle/software/inn/
173 +After=network-online.target
174 +Wants=network-online.target
175 +ConditionPathExists=/etc/news/inn.conf
176 +
177 +[Service]
178 +Type=notify
179 +Restart=on-abort
180 +ExecStart=/opt/inn/bin/rc.news
181 +ExecReload=/opt/inn/bin/ctlinnd -t 20 reload '' 'systemd unit reload'
182 +ExecStop=/opt/inn/bin/rc.news stop
183 +PIDFile=/run/news/innd.pid
184 +User=news
185 +Group=news
186 +AmbientCapabilities=CAP_NET_BIND_SERVICE
187 +PrivateTmp=true
188 +ProtectControlGroups=true
189 +ProtectHome=true
190 +ProtectSystem=full
191 +RuntimeDirectory=news
192 +LimitNOFILE=infinity
193 +ReadWritePaths=/var/spool/news
194 +
195 +[Install]
196 +WantedBy=multi-user.target
197
198 diff --git a/net-nntp/inn/files/innwatch.confd b/net-nntp/inn/files/innwatch.confd
199 new file mode 100644
200 index 000000000..2abb56a1d
201 --- /dev/null
202 +++ b/net-nntp/inn/files/innwatch.confd
203 @@ -0,0 +1,8 @@
204 +# Copyright 2022 Gentoo Authors
205 +# Distributed under the terms of the GNU General Public License v2
206 +
207 +# Initial sleep at startup (in seconds)
208 +#INNWATCH_DELAY=60
209 +
210 +# Options for cnfsstat
211 +#INNWATCH_OPTS=""
212
213 diff --git a/net-nntp/inn/files/innwatch.initd b/net-nntp/inn/files/innwatch.initd
214 new file mode 100644
215 index 000000000..20eedda98
216 --- /dev/null
217 +++ b/net-nntp/inn/files/innwatch.initd
218 @@ -0,0 +1,11 @@
219 +#!/sbin/openrc-run
220 +# Copyright 2022 Gentoo Authors
221 +# Distributed under the terms of the GNU General Public License v2
222 +
223 +command=/opt/inn/bin/innwatch
224 +command_args="-i ${INNWATCH_DELAY:-60} ${INNWATCH_OPTS}"
225 +pidfile=/run/news/innwatch.pid
226 +
227 +stop_pre() {
228 + rm -f /run/news/LOCK.innwatch
229 +}
230
231 diff --git a/net-nntp/inn/files/ovdb.initd b/net-nntp/inn/files/ovdb.initd
232 new file mode 100644
233 index 000000000..84e17e2a9
234 --- /dev/null
235 +++ b/net-nntp/inn/files/ovdb.initd
236 @@ -0,0 +1,16 @@
237 +#!/sbin/openrc-run
238 +# Copyright 2022 Gentoo Authors
239 +# Distributed under the terms of the GNU General Public License v2
240 +
241 +command=/opt/inn/bin/ovdb_init
242 +pidfile=/run/news/ovdb_server.pid
243 +
244 +stop() {
245 + ebegin "Stopping ovdb_server"
246 + start-stop-daemon --stop --pidfile /run/news/ovdb_server.pid
247 + eend $?
248 +
249 + ebegin "Stopping ovdb_monitor"
250 + start-stop-daemon --stop --pidfile /run/news/ovdb_monitor.pid
251 + ewend $?
252 +}
253
254 diff --git a/net-nntp/inn/inn-2.6.4.ebuild b/net-nntp/inn/inn-2.6.4-r1.ebuild
255 similarity index 62%
256 rename from net-nntp/inn/inn-2.6.4.ebuild
257 rename to net-nntp/inn/inn-2.6.4-r1.ebuild
258 index 5b0671696..64951fc42 100644
259 --- a/net-nntp/inn/inn-2.6.4.ebuild
260 +++ b/net-nntp/inn/inn-2.6.4-r1.ebuild
261 @@ -5,14 +5,14 @@ EAPI=8
262
263 PYTHON_COMPAT=( python3_{8..10} )
264
265 -inherit optfeature python-single-r1 verify-sig
266 +inherit optfeature perl-functions python-single-r1 systemd verify-sig
267
268 DESCRIPTION="InterNetNews -- the Internet meets Netnews"
269 HOMEPAGE="https://www.eyrie.org/~eagle/software/inn/"
270 SRC_URI="https://archives.eyrie.org/software/${PN}/${P}.tar.gz
271 verify-sig? ( https://archives.eyrie.org/software/${PN}/${P}.tar.gz.sha256.asc )"
272
273 -LICENSE="ISC"
274 +LICENSE="BSD BSD-2 BSD-4 GPL-2+ ISC MIT RSA powell public-domain"
275 SLOT="0"
276 KEYWORDS="~amd64"
277 IUSE="berkdb gzip kerberos keywords largefile low-memory +perl +python sasl ssl systemd zlib"
278 @@ -25,7 +25,6 @@ DEPEND="
279 app-crypt/gnupg
280 sys-libs/pam
281 virtual/libcrypt:=
282 - virtual/sendmail
283 !berkdb? ( sys-libs/gdbm:= )
284 berkdb? ( sys-libs/db:* )
285 kerberos? ( app-crypt/mit-krb5 )
286 @@ -36,19 +35,16 @@ DEPEND="
287 systemd? ( sys-apps/systemd:= )
288 zlib? ( sys-libs/zlib:= )
289 "
290 -RDEPEND="${DEPEND}"
291 +RDEPEND="${DEPEND}
292 + virtual/sendmail
293 +"
294 BDEPEND="
295 sys-devel/flex
296 virtual/yacc
297 verify-sig? ( sec-keys/openpgp-keys-russallbery )
298 "
299
300 -DOCS=(
301 - ChangeLog CONTRIBUTORS HACKING INSTALL NEWS README TODO
302 - doc/{checklist,external-auth,FAQ} doc/history{,-innfeed}
303 - doc/hook-{perl,python} doc/{IPv6-info,sample-control}
304 - doc/config-{design,semantics,syntax}
305 -)
306 +DOCS=( ChangeLog CONTRIBUTORS HACKING INSTALL NEWS README TODO )
307
308 VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/russallbery.asc"
309
310 @@ -65,7 +61,20 @@ src_unpack() {
311
312 src_configure() {
313 econf_args=(
314 - --prefix=/opt/${PN}
315 + --prefix="${EPREFIX}"/opt/${PN}
316 + --libdir="${EPREFIX}"/usr/$(get_libdir)/${PN}
317 + --includedir="${EPREFIX}"/usr/include
318 + --sysconfdir="${EPREFIX}"/etc/news
319 +
320 + --with-db-dir="${EPREFIX}"/var/db/news
321 + --with-doc-dir="${EPREFIX}"/usr/share/doc/${PF}
322 + --with-http-dir="${EPREFIX}"/usr/share/${PN}/http
323 + --with-libperl-dir=$(perl_get_vendorlib)
324 + --with-log-dir="${EPREFIX}"/var/log/${PN}
325 + --with-run-dir="${EPREFIX}"/run/news
326 + --with-spool-dir="${EPREFIX}"/var/spool/news
327 + --with-tmp-dir="${EPREFIX}"/var/tmp/news
328 +
329 $(use_enable keywords)
330 $(use_enable largefile largefiles)
331 $(use_enable low-memory tagged-hash)
332 @@ -80,6 +89,8 @@ src_configure() {
333
334 if use gzip; then
335 econf_args+=( --with-log-compress=gzip )
336 + # elif use bzip2; then
337 + # econf_args+=( --with-log-compress=bzip2 )
338 else
339 econf_args+=( --with-log-compress=cat )
340 fi
341 @@ -98,10 +109,25 @@ src_test() {
342 src_install() {
343 default
344
345 + keepdir /var/log/inn/OLD
346 + keepdir /var/tmp/news
347 + keepdir /var/spool/news/{archive,articles,incoming/bad,innfeed,outgoing,overview}
348 +
349 + find "${ED}" -name '*.la' -delete || die
350 + rm "${ED}"/usr/share/doc/${PF}/{GPL,LICENSE} || die
351 + rm -r "${ED}"/{run} || die
352 +
353 # collision with sys-apps/man-pages
354 mv "${ED}"/usr/share/man/man3/{list,inn-list}.3 || die
355
356 - rm -r "${ED}"/opt/${PN}/{db,doc} || die
357 + doenvd "${FILESDIR}"/30inn
358 + newinitd "${FILESDIR}"/ovdb.initd ovdb
359 + for svc in cnfsstat innd innwatch; do
360 + newinitd "${FILESDIR}"/${svc}.initd ${svc}
361 + newconfd "${FILESDIR}"/${svc}.confd ${svc}
362 + done
363 +
364 + systemd_dounit "${FILESDIR}"/innd.service
365 }
366
367 pkg_postinst() {