aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>2022-01-06 19:09:34 +0500
committerAnna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>2022-01-06 19:10:03 +0500
commitd6482d5f54daf37101c0e4f56eb8f06d4de77fa5 (patch)
tree87d2d2b6376d6e04e6f0e9923030e069c1343b42 /net-nntp
parentlicenses: add powell (diff)
downloadguru-d6482d5f54daf37101c0e4f56eb8f06d4de77fa5.tar.gz
guru-d6482d5f54daf37101c0e4f56eb8f06d4de77fa5.tar.bz2
guru-d6482d5f54daf37101c0e4f56eb8f06d4de77fa5.zip
net-nntp/inn: revbump
Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
Diffstat (limited to 'net-nntp')
-rw-r--r--net-nntp/inn/files/30inn1
-rw-r--r--net-nntp/inn/files/cnfsstat.confd8
-rw-r--r--net-nntp/inn/files/cnfsstat.initd7
-rw-r--r--net-nntp/inn/files/innd.confd8
-rw-r--r--net-nntp/inn/files/innd.initd81
-rw-r--r--net-nntp/inn/files/innd.service27
-rw-r--r--net-nntp/inn/files/innwatch.confd8
-rw-r--r--net-nntp/inn/files/innwatch.initd11
-rw-r--r--net-nntp/inn/files/ovdb.initd16
-rw-r--r--net-nntp/inn/inn-2.6.4-r1.ebuild (renamed from net-nntp/inn/inn-2.6.4.ebuild)50
10 files changed, 205 insertions, 12 deletions
diff --git a/net-nntp/inn/files/30inn b/net-nntp/inn/files/30inn
new file mode 100644
index 000000000..747f31d15
--- /dev/null
+++ b/net-nntp/inn/files/30inn
@@ -0,0 +1 @@
+CONFIG_PROTECT=/var/db/news
diff --git a/net-nntp/inn/files/cnfsstat.confd b/net-nntp/inn/files/cnfsstat.confd
new file mode 100644
index 000000000..82ff22305
--- /dev/null
+++ b/net-nntp/inn/files/cnfsstat.confd
@@ -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=""
diff --git a/net-nntp/inn/files/cnfsstat.initd b/net-nntp/inn/files/cnfsstat.initd
new file mode 100644
index 000000000..51f84d056
--- /dev/null
+++ b/net-nntp/inn/files/cnfsstat.initd
@@ -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
diff --git a/net-nntp/inn/files/innd.confd b/net-nntp/inn/files/innd.confd
new file mode 100644
index 000000000..e9080ebb0
--- /dev/null
+++ b/net-nntp/inn/files/innd.confd
@@ -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=""
diff --git a/net-nntp/inn/files/innd.initd b/net-nntp/inn/files/innd.initd
new file mode 100644
index 000000000..e0643146e
--- /dev/null
+++ b/net-nntp/inn/files/innd.initd
@@ -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 $?
+}
diff --git a/net-nntp/inn/files/innd.service b/net-nntp/inn/files/innd.service
new file mode 100644
index 000000000..ae7db3a44
--- /dev/null
+++ b/net-nntp/inn/files/innd.service
@@ -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
diff --git a/net-nntp/inn/files/innwatch.confd b/net-nntp/inn/files/innwatch.confd
new file mode 100644
index 000000000..2abb56a1d
--- /dev/null
+++ b/net-nntp/inn/files/innwatch.confd
@@ -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=""
diff --git a/net-nntp/inn/files/innwatch.initd b/net-nntp/inn/files/innwatch.initd
new file mode 100644
index 000000000..20eedda98
--- /dev/null
+++ b/net-nntp/inn/files/innwatch.initd
@@ -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
+}
diff --git a/net-nntp/inn/files/ovdb.initd b/net-nntp/inn/files/ovdb.initd
new file mode 100644
index 000000000..84e17e2a9
--- /dev/null
+++ b/net-nntp/inn/files/ovdb.initd
@@ -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 $?
+}
diff --git a/net-nntp/inn/inn-2.6.4.ebuild b/net-nntp/inn/inn-2.6.4-r1.ebuild
index 5b0671696..64951fc42 100644
--- a/net-nntp/inn/inn-2.6.4.ebuild
+++ b/net-nntp/inn/inn-2.6.4-r1.ebuild
@@ -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() {