From d6482d5f54daf37101c0e4f56eb8f06d4de77fa5 Mon Sep 17 00:00:00 2001 From: "Anna (cybertailor) Vyalkova" Date: Thu, 6 Jan 2022 19:09:34 +0500 Subject: net-nntp/inn: revbump Signed-off-by: Anna (cybertailor) Vyalkova --- net-nntp/inn/files/30inn | 1 + net-nntp/inn/files/cnfsstat.confd | 8 +++ net-nntp/inn/files/cnfsstat.initd | 7 ++ net-nntp/inn/files/innd.confd | 8 +++ net-nntp/inn/files/innd.initd | 81 ++++++++++++++++++++++ net-nntp/inn/files/innd.service | 27 ++++++++ net-nntp/inn/files/innwatch.confd | 8 +++ net-nntp/inn/files/innwatch.initd | 11 +++ net-nntp/inn/files/ovdb.initd | 16 +++++ net-nntp/inn/inn-2.6.4-r1.ebuild | 139 ++++++++++++++++++++++++++++++++++++++ net-nntp/inn/inn-2.6.4.ebuild | 113 ------------------------------- 11 files changed, 306 insertions(+), 113 deletions(-) create mode 100644 net-nntp/inn/files/30inn create mode 100644 net-nntp/inn/files/cnfsstat.confd create mode 100644 net-nntp/inn/files/cnfsstat.initd create mode 100644 net-nntp/inn/files/innd.confd create mode 100644 net-nntp/inn/files/innd.initd create mode 100644 net-nntp/inn/files/innd.service create mode 100644 net-nntp/inn/files/innwatch.confd create mode 100644 net-nntp/inn/files/innwatch.initd create mode 100644 net-nntp/inn/files/ovdb.initd create mode 100644 net-nntp/inn/inn-2.6.4-r1.ebuild delete mode 100644 net-nntp/inn/inn-2.6.4.ebuild (limited to 'net-nntp') 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-r1.ebuild b/net-nntp/inn/inn-2.6.4-r1.ebuild new file mode 100644 index 000000000..64951fc42 --- /dev/null +++ b/net-nntp/inn/inn-2.6.4-r1.ebuild @@ -0,0 +1,139 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..10} ) + +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="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" +REQUIRED_USE=" + python? ( ${PYTHON_REQUIRED_USE} ) + ?? ( low-memory largefile ) +" # ?? ( bzip2 gzip ) + +DEPEND=" + app-crypt/gnupg + sys-libs/pam + virtual/libcrypt:= + !berkdb? ( sys-libs/gdbm:= ) + berkdb? ( sys-libs/db:* ) + kerberos? ( app-crypt/mit-krb5 ) + perl? ( dev-lang/perl:= ) + python? ( ${PYTHON_DEPS} ) + sasl? ( dev-libs/cyrus-sasl:2 ) + ssl? ( dev-libs/openssl:= ) + systemd? ( sys-apps/systemd:= ) + zlib? ( sys-libs/zlib:= ) +" +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 ) + +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/russallbery.asc" + +src_unpack() { + if use verify-sig; then + pushd "${DISTDIR}" || die + verify-sig_verify_signed_checksums \ + ${P}.tar.gz.sha256.asc sha256 ${P}.tar.gz + popd || die + fi + + unpack ${P}.tar.gz +} + +src_configure() { + econf_args=( + --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) + $(use_with berkdb bdb) + $(use_with kerberos krb5) + $(use_with perl) + $(use_with python) + $(use_with sasl) + $(use_with ssl openssl) + $(use_with zlib) + ) + + 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 + + econf "${econf_args[@]}" +} + +src_compile() { + emake -j1 +} + +src_test() { + emake -j1 check +} + +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 + + 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() { + if use perl; then + optfeature "controlchan program" dev-perl/MIME-tools + optfeature "innreport script" dev-perl/GD + optfeature "send-uucp backend" net-misc/taylor-uucp + fi +} diff --git a/net-nntp/inn/inn-2.6.4.ebuild b/net-nntp/inn/inn-2.6.4.ebuild deleted file mode 100644 index 5b0671696..000000000 --- a/net-nntp/inn/inn-2.6.4.ebuild +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright 2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{8..10} ) - -inherit optfeature python-single-r1 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" -SLOT="0" -KEYWORDS="~amd64" -IUSE="berkdb gzip kerberos keywords largefile low-memory +perl +python sasl ssl systemd zlib" -REQUIRED_USE=" - python? ( ${PYTHON_REQUIRED_USE} ) - ?? ( low-memory largefile ) -" # ?? ( bzip2 gzip ) - -DEPEND=" - app-crypt/gnupg - sys-libs/pam - virtual/libcrypt:= - virtual/sendmail - !berkdb? ( sys-libs/gdbm:= ) - berkdb? ( sys-libs/db:* ) - kerberos? ( app-crypt/mit-krb5 ) - perl? ( dev-lang/perl:= ) - python? ( ${PYTHON_DEPS} ) - sasl? ( dev-libs/cyrus-sasl:2 ) - ssl? ( dev-libs/openssl:= ) - systemd? ( sys-apps/systemd:= ) - zlib? ( sys-libs/zlib:= ) -" -RDEPEND="${DEPEND}" -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} -) - -VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/russallbery.asc" - -src_unpack() { - if use verify-sig; then - pushd "${DISTDIR}" || die - verify-sig_verify_signed_checksums \ - ${P}.tar.gz.sha256.asc sha256 ${P}.tar.gz - popd || die - fi - - unpack ${P}.tar.gz -} - -src_configure() { - econf_args=( - --prefix=/opt/${PN} - $(use_enable keywords) - $(use_enable largefile largefiles) - $(use_enable low-memory tagged-hash) - $(use_with berkdb bdb) - $(use_with kerberos krb5) - $(use_with perl) - $(use_with python) - $(use_with sasl) - $(use_with ssl openssl) - $(use_with zlib) - ) - - if use gzip; then - econf_args+=( --with-log-compress=gzip ) - else - econf_args+=( --with-log-compress=cat ) - fi - - econf "${econf_args[@]}" -} - -src_compile() { - emake -j1 -} - -src_test() { - emake -j1 check -} - -src_install() { - default - - # 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 -} - -pkg_postinst() { - if use perl; then - optfeature "controlchan program" dev-perl/MIME-tools - optfeature "innreport script" dev-perl/GD - optfeature "send-uucp backend" net-misc/taylor-uucp - fi -} -- cgit v1.2.3-65-gdbad