diff options
Diffstat (limited to 'net-nntp/inn')
-rw-r--r-- | net-nntp/inn/Manifest | 14 | ||||
-rw-r--r-- | net-nntp/inn/files/inn-2.5.3-ar.patch | 37 | ||||
-rw-r--r-- | net-nntp/inn/files/inn-2.5.3-tests.patch | 19 | ||||
-rw-r--r-- | net-nntp/inn/files/innd | 21 | ||||
-rw-r--r-- | net-nntp/inn/files/innd-r1 | 22 | ||||
-rw-r--r-- | net-nntp/inn/inn-2.5.3-r1.ebuild | 281 | ||||
-rw-r--r-- | net-nntp/inn/inn-2.5.3-r3.ebuild | 286 | ||||
-rw-r--r-- | net-nntp/inn/inn-2.5.4-r1.ebuild | 286 | ||||
-rw-r--r-- | net-nntp/inn/inn-2.5.5-r1.ebuild | 286 | ||||
-rw-r--r-- | net-nntp/inn/metadata.xml | 10 |
10 files changed, 1262 insertions, 0 deletions
diff --git a/net-nntp/inn/Manifest b/net-nntp/inn/Manifest new file mode 100644 index 000000000000..7998222acec1 --- /dev/null +++ b/net-nntp/inn/Manifest @@ -0,0 +1,14 @@ +AUX inn-2.5.3-ar.patch 788 SHA256 e9ab8a6fbf19f5685a69ad7c3d9a1f06c45ba6e45bfa800c6bdeaef250ab4de8 SHA512 ebe00878b159f6af9e3a378acf369bf5b2d06fcde1f4b3f7c721f8947a555d6a8f6a871e995d32cd0c83df151e338168c7dfbeaf0270b5dd8d98c5a9d2969ed3 WHIRLPOOL 6547beab0bd53ab1f410be4c435429e66150d9212c44fcef755282278b5704a07e81c37dd5104985ea704e1ad8bbc47f9a82e2b673559058bede2e6abc5a170b +AUX inn-2.5.3-tests.patch 654 SHA256 a8c46c81d287d350605c455a923990a709f01876ca76e1ef4c9642f966005645 SHA512 31a998b61c80583cd63cc3310fdf86605e5e0ce604056896d96aa255caba9ff1e3fa045b70f73e1157587fa6f3dae66789b7f6877204d6b6d4a096935ac80892 WHIRLPOOL df912dc92f26eff369341b6140fa73f5532196abfebaa16661d1bc9c140c90bfcf9273b1da6951181140210b500e1fb6be6f5db9d3199881abd86efdd8763314 +AUX innd 451 SHA256 6e6ae767ccf311e0a15b5469cef2f2ba3ba766847a7c092becd171e73dfbb88f SHA512 48539184eb549d068d07ccab999df9e2fc49cd08ecd9dd340ef6250a081f40938a11bf9535f4abbe35fd34ba757fc1c35e71e0d0f1646db77e369b02f27ce511 WHIRLPOOL fd1fd7a38136e98570cc413ce7ab6d067028984b68b7e18df7ed73e4070f220b7ccb9ae352e45ebca3d2ed471d700970db8e42d5053ae35b22e705f22942bb1e +AUX innd-r1 498 SHA256 39f4c1ac0f3e9766d6825435188091afb7f0eea4f9b0e231508650b9cd5cd7a0 SHA512 c013dee0629be01d93d981bf4c551a48f8f40b1baeef2a21a076ad12f8afba68517d2ef82712790b9f2e35b7090d18645faf7706b2b7690bcc1d665cd620d312 WHIRLPOOL b1d0bbe4f1df4b155e48f8652709c078efbc6d9aac1a17b95bc87ec367685c921da84898db96f5b9df6800d429903a3c04d97d2b909ff1a1cb84192dd04931bc +DIST inn-2.5.3.tar.gz 2412119 SHA256 60f0042b144499680cc577a4330aeaac5dac20c5994649c0e945d32b5f8dbcf1 SHA512 e579944571f0ec4fcdbf86de8458342075ce08f60df046bc8c45969b39f396ede8f5034f734542e1c64fb7792ae01c117c6a7af170fe5a43e1d0b2693f34d392 WHIRLPOOL a6d08020bfc458ad52567d225f14ef2f92fd605767c7ae4292724e3a3f49e1b42630fd787e7f79aae8a16d236479cef13b9531862eae050db839d3d0530f7999 +DIST inn-2.5.4.tar.gz 2408600 SHA256 5b62240c3074f2f38b3bcc656c343c587f2a923ec9d45e19f0d4ce269cb3f3f4 SHA512 f632599d009e8965d1b0ce7fef84dfbe48034c3a86825694a5ca4311123347647f9a4b534cff59820437f619ec09867bcff16f8f18c705e056eeea6493bc5441 WHIRLPOOL a313cb90e5dd55f4db5b70ede6b6d98561d2601f8d27e1b9b3983b90491b5ab300f0571d5fc1ac74f7892997ff6219189c863b122d569fe8673f3fcd13b0b67a +DIST inn-2.5.5.tar.gz 2419841 SHA256 4245602c2c30fd3fe38513e9403c8d0ea4eb76256961591f97da630c341053bf SHA512 aada60b15952810fa31c3b2078b4ca1b1e560cee348cc81d076e0ba1f8b785497310d60aca89b9ecc4af85a1493eefa8a2b976cb349b8ea96482c93cbcf049f1 WHIRLPOOL b931d0f6a1e60b0157fafcc269e84d4f1f6c914ca7b95799be1a99feeec5c5568e41a9c7384da122d05eac7393d457a612be9ffbb79a01122e0c37c1de76785a +EBUILD inn-2.5.3-r1.ebuild 8386 SHA256 0dd4c33da9ab19d9662803c2b11cc8124c9fc1707c33b37bfc11756c00d5a50f SHA512 921e78b54b446d5a7450cbb225d99b4878f5194d86ea1e648eb55797c6e9fb7730367a2d54090fc68c39dc2017eca5ea8af60038b4a3e8cf9cbb021c018932c5 WHIRLPOOL 1a440e2536678182b3fdab31566a55f4c631189b52293fbd8930abacba9fe7fcb502b22683a338aa83138a6a5545306dc35c27899258b99912c12c027cb839f2 +EBUILD inn-2.5.3-r3.ebuild 8581 SHA256 fb6b450386f68ecc3f4abc3d139ae4a65d2f8d4277a91f1c93cc05f766ab4f9e SHA512 58c9aaa76592a8f7c56180fd0d4c063e608846a8a3ed7a59df66c74f0ac78fda85b823e40bcd088b4e4022e054b2ab2fa6e67145597f6a65496e0be8b2be8537 WHIRLPOOL 7d7be5ea76a30ba7bd3e08b9bb10b0aeb38e12525b08a04ae8db1e108b75c4434a72ad363bd2a5314ada76c00b94326f2e3f2f3f2e8b29fdc365c5dc872b2aef +EBUILD inn-2.5.4-r1.ebuild 8595 SHA256 a2e01f05bf50a4fbc98ba47d1a2eeefcd1cde7b0aaf98c82aa12ec51758cd295 SHA512 c128b4cddb36edf2fbe82a56da63428aad03111c9250e0582acdf72abb8dee271676bb17a2e2e9dc6303a7d638c31d906afc6039b82b1d1994281ee288c254e5 WHIRLPOOL 089e8d580ed3f7c891de5d5bbfe2517744344e02647fd2eece432a0592ad0e9f0647252399cd616153283ef26fdeedab9b59319008ad5e44a3d472002706914d +EBUILD inn-2.5.5-r1.ebuild 8595 SHA256 a2e01f05bf50a4fbc98ba47d1a2eeefcd1cde7b0aaf98c82aa12ec51758cd295 SHA512 c128b4cddb36edf2fbe82a56da63428aad03111c9250e0582acdf72abb8dee271676bb17a2e2e9dc6303a7d638c31d906afc6039b82b1d1994281ee288c254e5 WHIRLPOOL 089e8d580ed3f7c891de5d5bbfe2517744344e02647fd2eece432a0592ad0e9f0647252399cd616153283ef26fdeedab9b59319008ad5e44a3d472002706914d +MISC ChangeLog 3724 SHA256 4f34b56dc2a104e58be14ddc5f3ca61aacc0f4f046a012998445d039c5129338 SHA512 31478c4703afae570a2321b3132e9713df5a03e5b95eefbb29e98a1d571b661e0ff5d6b3b2b8b7632fcb00948053130124233303b114e8564308190ab2c22ca0 WHIRLPOOL be39396911514072cbd993623233d2e445efcdef8c72724bb1affa95b28d55b69b690f9c2ac245d2b6a82a265a0c0667268a985ce1c1ee9f0eb1ac79e946f779 +MISC ChangeLog-2015 10962 SHA256 606f32e450f9448d6101ec9205a49c34c3dc7513d93cbf8742384d929434e20a SHA512 300022a35f3b597bebcc9a7cd7604a4338fc234707b04877db1a83e14e61a00181fe84c2454d4ab02661eff13a0df163ad0b6f1f92799ed317e25e24d96867d7 WHIRLPOOL 3f79b5484d1c2b949f07e5e1d5f4ecca303b66381143251d1e24c925e929d5f1d937666c6906206900ca92c0adaaa0f0aed6cc843469100d587a37a50a19c352 +MISC metadata.xml 357 SHA256 278e7d12de414acffe58af70e0d6b9f9139c6fc849a1ff78f0006fadddcea8d7 SHA512 3df88419d7abb8ed51b8b54746aa5de3e750f9666c250bdca0aef2741dcd462dd2b6bf979106a437af7c6245d8447fea2d2c2988df83d9d73379e04643634397 WHIRLPOOL 8f3435ac9a2e6494ccc36ca72c68d9e02707bfedfb1d5144216722d9e7da779e9b0b9e491c593ff93a87d05c655ad88c9572c5fb7678622879f4247420f0a753 diff --git a/net-nntp/inn/files/inn-2.5.3-ar.patch b/net-nntp/inn/files/inn-2.5.3-ar.patch new file mode 100644 index 000000000000..ac4f8158c44f --- /dev/null +++ b/net-nntp/inn/files/inn-2.5.3-ar.patch @@ -0,0 +1,37 @@ +Use system AR. + +Gentoo bug #461254. + +--- lib/Makefile ++++ lib/Makefile +@@ -53,7 +53,7 @@ + -rpath $(PATHLIB) -version-info 2:0:0 + + libinn.a: $(OBJECTS) +- ar r $@ $(OBJECTS) ++ $(AR) r $@ $(OBJECTS) + $(RANLIB) libinn.a + + .c.o .c.lo: +--- storage/Makefile ++++ storage/Makefile +@@ -55,7 +55,7 @@ + -rpath $(PATHLIB) -version-info 2:0:0 + + libstorage.a: $(OBJECTS) +- ar r $@ $(OBJECTS) ++ $(AR) r $@ $(OBJECTS) + $(RANLIB) libstorage.a + + # Make.methods is included in the distribution tarball since some non-GNU +--- history/Makefile ++++ history/Makefile +@@ -51,7 +51,7 @@ + -rpath $(PATHLIB) -version-info 2:0:0 + + libinnhist.a: $(OBJECTS) +- ar r $@ $(OBJECTS) ++ $(AR) r $@ $(OBJECTS) + $(RANLIB) libinnhist.a + + # Try to set up these rules so that buildconfig is only run once. diff --git a/net-nntp/inn/files/inn-2.5.3-tests.patch b/net-nntp/inn/files/inn-2.5.3-tests.patch new file mode 100644 index 000000000000..6511508308d6 --- /dev/null +++ b/net-nntp/inn/files/inn-2.5.3-tests.patch @@ -0,0 +1,19 @@ +Certain filesystems (such as reiserfs) cannot properly report +the number of free inodes. In this case, inndf reports an absurdly +high number instead of nothing, which standard df does. +There seems to be some confusion about which FOO_MAX is returned, +so this patch adds an actual value known to be returned. + +See bug #348490. + +--- tests/util/inndf.t ++++ tests/util/inndf.t +@@ -62,7 +62,7 @@ + real=`df -i . | sed 1d | awk '{ print $4 }'` + fi + try=`$inndf -i .` +- if [ "$try" = 4294967295 ] ; then ++ if [ "$try" = 4294967295 ] || [ "$try" = 2147483647 ] ; then + printcount "ok" + else + diff=`expr "$real" - "$try"` diff --git a/net-nntp/inn/files/innd b/net-nntp/inn/files/innd new file mode 100644 index 000000000000..c45d45b830cb --- /dev/null +++ b/net-nntp/inn/files/innd @@ -0,0 +1,21 @@ +#!/sbin/openrc-run +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net +} + +start() { + ebegin "Starting innd" + checkpath -d -m 0755 -o news:news /var/run/news + start-stop-daemon --start --user news --exec /usr/lib/news/bin/rc.news + eend $? +} + +stop() { + ebegin "Stopping innd" + start-stop-daemon --start --user news --exec /usr/lib/news/bin/rc.news -- stop + sleep 2 + eend $? +} diff --git a/net-nntp/inn/files/innd-r1 b/net-nntp/inn/files/innd-r1 new file mode 100644 index 000000000000..071797e50796 --- /dev/null +++ b/net-nntp/inn/files/innd-r1 @@ -0,0 +1,22 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net +} + +start() { + ebegin "Starting ${SVCNAME}" + checkpath -d -m 0755 -o news:news /run/news + start-stop-daemon --start --user news --pidfile /run/news/${SVCNAME}.pid \ + --exec /usr/lib/news/bin/rc.news + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --start --user news --exec /usr/lib/news/bin/rc.news -- stop + sleep 2 + eend $? +} diff --git a/net-nntp/inn/inn-2.5.3-r1.ebuild b/net-nntp/inn/inn-2.5.3-r1.ebuild new file mode 100644 index 000000000000..48edc30bd817 --- /dev/null +++ b/net-nntp/inn/inn-2.5.3-r1.ebuild @@ -0,0 +1,281 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +PYTHON_COMPAT=( python2_7 ) + +inherit autotools eutils multilib python-single-r1 ssl-cert + +DESCRIPTION="The Internet News daemon, fully featured NNTP server" +HOMEPAGE="https://www.isc.org/software/inn" +SRC_URI="ftp://ftp.isc.org/isc/inn/${P}.tar.gz" + +# GPL-2 only for init script +LICENSE="ISC GPL-2+ public-domain BSD-4 BSD-2 RSA BSD MIT GPL-2" +SLOT="0" +KEYWORDS="amd64 ppc x86" +IUSE="berkdb innkeywords inntaggedhash ipv6 kerberos perl python sasl ssl" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +DEPEND=" + virtual/mta + dev-perl/MIME-tools + sys-libs/pam + sys-libs/zlib + kerberos? ( virtual/krb5 ) + sasl? ( >=dev-libs/cyrus-sasl-2 ) + ssl? ( dev-libs/openssl:0= ) + python? ( ${PYTHON_DEPS} ) + berkdb? ( sys-libs/db:* ) +" +RDEPEND="${DEPEND}" + +pkg_setup() { + use python && python-single-r1_pkg_setup +} + +src_prepare() { + epatch "${FILESDIR}"/${P}-tests.patch + + sed -e 's: -B .OLD::' -i Makefile.global.in || die + + # Do not treat LDFLAGS as if it contained libraries to link to + sed -e 's:LDFLAGS::g' -i m4/python.m4 || die + + # We do not have the biff service, but we do have comsat + sed -e 's:"biff":"comsat":g' -i tests/lib/getnameinfo-t.c || die + + eautoreconf +} + +src_configure() { + econf \ + --prefix=/usr/$(get_libdir)/news \ + --sysconfdir=/etc/news \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --with-control-dir=/usr/$(get_libdir)/news/bin/control \ + --with-filter-dir=/usr/$(get_libdir)/news/bin/filter \ + --with-db-dir=/var/spool/news/db \ + --with-doc-dir=/usr/share/doc/${PF} \ + --with-spool-dir=/var/spool/news \ + --with-log-dir=/var/log/news \ + --with-run-dir=/var/run/news \ + --with-tmp-dir=/var/spool/news/tmp \ + --disable-libtool \ + --with-gnu-ld \ + --enable-setgid-inews \ + --enable-uucp-rnews \ + $(use_with perl) \ + $(use_with python) \ + $(use_with kerberos kerberos /usr) \ + $(use_with sasl) \ + $(use_with ssl openssl) \ + $(use_with berkdb berkeleydb /usr) \ + $(use_enable ipv6) \ + $(use_enable !inntaggedhash largefiles) \ + $(use_enable inntaggedhash tagged-hash) \ + $(use_enable innkeywords keywords) +} + +src_install() { + emake DESTDIR="${D}/" P="" SPECIAL="" install + + chown -R root:0 \ + "${D}"/usr/$(get_libdir)/news/$(get_libdir) \ + "${D}"/usr/$(get_libdir)/news/include \ + "${D}"/usr/share/doc \ + "${D}"/usr/share/man \ + || die + chmod 644 "${D}"/etc/news/* || die + chmod 640 \ + "${D}"/etc/news/control.ctl \ + "${D}"/etc/news/expire.ctl \ + "${D}"/etc/news/incoming.conf \ + "${D}"/etc/news/nntpsend.ctl \ + "${D}"/etc/news/passwd.nntp \ + "${D}"/etc/news/readers.conf \ + || die + + # Prevent old db/* files from being overwritten + insinto /usr/share/inn/dbexamples + newins site/active.minimal active + newins site/newsgroups.minimal newsgroups + + keepdir \ + /var/log/news \ + /var/spool/news/archive \ + /var/spool/news/articles \ + /var/spool/news/db \ + /var/spool/news/incoming \ + /var/spool/news/incoming/bad \ + /var/spool/news/innfeed \ + /var/spool/news/outgoing \ + /var/spool/news/overview \ + /var/spool/news/tmp + + fowners news:news /var/log/news + + dodoc ChangeLog MANIFEST README* doc/checklist + use ipv6 && dodoc doc/IPv6-info + + # So other programs can build against INN + insinto /usr/$(get_libdir)/news/include + doins include/*.h + + doinitd "${FILESDIR}"/innd + + rm -r "${D}"/var/run +} + +pkg_postinst() { + for db_file in active newsgroups + do + [[ -f ${ROOT}/var/spool/news/db/${db_file} ]] && continue + + if [[ -f ${ROOT}/usr/share/inn/dbexamples/${db_file} ]] + then + cp "${ROOT}"/usr/share/inn/dbexamples/${db_file} \ + "${ROOT}"/var/spool/news/db/${db_file} + else + touch "${ROOT}"/var/spool/news/db/${db_file} + fi + + chown news:news "${ROOT}"/var/spool/news/db/${db_file} + chmod 664 "${ROOT}"/var/spool/news/db/${db_file} + done + + elog "Do not forget to update your cron entries, and also run" + elog "makedbz if you need to. If this is a first-time installation" + elog "a minimal active file has been installed. You will need to" + elog "touch history and run 'makedbz -i' to initialize the history" + elog "database. See INSTALL for more information." + elog + elog "You need to assign a real shell to the news user, or else" + elog "starting inn will fail. You can use 'usermod -s /bin/bash news'" + elog "for this." + + if use ssl + then + install_cert /etc/news/cert/cert + chown news:news \ + "${ROOT}"/etc/news/cert/cert.{crt,csr,key,pem} + + elog + elog "You may want to start nnrpd manually for native ssl support." + elog "If you choose to do so, automating this with a bootscript might" + elog "also be a good choice." + elog "Have a look at man nnrpd for valid parameters." + elog + elog "The certificate location in /etc/news/sasl.conf has been changed" + elog "to /etc/news/cert!" + + fi +} + +pkg_postrm() { + elog + elog "If you want your newsspool or altered configuration files" + elog "to be removed, please do so now manually." + elog +} + +pkg_config() { + NEWSSPOOL_DIR="${ROOT}/var/spool/news" + NEWS_SHELL="$( awk -F':' '/^news:/ {print $7;}' ${ROOT}/etc/passwd )" + NEWS_ERRFLAG="0" + + if [[ ${NEWS_SHELL} == /bin/false || ${NEWS_SHELL} == /dev/null ]]; then + einfo "Changing shell to /bin/bash for user news..." + usermod -s /bin/bash news + else + einfo "Shell for user news unchanged ('${NEWS_SHELL}')." + if [[ ${NEWS_SHELL} != /bin/sh && ${NEWS_SHELL} != /bin/bash ]]; then + ewarn "You might want to change it to '/bin/bash', though." + fi + fi + + if [[ ! -e ${NEWSSPOOL_DIR}/db/history ]]; then + if [[ ! -f ${NEWSSPOOL_DIR}/db/history.dir \ + && ! -f ${NEWSSPOOL_DIR}/db/history.pag \ + && ! -f ${NEWSSPOOL_DIR}/db/history.hash \ + && ! -f ${NEWSSPOOL_DIR}/db/history.index ]] + then + einfo "Building history database ..." + + touch "${NEWSSPOOL_DIR}"/db/history + chown news:news "${NEWSSPOOL_DIR}"/db/history + chmod 644 "${NEWSSPOOL_DIR}"/db/history + + einfo "Running makedbz -i ..." + su - news -c "/usr/$(get_libdir)/news/bin/makedbz -i" + + einfo "Moving files into place ..." + [[ -f ${NEWSSPOOL_DIR}/db/history.n.dir ]] && \ + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.dir \ + "${NEWSSPOOL_DIR}"/db/history.dir + [[ -f ${NEWSSPOOL_DIR}/db/history.n.pag ]] && \ + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.pag \ + "${NEWSSPOOL_DIR}"/db/history.pag + [[ -f ${NEWSSPOOL_DIR}/db/history.n.hash ]] && \ + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.hash \ + "${NEWSSPOOL_DIR}"/db/history.hash + [[ -f ${NEWSSPOOL_DIR}/db/history.n.index ]] && \ + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.index \ + "${NEWSSPOOL_DIR}"/db/history.index + + einfo "Running makehistory ..." + su - news -c /usr/$(get_libdir)/news/bin/makehistory + else + NEWS_ERRFLAG="1" + eerror "Your installation seems to be screwed up." + eerror "${NEWSSPOOL_DIR}/db/history does not exist, but there's" + eerror "one of the files history.dir, history.hash or history.index" + eerror "within ${NEWSSPOOL_DIR}/db." + eerror "Use your backup to restore the history database." + fi + else + einfo "${NEWSSPOOL_DIR}/db/history found." + einfo "Leaving history database as it is." + fi + + INNCFG_INODES=$( + sed /etc/news/inn.conf \ + -e '/innwatchspoolnodes/ ! d; s:[^ ]*[ ]*\([^ ]*\):\1:' + ) + INNSPOOL_INODES=$( + df -Pi ${NEWSSPOOL_DIR} | \ + sed -e 's:[^ ]*[ ]*\([^ ]*\).*:\1:; 1 d' + ) + if [[ ${INNCFG_INODES} -gt ${INNSPOOL_INODES} ]]; then + ewarn "Setting innwatchspoolinodes to zero, because the filesystem behind" + ewarn "$NEWSSPOOL_DIR works without inodes." + ewarn + cp /etc/news/inn.conf /etc/news/inn.conf.OLD + einfo "A copy of your old inn.conf has been saved to /etc/news/inn.conf.OLD." + sed -i /etc/news/inn.conf \ + -e '/innwatchspoolnodes/ s:\([^ ]*\)\([ ]*\).*:\1\20:' + chown news:news /etc/news/inn.conf + chmod 644 /etc/news/inn.conf + fi + + INNCHECK_LINES=$( + su - news -c "/usr/$(get_libdir)/news/bin/inncheck | wc -l" + ) + if [[ ${INNCHECK_LINES} -gt 0 ]]; then + NEWS_ERRFLAG="1" + ewarn "inncheck most certainly found an error." + ewarn "Please check its output:" + eerror "`su - news -c /usr/$(get_libdir)/news/bin/inncheck`" + fi + + if [[ ${NEWS_ERRFLAG} -gt 0 ]]; then + eerror "There were one or more errors/warnings checking your" + eerror "configuration. Please read inn's documentation and" + eerror "fix them accordingly." + else + einfo "INN configuration tests passed successfully." + ewarn "Please ensure you have configured inn properly." + fi +} diff --git a/net-nntp/inn/inn-2.5.3-r3.ebuild b/net-nntp/inn/inn-2.5.3-r3.ebuild new file mode 100644 index 000000000000..e356b6892f48 --- /dev/null +++ b/net-nntp/inn/inn-2.5.3-r3.ebuild @@ -0,0 +1,286 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +PYTHON_COMPAT=( python2_7 ) + +inherit autotools eutils multilib python-single-r1 ssl-cert toolchain-funcs + +DESCRIPTION="The Internet News daemon, fully featured NNTP server" +HOMEPAGE="https://www.isc.org/software/inn" +SRC_URI="ftp://ftp.isc.org/isc/inn/${P}.tar.gz" + +# GPL-2 only for init script +LICENSE="ISC GPL-2+ public-domain BSD-4 BSD-2 RSA BSD MIT GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="berkdb innkeywords inntaggedhash ipv6 kerberos perl python sasl ssl" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +DEPEND=" + virtual/mta + dev-perl/MIME-tools + sys-libs/pam + sys-libs/zlib + kerberos? ( virtual/krb5 ) + sasl? ( >=dev-libs/cyrus-sasl-2 ) + ssl? ( dev-libs/openssl:0= ) + python? ( ${PYTHON_DEPS} ) + berkdb? ( sys-libs/db:* ) +" +RDEPEND="${DEPEND}" + +pkg_setup() { + use python && python-single-r1_pkg_setup +} + +src_prepare() { + epatch "${FILESDIR}"/${P}-ar.patch + epatch "${FILESDIR}"/${P}-tests.patch + + sed -e 's: -B .OLD::' -i Makefile.global.in || die + + # Do not treat LDFLAGS as if it contained libraries to link to + sed -e 's:LDFLAGS::g' -i m4/python.m4 || die + + # We do not have the biff service, but we do have comsat + sed -e 's:"biff":"comsat":g' -i tests/lib/getnameinfo-t.c || die + + eautoreconf +} + +src_configure() { + tc-export AR + + econf \ + --prefix=/usr/$(get_libdir)/news \ + --sysconfdir=/etc/news \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --with-control-dir=/usr/$(get_libdir)/news/bin/control \ + --with-filter-dir=/usr/$(get_libdir)/news/bin/filter \ + --with-db-dir=/var/spool/news/db \ + --with-doc-dir=/usr/share/doc/${PF} \ + --with-spool-dir=/var/spool/news \ + --with-log-dir=/var/log/news \ + --with-run-dir=/run/news \ + --with-tmp-dir=/var/spool/news/tmp \ + --disable-libtool \ + --with-gnu-ld \ + --enable-setgid-inews \ + --enable-uucp-rnews \ + $(use_with perl) \ + $(use_with python) \ + $(use_with kerberos kerberos /usr) \ + $(use_with sasl) \ + $(use_with ssl openssl) \ + $(use_with berkdb berkeleydb /usr) \ + $(use_enable ipv6) \ + $(use_enable !inntaggedhash largefiles) \ + $(use_enable inntaggedhash tagged-hash) \ + $(use_enable innkeywords keywords) +} + +src_install() { + emake DESTDIR="${D}/" P="" SPECIAL="" install + + chown -R root:0 \ + "${D}"/usr/$(get_libdir)/news/$(get_libdir) \ + "${D}"/usr/$(get_libdir)/news/include \ + "${D}"/usr/share/doc \ + "${D}"/usr/share/man \ + || die + chmod 644 "${D}"/etc/news/* || die + chmod 640 \ + "${D}"/etc/news/control.ctl \ + "${D}"/etc/news/expire.ctl \ + "${D}"/etc/news/incoming.conf \ + "${D}"/etc/news/innfeed.conf \ + "${D}"/etc/news/nntpsend.ctl \ + "${D}"/etc/news/passwd.nntp \ + "${D}"/etc/news/readers.conf \ + || die + + # Prevent old db/* files from being overwritten + insinto /usr/share/inn/dbexamples + newins site/active.minimal active + newins site/newsgroups.minimal newsgroups + + keepdir \ + /var/log/news \ + /var/spool/news/archive \ + /var/spool/news/articles \ + /var/spool/news/db \ + /var/spool/news/incoming \ + /var/spool/news/incoming/bad \ + /var/spool/news/innfeed \ + /var/spool/news/outgoing \ + /var/spool/news/overview \ + /var/spool/news/tmp + + fowners news:news /var/log/news + + dodoc ChangeLog MANIFEST README* doc/checklist + use ipv6 && dodoc doc/IPv6-info + + # So other programs can build against INN + insinto /usr/$(get_libdir)/news/include + doins include/*.h + + newinitd "${FILESDIR}"/innd-r1 innd +} + +pkg_postinst() { + for db_file in active newsgroups + do + [[ -f ${ROOT}var/spool/news/db/${db_file} ]] && continue + + if [[ -f ${ROOT}usr/share/inn/dbexamples/${db_file} ]] + then + cp "${ROOT}"usr/share/inn/dbexamples/${db_file} \ + "${ROOT}"var/spool/news/db/${db_file} + else + touch "${ROOT}"var/spool/news/db/${db_file} + fi + + chown news:news "${ROOT}"var/spool/news/db/${db_file} + chmod 664 "${ROOT}"var/spool/news/db/${db_file} + done + + elog "It is recommended to run emerge --config ${CATEGORY}/${PN}" + elog "now to finish setting up this package." + elog + elog "Do not forget to update your cron entries, and also run" + elog "makedbz if you need to. If this is a first-time installation" + elog "a minimal active file has been installed. You will need to" + elog "touch history and run 'makedbz -i' to initialize the history" + elog "database. See INSTALL for more information." + elog + elog "You need to assign a real shell to the news user, or else" + elog "starting inn will fail. You can use 'usermod -s /bin/bash news'" + elog "for this." + + if use ssl + then + install_cert /etc/news/cert/cert + chown news:news \ + "${ROOT}"etc/news/cert/cert.{crt,csr,key,pem} + + elog + elog "You may want to start nnrpd manually for native ssl support." + elog "If you choose to do so, automating this with a bootscript might" + elog "also be a good choice." + elog "Have a look at man nnrpd for valid parameters." + elog + elog "The certificate location in /etc/news/sasl.conf has been changed" + elog "to /etc/news/cert!" + + fi +} + +pkg_postrm() { + elog + elog "If you want your newsspool or altered configuration files" + elog "to be removed, please do so now manually." + elog +} + +pkg_config() { + NEWSSPOOL_DIR="${ROOT}var/spool/news" + NEWS_SHELL="$( awk -F':' '/^news:/ {print $7;}' ${ROOT}etc/passwd )" + NEWS_ERRFLAG="0" + + if [[ ${NEWS_SHELL} == /bin/false || ${NEWS_SHELL} == /dev/null ]]; then + einfo "Changing shell to /bin/bash for user news..." + usermod -s /bin/bash news + else + einfo "Shell for user news unchanged ('${NEWS_SHELL}')." + if [[ ${NEWS_SHELL} != /bin/sh && ${NEWS_SHELL} != /bin/bash ]]; then + ewarn "You might want to change it to '/bin/bash', though." + fi + fi + + if [[ ! -e ${NEWSSPOOL_DIR}/db/history ]]; then + if [[ ! -f ${NEWSSPOOL_DIR}/db/history.dir \ + && ! -f ${NEWSSPOOL_DIR}/db/history.pag \ + && ! -f ${NEWSSPOOL_DIR}/db/history.hash \ + && ! -f ${NEWSSPOOL_DIR}/db/history.index ]] + then + einfo "Building history database ..." + + touch "${NEWSSPOOL_DIR}"/db/history + chown news:news "${NEWSSPOOL_DIR}"/db/history + chmod 644 "${NEWSSPOOL_DIR}"/db/history + + einfo "Running makedbz -i ..." + su - news -c "/usr/$(get_libdir)/news/bin/makedbz -i" + + einfo "Moving files into place ..." + [[ -f ${NEWSSPOOL_DIR}/db/history.n.dir ]] && \ + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.dir \ + "${NEWSSPOOL_DIR}"/db/history.dir + [[ -f ${NEWSSPOOL_DIR}/db/history.n.pag ]] && \ + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.pag \ + "${NEWSSPOOL_DIR}"/db/history.pag + [[ -f ${NEWSSPOOL_DIR}/db/history.n.hash ]] && \ + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.hash \ + "${NEWSSPOOL_DIR}"/db/history.hash + [[ -f ${NEWSSPOOL_DIR}/db/history.n.index ]] && \ + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.index \ + "${NEWSSPOOL_DIR}"/db/history.index + + einfo "Running makehistory ..." + su - news -c /usr/$(get_libdir)/news/bin/makehistory + else + NEWS_ERRFLAG="1" + eerror "Your installation seems to be screwed up." + eerror "${NEWSSPOOL_DIR}/db/history does not exist, but there's" + eerror "one of the files history.dir, history.hash or history.index" + eerror "within ${NEWSSPOOL_DIR}/db." + eerror "Use your backup to restore the history database." + fi + else + einfo "${NEWSSPOOL_DIR}/db/history found." + einfo "Leaving history database as it is." + fi + + INNCFG_INODES=$( + sed /etc/news/inn.conf \ + -e '/innwatchspoolnodes/ ! d; s:[^ ]*[ ]*\([^ ]*\):\1:' + ) + INNSPOOL_INODES=$( + df -Pi ${NEWSSPOOL_DIR} | \ + sed -e 's:[^ ]*[ ]*\([^ ]*\).*:\1:; 1 d' + ) + if [[ ${INNCFG_INODES} -gt ${INNSPOOL_INODES} ]]; then + ewarn "Setting innwatchspoolinodes to zero, because the filesystem behind" + ewarn "$NEWSSPOOL_DIR works without inodes." + ewarn + cp /etc/news/inn.conf /etc/news/inn.conf.OLD + einfo "A copy of your old inn.conf has been saved to /etc/news/inn.conf.OLD." + sed -i /etc/news/inn.conf \ + -e '/innwatchspoolnodes/ s:\([^ ]*\)\([ ]*\).*:\1\20:' + chown news:news /etc/news/inn.conf + chmod 644 /etc/news/inn.conf + fi + + INNCHECK_LINES=$( + su - news -c "/usr/$(get_libdir)/news/bin/inncheck | wc -l" + ) + if [[ ${INNCHECK_LINES} -gt 0 ]]; then + NEWS_ERRFLAG="1" + ewarn "inncheck most certainly found an error." + ewarn "Please check its output:" + eerror "`su - news -c /usr/$(get_libdir)/news/bin/inncheck`" + fi + + if [[ ${NEWS_ERRFLAG} -gt 0 ]]; then + eerror "There were one or more errors/warnings checking your" + eerror "configuration. Please read inn's documentation and" + eerror "fix them accordingly." + else + einfo "INN configuration tests passed successfully." + ewarn "Please ensure you have configured inn properly." + fi +} diff --git a/net-nntp/inn/inn-2.5.4-r1.ebuild b/net-nntp/inn/inn-2.5.4-r1.ebuild new file mode 100644 index 000000000000..19a769d0a7cd --- /dev/null +++ b/net-nntp/inn/inn-2.5.4-r1.ebuild @@ -0,0 +1,286 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +PYTHON_COMPAT=( python2_7 ) + +inherit autotools eutils multilib python-single-r1 ssl-cert toolchain-funcs + +DESCRIPTION="The Internet News daemon, fully featured NNTP server" +HOMEPAGE="https://www.isc.org/software/inn" +SRC_URI="ftp://ftp.isc.org/isc/inn/${P}.tar.gz" + +# GPL-2 only for init script +LICENSE="ISC GPL-2+ public-domain BSD-4 BSD-2 RSA BSD MIT GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="berkdb innkeywords inntaggedhash ipv6 kerberos perl python sasl ssl" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +DEPEND=" + virtual/mta + dev-perl/MIME-tools + sys-libs/pam + sys-libs/zlib + kerberos? ( virtual/krb5 ) + sasl? ( >=dev-libs/cyrus-sasl-2 ) + ssl? ( dev-libs/openssl:0= ) + python? ( ${PYTHON_DEPS} ) + berkdb? ( sys-libs/db:* ) +" +RDEPEND="${DEPEND}" + +pkg_setup() { + use python && python-single-r1_pkg_setup +} + +src_prepare() { + epatch "${FILESDIR}"/${PN}-2.5.3-ar.patch + epatch "${FILESDIR}"/${PN}-2.5.3-tests.patch + + sed -e 's: -B .OLD::' -i Makefile.global.in || die + + # Do not treat LDFLAGS as if it contained libraries to link to + sed -e 's:LDFLAGS::g' -i m4/python.m4 || die + + # We do not have the biff service, but we do have comsat + sed -e 's:"biff":"comsat":g' -i tests/lib/getnameinfo-t.c || die + + eautoreconf +} + +src_configure() { + tc-export AR + + econf \ + --prefix=/usr/$(get_libdir)/news \ + --sysconfdir=/etc/news \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --with-control-dir=/usr/$(get_libdir)/news/bin/control \ + --with-filter-dir=/usr/$(get_libdir)/news/bin/filter \ + --with-db-dir=/var/spool/news/db \ + --with-doc-dir=/usr/share/doc/${PF} \ + --with-spool-dir=/var/spool/news \ + --with-log-dir=/var/log/news \ + --with-run-dir=/run/news \ + --with-tmp-dir=/var/spool/news/tmp \ + --disable-libtool \ + --with-gnu-ld \ + --enable-setgid-inews \ + --enable-uucp-rnews \ + $(use_with perl) \ + $(use_with python) \ + $(use_with kerberos kerberos /usr) \ + $(use_with sasl) \ + $(use_with ssl openssl) \ + $(use_with berkdb berkeleydb /usr) \ + $(use_enable ipv6) \ + $(use_enable !inntaggedhash largefiles) \ + $(use_enable inntaggedhash tagged-hash) \ + $(use_enable innkeywords keywords) +} + +src_install() { + emake DESTDIR="${D}/" P="" SPECIAL="" install + + chown -R root:0 \ + "${D}"/usr/$(get_libdir)/news/$(get_libdir) \ + "${D}"/usr/$(get_libdir)/news/include \ + "${D}"/usr/share/doc \ + "${D}"/usr/share/man \ + || die + chmod 644 "${D}"/etc/news/* || die + chmod 640 \ + "${D}"/etc/news/control.ctl \ + "${D}"/etc/news/expire.ctl \ + "${D}"/etc/news/incoming.conf \ + "${D}"/etc/news/innfeed.conf \ + "${D}"/etc/news/nntpsend.ctl \ + "${D}"/etc/news/passwd.nntp \ + "${D}"/etc/news/readers.conf \ + || die + + # Prevent old db/* files from being overwritten + insinto /usr/share/inn/dbexamples + newins site/active.minimal active + newins site/newsgroups.minimal newsgroups + + keepdir \ + /var/log/news \ + /var/spool/news/archive \ + /var/spool/news/articles \ + /var/spool/news/db \ + /var/spool/news/incoming \ + /var/spool/news/incoming/bad \ + /var/spool/news/innfeed \ + /var/spool/news/outgoing \ + /var/spool/news/overview \ + /var/spool/news/tmp + + fowners news:news /var/log/news + + dodoc ChangeLog MANIFEST README* doc/checklist + use ipv6 && dodoc doc/IPv6-info + + # So other programs can build against INN + insinto /usr/$(get_libdir)/news/include + doins include/*.h + + newinitd "${FILESDIR}"/innd-r1 innd +} + +pkg_postinst() { + for db_file in active newsgroups + do + [[ -f ${ROOT}var/spool/news/db/${db_file} ]] && continue + + if [[ -f ${ROOT}usr/share/inn/dbexamples/${db_file} ]] + then + cp "${ROOT}"usr/share/inn/dbexamples/${db_file} \ + "${ROOT}"var/spool/news/db/${db_file} + else + touch "${ROOT}"var/spool/news/db/${db_file} + fi + + chown news:news "${ROOT}"var/spool/news/db/${db_file} + chmod 664 "${ROOT}"var/spool/news/db/${db_file} + done + + elog "It is recommended to run emerge --config ${CATEGORY}/${PN}" + elog "now to finish setting up this package." + elog + elog "Do not forget to update your cron entries, and also run" + elog "makedbz if you need to. If this is a first-time installation" + elog "a minimal active file has been installed. You will need to" + elog "touch history and run 'makedbz -i' to initialize the history" + elog "database. See INSTALL for more information." + elog + elog "You need to assign a real shell to the news user, or else" + elog "starting inn will fail. You can use 'usermod -s /bin/bash news'" + elog "for this." + + if use ssl + then + install_cert /etc/news/cert/cert + chown news:news \ + "${ROOT}"etc/news/cert/cert.{crt,csr,key,pem} + + elog + elog "You may want to start nnrpd manually for native ssl support." + elog "If you choose to do so, automating this with a bootscript might" + elog "also be a good choice." + elog "Have a look at man nnrpd for valid parameters." + elog + elog "The certificate location in /etc/news/sasl.conf has been changed" + elog "to /etc/news/cert!" + + fi +} + +pkg_postrm() { + elog + elog "If you want your newsspool or altered configuration files" + elog "to be removed, please do so now manually." + elog +} + +pkg_config() { + NEWSSPOOL_DIR="${ROOT}var/spool/news" + NEWS_SHELL="$( awk -F':' '/^news:/ {print $7;}' ${ROOT}etc/passwd )" + NEWS_ERRFLAG="0" + + if [[ ${NEWS_SHELL} == /bin/false || ${NEWS_SHELL} == /dev/null ]]; then + einfo "Changing shell to /bin/bash for user news..." + usermod -s /bin/bash news + else + einfo "Shell for user news unchanged ('${NEWS_SHELL}')." + if [[ ${NEWS_SHELL} != /bin/sh && ${NEWS_SHELL} != /bin/bash ]]; then + ewarn "You might want to change it to '/bin/bash', though." + fi + fi + + if [[ ! -e ${NEWSSPOOL_DIR}/db/history ]]; then + if [[ ! -f ${NEWSSPOOL_DIR}/db/history.dir \ + && ! -f ${NEWSSPOOL_DIR}/db/history.pag \ + && ! -f ${NEWSSPOOL_DIR}/db/history.hash \ + && ! -f ${NEWSSPOOL_DIR}/db/history.index ]] + then + einfo "Building history database ..." + + touch "${NEWSSPOOL_DIR}"/db/history + chown news:news "${NEWSSPOOL_DIR}"/db/history + chmod 644 "${NEWSSPOOL_DIR}"/db/history + + einfo "Running makedbz -i ..." + su - news -c "/usr/$(get_libdir)/news/bin/makedbz -i" + + einfo "Moving files into place ..." + [[ -f ${NEWSSPOOL_DIR}/db/history.n.dir ]] && \ + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.dir \ + "${NEWSSPOOL_DIR}"/db/history.dir + [[ -f ${NEWSSPOOL_DIR}/db/history.n.pag ]] && \ + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.pag \ + "${NEWSSPOOL_DIR}"/db/history.pag + [[ -f ${NEWSSPOOL_DIR}/db/history.n.hash ]] && \ + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.hash \ + "${NEWSSPOOL_DIR}"/db/history.hash + [[ -f ${NEWSSPOOL_DIR}/db/history.n.index ]] && \ + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.index \ + "${NEWSSPOOL_DIR}"/db/history.index + + einfo "Running makehistory ..." + su - news -c /usr/$(get_libdir)/news/bin/makehistory + else + NEWS_ERRFLAG="1" + eerror "Your installation seems to be screwed up." + eerror "${NEWSSPOOL_DIR}/db/history does not exist, but there's" + eerror "one of the files history.dir, history.hash or history.index" + eerror "within ${NEWSSPOOL_DIR}/db." + eerror "Use your backup to restore the history database." + fi + else + einfo "${NEWSSPOOL_DIR}/db/history found." + einfo "Leaving history database as it is." + fi + + INNCFG_INODES=$( + sed /etc/news/inn.conf \ + -e '/innwatchspoolnodes/ ! d; s:[^ ]*[ ]*\([^ ]*\):\1:' + ) + INNSPOOL_INODES=$( + df -Pi ${NEWSSPOOL_DIR} | \ + sed -e 's:[^ ]*[ ]*\([^ ]*\).*:\1:; 1 d' + ) + if [[ ${INNCFG_INODES} -gt ${INNSPOOL_INODES} ]]; then + ewarn "Setting innwatchspoolinodes to zero, because the filesystem behind" + ewarn "$NEWSSPOOL_DIR works without inodes." + ewarn + cp /etc/news/inn.conf /etc/news/inn.conf.OLD + einfo "A copy of your old inn.conf has been saved to /etc/news/inn.conf.OLD." + sed -i /etc/news/inn.conf \ + -e '/innwatchspoolnodes/ s:\([^ ]*\)\([ ]*\).*:\1\20:' + chown news:news /etc/news/inn.conf + chmod 644 /etc/news/inn.conf + fi + + INNCHECK_LINES=$( + su - news -c "/usr/$(get_libdir)/news/bin/inncheck | wc -l" + ) + if [[ ${INNCHECK_LINES} -gt 0 ]]; then + NEWS_ERRFLAG="1" + ewarn "inncheck most certainly found an error." + ewarn "Please check its output:" + eerror "`su - news -c /usr/$(get_libdir)/news/bin/inncheck`" + fi + + if [[ ${NEWS_ERRFLAG} -gt 0 ]]; then + eerror "There were one or more errors/warnings checking your" + eerror "configuration. Please read inn's documentation and" + eerror "fix them accordingly." + else + einfo "INN configuration tests passed successfully." + ewarn "Please ensure you have configured inn properly." + fi +} diff --git a/net-nntp/inn/inn-2.5.5-r1.ebuild b/net-nntp/inn/inn-2.5.5-r1.ebuild new file mode 100644 index 000000000000..19a769d0a7cd --- /dev/null +++ b/net-nntp/inn/inn-2.5.5-r1.ebuild @@ -0,0 +1,286 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +PYTHON_COMPAT=( python2_7 ) + +inherit autotools eutils multilib python-single-r1 ssl-cert toolchain-funcs + +DESCRIPTION="The Internet News daemon, fully featured NNTP server" +HOMEPAGE="https://www.isc.org/software/inn" +SRC_URI="ftp://ftp.isc.org/isc/inn/${P}.tar.gz" + +# GPL-2 only for init script +LICENSE="ISC GPL-2+ public-domain BSD-4 BSD-2 RSA BSD MIT GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="berkdb innkeywords inntaggedhash ipv6 kerberos perl python sasl ssl" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +DEPEND=" + virtual/mta + dev-perl/MIME-tools + sys-libs/pam + sys-libs/zlib + kerberos? ( virtual/krb5 ) + sasl? ( >=dev-libs/cyrus-sasl-2 ) + ssl? ( dev-libs/openssl:0= ) + python? ( ${PYTHON_DEPS} ) + berkdb? ( sys-libs/db:* ) +" +RDEPEND="${DEPEND}" + +pkg_setup() { + use python && python-single-r1_pkg_setup +} + +src_prepare() { + epatch "${FILESDIR}"/${PN}-2.5.3-ar.patch + epatch "${FILESDIR}"/${PN}-2.5.3-tests.patch + + sed -e 's: -B .OLD::' -i Makefile.global.in || die + + # Do not treat LDFLAGS as if it contained libraries to link to + sed -e 's:LDFLAGS::g' -i m4/python.m4 || die + + # We do not have the biff service, but we do have comsat + sed -e 's:"biff":"comsat":g' -i tests/lib/getnameinfo-t.c || die + + eautoreconf +} + +src_configure() { + tc-export AR + + econf \ + --prefix=/usr/$(get_libdir)/news \ + --sysconfdir=/etc/news \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --with-control-dir=/usr/$(get_libdir)/news/bin/control \ + --with-filter-dir=/usr/$(get_libdir)/news/bin/filter \ + --with-db-dir=/var/spool/news/db \ + --with-doc-dir=/usr/share/doc/${PF} \ + --with-spool-dir=/var/spool/news \ + --with-log-dir=/var/log/news \ + --with-run-dir=/run/news \ + --with-tmp-dir=/var/spool/news/tmp \ + --disable-libtool \ + --with-gnu-ld \ + --enable-setgid-inews \ + --enable-uucp-rnews \ + $(use_with perl) \ + $(use_with python) \ + $(use_with kerberos kerberos /usr) \ + $(use_with sasl) \ + $(use_with ssl openssl) \ + $(use_with berkdb berkeleydb /usr) \ + $(use_enable ipv6) \ + $(use_enable !inntaggedhash largefiles) \ + $(use_enable inntaggedhash tagged-hash) \ + $(use_enable innkeywords keywords) +} + +src_install() { + emake DESTDIR="${D}/" P="" SPECIAL="" install + + chown -R root:0 \ + "${D}"/usr/$(get_libdir)/news/$(get_libdir) \ + "${D}"/usr/$(get_libdir)/news/include \ + "${D}"/usr/share/doc \ + "${D}"/usr/share/man \ + || die + chmod 644 "${D}"/etc/news/* || die + chmod 640 \ + "${D}"/etc/news/control.ctl \ + "${D}"/etc/news/expire.ctl \ + "${D}"/etc/news/incoming.conf \ + "${D}"/etc/news/innfeed.conf \ + "${D}"/etc/news/nntpsend.ctl \ + "${D}"/etc/news/passwd.nntp \ + "${D}"/etc/news/readers.conf \ + || die + + # Prevent old db/* files from being overwritten + insinto /usr/share/inn/dbexamples + newins site/active.minimal active + newins site/newsgroups.minimal newsgroups + + keepdir \ + /var/log/news \ + /var/spool/news/archive \ + /var/spool/news/articles \ + /var/spool/news/db \ + /var/spool/news/incoming \ + /var/spool/news/incoming/bad \ + /var/spool/news/innfeed \ + /var/spool/news/outgoing \ + /var/spool/news/overview \ + /var/spool/news/tmp + + fowners news:news /var/log/news + + dodoc ChangeLog MANIFEST README* doc/checklist + use ipv6 && dodoc doc/IPv6-info + + # So other programs can build against INN + insinto /usr/$(get_libdir)/news/include + doins include/*.h + + newinitd "${FILESDIR}"/innd-r1 innd +} + +pkg_postinst() { + for db_file in active newsgroups + do + [[ -f ${ROOT}var/spool/news/db/${db_file} ]] && continue + + if [[ -f ${ROOT}usr/share/inn/dbexamples/${db_file} ]] + then + cp "${ROOT}"usr/share/inn/dbexamples/${db_file} \ + "${ROOT}"var/spool/news/db/${db_file} + else + touch "${ROOT}"var/spool/news/db/${db_file} + fi + + chown news:news "${ROOT}"var/spool/news/db/${db_file} + chmod 664 "${ROOT}"var/spool/news/db/${db_file} + done + + elog "It is recommended to run emerge --config ${CATEGORY}/${PN}" + elog "now to finish setting up this package." + elog + elog "Do not forget to update your cron entries, and also run" + elog "makedbz if you need to. If this is a first-time installation" + elog "a minimal active file has been installed. You will need to" + elog "touch history and run 'makedbz -i' to initialize the history" + elog "database. See INSTALL for more information." + elog + elog "You need to assign a real shell to the news user, or else" + elog "starting inn will fail. You can use 'usermod -s /bin/bash news'" + elog "for this." + + if use ssl + then + install_cert /etc/news/cert/cert + chown news:news \ + "${ROOT}"etc/news/cert/cert.{crt,csr,key,pem} + + elog + elog "You may want to start nnrpd manually for native ssl support." + elog "If you choose to do so, automating this with a bootscript might" + elog "also be a good choice." + elog "Have a look at man nnrpd for valid parameters." + elog + elog "The certificate location in /etc/news/sasl.conf has been changed" + elog "to /etc/news/cert!" + + fi +} + +pkg_postrm() { + elog + elog "If you want your newsspool or altered configuration files" + elog "to be removed, please do so now manually." + elog +} + +pkg_config() { + NEWSSPOOL_DIR="${ROOT}var/spool/news" + NEWS_SHELL="$( awk -F':' '/^news:/ {print $7;}' ${ROOT}etc/passwd )" + NEWS_ERRFLAG="0" + + if [[ ${NEWS_SHELL} == /bin/false || ${NEWS_SHELL} == /dev/null ]]; then + einfo "Changing shell to /bin/bash for user news..." + usermod -s /bin/bash news + else + einfo "Shell for user news unchanged ('${NEWS_SHELL}')." + if [[ ${NEWS_SHELL} != /bin/sh && ${NEWS_SHELL} != /bin/bash ]]; then + ewarn "You might want to change it to '/bin/bash', though." + fi + fi + + if [[ ! -e ${NEWSSPOOL_DIR}/db/history ]]; then + if [[ ! -f ${NEWSSPOOL_DIR}/db/history.dir \ + && ! -f ${NEWSSPOOL_DIR}/db/history.pag \ + && ! -f ${NEWSSPOOL_DIR}/db/history.hash \ + && ! -f ${NEWSSPOOL_DIR}/db/history.index ]] + then + einfo "Building history database ..." + + touch "${NEWSSPOOL_DIR}"/db/history + chown news:news "${NEWSSPOOL_DIR}"/db/history + chmod 644 "${NEWSSPOOL_DIR}"/db/history + + einfo "Running makedbz -i ..." + su - news -c "/usr/$(get_libdir)/news/bin/makedbz -i" + + einfo "Moving files into place ..." + [[ -f ${NEWSSPOOL_DIR}/db/history.n.dir ]] && \ + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.dir \ + "${NEWSSPOOL_DIR}"/db/history.dir + [[ -f ${NEWSSPOOL_DIR}/db/history.n.pag ]] && \ + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.pag \ + "${NEWSSPOOL_DIR}"/db/history.pag + [[ -f ${NEWSSPOOL_DIR}/db/history.n.hash ]] && \ + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.hash \ + "${NEWSSPOOL_DIR}"/db/history.hash + [[ -f ${NEWSSPOOL_DIR}/db/history.n.index ]] && \ + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.index \ + "${NEWSSPOOL_DIR}"/db/history.index + + einfo "Running makehistory ..." + su - news -c /usr/$(get_libdir)/news/bin/makehistory + else + NEWS_ERRFLAG="1" + eerror "Your installation seems to be screwed up." + eerror "${NEWSSPOOL_DIR}/db/history does not exist, but there's" + eerror "one of the files history.dir, history.hash or history.index" + eerror "within ${NEWSSPOOL_DIR}/db." + eerror "Use your backup to restore the history database." + fi + else + einfo "${NEWSSPOOL_DIR}/db/history found." + einfo "Leaving history database as it is." + fi + + INNCFG_INODES=$( + sed /etc/news/inn.conf \ + -e '/innwatchspoolnodes/ ! d; s:[^ ]*[ ]*\([^ ]*\):\1:' + ) + INNSPOOL_INODES=$( + df -Pi ${NEWSSPOOL_DIR} | \ + sed -e 's:[^ ]*[ ]*\([^ ]*\).*:\1:; 1 d' + ) + if [[ ${INNCFG_INODES} -gt ${INNSPOOL_INODES} ]]; then + ewarn "Setting innwatchspoolinodes to zero, because the filesystem behind" + ewarn "$NEWSSPOOL_DIR works without inodes." + ewarn + cp /etc/news/inn.conf /etc/news/inn.conf.OLD + einfo "A copy of your old inn.conf has been saved to /etc/news/inn.conf.OLD." + sed -i /etc/news/inn.conf \ + -e '/innwatchspoolnodes/ s:\([^ ]*\)\([ ]*\).*:\1\20:' + chown news:news /etc/news/inn.conf + chmod 644 /etc/news/inn.conf + fi + + INNCHECK_LINES=$( + su - news -c "/usr/$(get_libdir)/news/bin/inncheck | wc -l" + ) + if [[ ${INNCHECK_LINES} -gt 0 ]]; then + NEWS_ERRFLAG="1" + ewarn "inncheck most certainly found an error." + ewarn "Please check its output:" + eerror "`su - news -c /usr/$(get_libdir)/news/bin/inncheck`" + fi + + if [[ ${NEWS_ERRFLAG} -gt 0 ]]; then + eerror "There were one or more errors/warnings checking your" + eerror "configuration. Please read inn's documentation and" + eerror "fix them accordingly." + else + einfo "INN configuration tests passed successfully." + ewarn "Please ensure you have configured inn properly." + fi +} diff --git a/net-nntp/inn/metadata.xml b/net-nntp/inn/metadata.xml new file mode 100644 index 000000000000..c3c5f1546ad1 --- /dev/null +++ b/net-nntp/inn/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<!-- maintainer-needed --> +<use> + <flag name="innkeywords">Enable automatic keyword generation support</flag> + <flag name="inntaggedhash">Use tagged hash table for history (disables large + file support)</flag> +</use> +</pkgmetadata> |