net-nntp/inn: revbump

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
This commit is contained in:
Anna (cybertailor) Vyalkova
2022-01-06 19:09:34 +05:00
parent 63972cb3e3
commit d6482d5f54
10 changed files with 205 additions and 12 deletions

1
net-nntp/inn/files/30inn Normal file
View File

@@ -0,0 +1 @@
CONFIG_PROTECT=/var/db/news

View File

@@ -0,0 +1,8 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Initial sleep at startup (in seconds)
#CNFSSTAT_DELAY=60
# Options for cnfsstat
#CNFSSTAT_OPTS=""

View File

@@ -0,0 +1,7 @@
#!/sbin/openrc-run
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
command=/opt/inn/bin/cnfsstat
command_args="-i ${CNFSSTAT_DELAY:=60} -s -l -P ${CNFSSTAT_OPTS}"
pidfile=/run/news/cnfsstat.pid

View File

@@ -0,0 +1,8 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Options for innd
#INND_OPTS=""
# Options for news.daily
#INND_NEWSDAILY_OPTS=""

View File

@@ -0,0 +1,81 @@
#!/sbin/openrc-run
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
#
# Derived from the rc.news shell script.
# shellcheck shell=bash
extra_commands="daily"
extra_started_commands="reload"
description_reload="Reload the INN configuration."
description_daily="Perform daily Usenet maintenance tasks."
command=/opt/inn/bin/innd
command_args="${INND_OPTS}"
pidfile=/run/news/innd.pid
depend() {
need net
use ovdb innwatch cnfsstat
}
daily() {
ebegin "Executing news.daily"
/opt/inn/bin/news.daily ${INND_NEWSDAILY_OPTS}
eend $?
}
expirerm() {
local rmfile=/var/log/news/expire.rm
for f in ${rmfile} ${rmfile}.*; do
if [[ -s ${f} ]]; then
/opt/inn/bin/expirerm "${f}"
fi
done
}
start_pre() {
local active=/var/db/news/active
local old_newsdaily=$(find /var/db/news/.news.daily -mtime +1 -print 2>/dev/null)
if [[ ! -f /var/db/news/.news.daily ]] || [[ -n ${old_newsdaily} ]]; then
daily
fi
if [[ -f ${pidfile} ]] || [[ -f /run/news/.rebuildoverview ]] || [[ ! -s ${active} ]] ; then
# active needs to be renumbered
command_args+=" -r"
fi
# active file recovery
if [[ ! -s ${active} ]] ; then
if [[ -s ${active}.tmp ]]; then
mv ${active}.tmp ${active} || return 1
elif [[ -s ${active}.old ]]; then
cp ${active}.old ${active} || return 1
else
eerror "${RC_SVCNAME} failed to start: ${active} does not exist"
return 1
fi
fi
# remove temporary batchfiles and lock files
rm -f /var/spool/news/outgoing/bch*
rm -f /run/news/LOCK*
rm -f /run/news/{control,nntpin,.rebuildoverview}
expirerm
}
stop() {
ebegin "Stopping ${RC_SVCNAME}"
/opt/inn/bin/ctlinnd throttle "OpenRC service stop"
/opt/inn/bin/ctlinnd shutdown "OpenRC service stop"
eend $?
}
reload() {
ebegin "Reloading innd configuration"
/opt/inn/bin/ctlinnd -t 20 reload "" "OpenRC service reload"
eend $?
}

View File

@@ -0,0 +1,27 @@
[Unit]
Description=InterNetNews News Server
Documentation=https://www.eyrie.org/~eagle/software/inn/
After=network-online.target
Wants=network-online.target
ConditionPathExists=/etc/news/inn.conf
[Service]
Type=notify
Restart=on-abort
ExecStart=/opt/inn/bin/rc.news
ExecReload=/opt/inn/bin/ctlinnd -t 20 reload '' 'systemd unit reload'
ExecStop=/opt/inn/bin/rc.news stop
PIDFile=/run/news/innd.pid
User=news
Group=news
AmbientCapabilities=CAP_NET_BIND_SERVICE
PrivateTmp=true
ProtectControlGroups=true
ProtectHome=true
ProtectSystem=full
RuntimeDirectory=news
LimitNOFILE=infinity
ReadWritePaths=/var/spool/news
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,8 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Initial sleep at startup (in seconds)
#INNWATCH_DELAY=60
# Options for cnfsstat
#INNWATCH_OPTS=""

View File

@@ -0,0 +1,11 @@
#!/sbin/openrc-run
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
command=/opt/inn/bin/innwatch
command_args="-i ${INNWATCH_DELAY:-60} ${INNWATCH_OPTS}"
pidfile=/run/news/innwatch.pid
stop_pre() {
rm -f /run/news/LOCK.innwatch
}

View File

@@ -0,0 +1,16 @@
#!/sbin/openrc-run
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
command=/opt/inn/bin/ovdb_init
pidfile=/run/news/ovdb_server.pid
stop() {
ebegin "Stopping ovdb_server"
start-stop-daemon --stop --pidfile /run/news/ovdb_server.pid
eend $?
ebegin "Stopping ovdb_monitor"
start-stop-daemon --stop --pidfile /run/news/ovdb_monitor.pid
ewend $?
}

View File

@@ -5,14 +5,14 @@ EAPI=8
PYTHON_COMPAT=( python3_{8..10} )
inherit optfeature python-single-r1 verify-sig
inherit optfeature perl-functions python-single-r1 systemd verify-sig
DESCRIPTION="InterNetNews -- the Internet meets Netnews"
HOMEPAGE="https://www.eyrie.org/~eagle/software/inn/"
SRC_URI="https://archives.eyrie.org/software/${PN}/${P}.tar.gz
verify-sig? ( https://archives.eyrie.org/software/${PN}/${P}.tar.gz.sha256.asc )"
LICENSE="ISC"
LICENSE="BSD BSD-2 BSD-4 GPL-2+ ISC MIT RSA powell public-domain"
SLOT="0"
KEYWORDS="~amd64"
IUSE="berkdb gzip kerberos keywords largefile low-memory +perl +python sasl ssl systemd zlib"
@@ -25,7 +25,6 @@ DEPEND="
app-crypt/gnupg
sys-libs/pam
virtual/libcrypt:=
virtual/sendmail
!berkdb? ( sys-libs/gdbm:= )
berkdb? ( sys-libs/db:* )
kerberos? ( app-crypt/mit-krb5 )
@@ -36,19 +35,16 @@ DEPEND="
systemd? ( sys-apps/systemd:= )
zlib? ( sys-libs/zlib:= )
"
RDEPEND="${DEPEND}"
RDEPEND="${DEPEND}
virtual/sendmail
"
BDEPEND="
sys-devel/flex
virtual/yacc
verify-sig? ( sec-keys/openpgp-keys-russallbery )
"
DOCS=(
ChangeLog CONTRIBUTORS HACKING INSTALL NEWS README TODO
doc/{checklist,external-auth,FAQ} doc/history{,-innfeed}
doc/hook-{perl,python} doc/{IPv6-info,sample-control}
doc/config-{design,semantics,syntax}
)
DOCS=( ChangeLog CONTRIBUTORS HACKING INSTALL NEWS README TODO )
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/russallbery.asc"
@@ -65,7 +61,20 @@ src_unpack() {
src_configure() {
econf_args=(
--prefix=/opt/${PN}
--prefix="${EPREFIX}"/opt/${PN}
--libdir="${EPREFIX}"/usr/$(get_libdir)/${PN}
--includedir="${EPREFIX}"/usr/include
--sysconfdir="${EPREFIX}"/etc/news
--with-db-dir="${EPREFIX}"/var/db/news
--with-doc-dir="${EPREFIX}"/usr/share/doc/${PF}
--with-http-dir="${EPREFIX}"/usr/share/${PN}/http
--with-libperl-dir=$(perl_get_vendorlib)
--with-log-dir="${EPREFIX}"/var/log/${PN}
--with-run-dir="${EPREFIX}"/run/news
--with-spool-dir="${EPREFIX}"/var/spool/news
--with-tmp-dir="${EPREFIX}"/var/tmp/news
$(use_enable keywords)
$(use_enable largefile largefiles)
$(use_enable low-memory tagged-hash)
@@ -80,6 +89,8 @@ src_configure() {
if use gzip; then
econf_args+=( --with-log-compress=gzip )
# elif use bzip2; then
# econf_args+=( --with-log-compress=bzip2 )
else
econf_args+=( --with-log-compress=cat )
fi
@@ -98,10 +109,25 @@ src_test() {
src_install() {
default
keepdir /var/log/inn/OLD
keepdir /var/tmp/news
keepdir /var/spool/news/{archive,articles,incoming/bad,innfeed,outgoing,overview}
find "${ED}" -name '*.la' -delete || die
rm "${ED}"/usr/share/doc/${PF}/{GPL,LICENSE} || die
rm -r "${ED}"/{run} || die
# collision with sys-apps/man-pages
mv "${ED}"/usr/share/man/man3/{list,inn-list}.3 || die
rm -r "${ED}"/opt/${PN}/{db,doc} || die
doenvd "${FILESDIR}"/30inn
newinitd "${FILESDIR}"/ovdb.initd ovdb
for svc in cnfsstat innd innwatch; do
newinitd "${FILESDIR}"/${svc}.initd ${svc}
newconfd "${FILESDIR}"/${svc}.confd ${svc}
done
systemd_dounit "${FILESDIR}"/innd.service
}
pkg_postinst() {