Gentoo Archives: gentoo-commits

From: Austin English <wizardedit@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-nntp/inn/, net-nntp/inn/files/
Date: Mon, 02 May 2016 23:16:32
Message-Id: 1462230973.0b6802a3d3ab74d5c6a46b6465b185aa4948dd64.wizardedit@gentoo
1 commit: 0b6802a3d3ab74d5c6a46b6465b185aa4948dd64
2 Author: Austin English <wizardedit <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 2 23:15:34 2016 +0000
4 Commit: Austin English <wizardedit <AT> gentoo <DOT> org>
5 CommitDate: Mon May 2 23:16:13 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b6802a3
7
8 net-nntp/inn: use #!/sbin/openrc-run instead of #!/sbin/runscript
9
10 Gentoo-Bug: https://bugs.gentoo.org/573846
11
12 Package-Manager: portage-2.2.26
13
14 net-nntp/inn/files/innd-r1 | 4 +-
15 net-nntp/inn/inn-2.5.3-r3.ebuild | 287 +++++++++++++++++++++++++++++++++++++++
16 net-nntp/inn/inn-2.5.4-r1.ebuild | 287 +++++++++++++++++++++++++++++++++++++++
17 net-nntp/inn/inn-2.5.5-r1.ebuild | 287 +++++++++++++++++++++++++++++++++++++++
18 4 files changed, 863 insertions(+), 2 deletions(-)
19
20 diff --git a/net-nntp/inn/files/innd-r1 b/net-nntp/inn/files/innd-r1
21 index 1169a67..1e79074 100644
22 --- a/net-nntp/inn/files/innd-r1
23 +++ b/net-nntp/inn/files/innd-r1
24 @@ -1,5 +1,5 @@
25 -#!/sbin/runscript
26 -# Copyright 1999-2013 Gentoo Foundation
27 +#!/sbin/openrc-run
28 +# Copyright 1999-2016 Gentoo Foundation
29 # Distributed under the terms of the GNU General Public License v2
30 # $Id$
31
32
33 diff --git a/net-nntp/inn/inn-2.5.3-r3.ebuild b/net-nntp/inn/inn-2.5.3-r3.ebuild
34 new file mode 100644
35 index 0000000..62eb9c6
36 --- /dev/null
37 +++ b/net-nntp/inn/inn-2.5.3-r3.ebuild
38 @@ -0,0 +1,287 @@
39 +# Copyright 1999-2016 Gentoo Foundation
40 +# Distributed under the terms of the GNU General Public License v2
41 +# $Id$
42 +
43 +EAPI=5
44 +PYTHON_COMPAT=( python2_7 )
45 +
46 +inherit autotools eutils multilib python-single-r1 ssl-cert toolchain-funcs
47 +
48 +DESCRIPTION="The Internet News daemon, fully featured NNTP server"
49 +HOMEPAGE="https://www.isc.org/software/inn"
50 +SRC_URI="ftp://ftp.isc.org/isc/inn/${P}.tar.gz"
51 +
52 +# GPL-2 only for init script
53 +LICENSE="ISC GPL-2+ public-domain BSD-4 BSD-2 RSA BSD MIT GPL-2"
54 +SLOT="0"
55 +KEYWORDS="~amd64 ~ppc ~x86"
56 +IUSE="berkdb innkeywords inntaggedhash ipv6 kerberos perl python sasl ssl"
57 +
58 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
59 +
60 +DEPEND="
61 + virtual/mta
62 + dev-perl/MIME-tools
63 + sys-libs/pam
64 + sys-libs/zlib
65 + kerberos? ( virtual/krb5 )
66 + sasl? ( >=dev-libs/cyrus-sasl-2 )
67 + ssl? ( dev-libs/openssl )
68 + python? ( ${PYTHON_DEPS} )
69 + berkdb? ( sys-libs/db )
70 +"
71 +RDEPEND="${DEPEND}"
72 +
73 +pkg_setup() {
74 + use python && python-single-r1_pkg_setup
75 +}
76 +
77 +src_prepare() {
78 + epatch "${FILESDIR}"/${P}-ar.patch
79 + epatch "${FILESDIR}"/${P}-tests.patch
80 +
81 + sed -e 's: -B .OLD::' -i Makefile.global.in || die
82 +
83 + # Do not treat LDFLAGS as if it contained libraries to link to
84 + sed -e 's:LDFLAGS::g' -i m4/python.m4 || die
85 +
86 + # We do not have the biff service, but we do have comsat
87 + sed -e 's:"biff":"comsat":g' -i tests/lib/getnameinfo-t.c || die
88 +
89 + eautoreconf
90 +}
91 +
92 +src_configure() {
93 + tc-export AR
94 +
95 + econf \
96 + --prefix=/usr/$(get_libdir)/news \
97 + --sysconfdir=/etc/news \
98 + --mandir=/usr/share/man \
99 + --infodir=/usr/share/info \
100 + --with-control-dir=/usr/$(get_libdir)/news/bin/control \
101 + --with-filter-dir=/usr/$(get_libdir)/news/bin/filter \
102 + --with-db-dir=/var/spool/news/db \
103 + --with-doc-dir=/usr/share/doc/${PF} \
104 + --with-spool-dir=/var/spool/news \
105 + --with-log-dir=/var/log/news \
106 + --with-run-dir=/run/news \
107 + --with-tmp-dir=/var/spool/news/tmp \
108 + --disable-libtool \
109 + --with-gnu-ld \
110 + --enable-setgid-inews \
111 + --enable-uucp-rnews \
112 + $(use_with perl) \
113 + $(use_with python) \
114 + $(use_with kerberos kerberos /usr) \
115 + $(use_with sasl) \
116 + $(use_with ssl openssl) \
117 + $(use_with berkdb berkeleydb /usr) \
118 + $(use_enable ipv6) \
119 + $(use_enable !inntaggedhash largefiles) \
120 + $(use_enable inntaggedhash tagged-hash) \
121 + $(use_enable innkeywords keywords)
122 +}
123 +
124 +src_install() {
125 + emake DESTDIR="${D}/" P="" SPECIAL="" install
126 +
127 + chown -R root:0 \
128 + "${D}"/usr/$(get_libdir)/news/$(get_libdir) \
129 + "${D}"/usr/$(get_libdir)/news/include \
130 + "${D}"/usr/share/doc \
131 + "${D}"/usr/share/man \
132 + || die
133 + chmod 644 "${D}"/etc/news/* || die
134 + chmod 640 \
135 + "${D}"/etc/news/control.ctl \
136 + "${D}"/etc/news/expire.ctl \
137 + "${D}"/etc/news/incoming.conf \
138 + "${D}"/etc/news/innfeed.conf \
139 + "${D}"/etc/news/nntpsend.ctl \
140 + "${D}"/etc/news/passwd.nntp \
141 + "${D}"/etc/news/readers.conf \
142 + || die
143 +
144 + # Prevent old db/* files from being overwritten
145 + insinto /usr/share/inn/dbexamples
146 + newins site/active.minimal active
147 + newins site/newsgroups.minimal newsgroups
148 +
149 + keepdir \
150 + /var/log/news \
151 + /var/spool/news/archive \
152 + /var/spool/news/articles \
153 + /var/spool/news/db \
154 + /var/spool/news/incoming \
155 + /var/spool/news/incoming/bad \
156 + /var/spool/news/innfeed \
157 + /var/spool/news/outgoing \
158 + /var/spool/news/overview \
159 + /var/spool/news/tmp
160 +
161 + fowners news:news /var/log/news
162 +
163 + dodoc ChangeLog MANIFEST README* doc/checklist
164 + use ipv6 && dodoc doc/IPv6-info
165 +
166 + # So other programs can build against INN
167 + insinto /usr/$(get_libdir)/news/include
168 + doins include/*.h
169 +
170 + newinitd "${FILESDIR}"/innd-r1 innd
171 +}
172 +
173 +pkg_postinst() {
174 + for db_file in active newsgroups
175 + do
176 + [[ -f ${ROOT}var/spool/news/db/${db_file} ]] && continue
177 +
178 + if [[ -f ${ROOT}usr/share/inn/dbexamples/${db_file} ]]
179 + then
180 + cp "${ROOT}"usr/share/inn/dbexamples/${db_file} \
181 + "${ROOT}"var/spool/news/db/${db_file}
182 + else
183 + touch "${ROOT}"var/spool/news/db/${db_file}
184 + fi
185 +
186 + chown news:news "${ROOT}"var/spool/news/db/${db_file}
187 + chmod 664 "${ROOT}"var/spool/news/db/${db_file}
188 + done
189 +
190 + elog "It is recommended to run emerge --config ${CATEGORY}/${PN}"
191 + elog "now to finish setting up this package."
192 + elog
193 + elog "Do not forget to update your cron entries, and also run"
194 + elog "makedbz if you need to. If this is a first-time installation"
195 + elog "a minimal active file has been installed. You will need to"
196 + elog "touch history and run 'makedbz -i' to initialize the history"
197 + elog "database. See INSTALL for more information."
198 + elog
199 + elog "You need to assign a real shell to the news user, or else"
200 + elog "starting inn will fail. You can use 'usermod -s /bin/bash news'"
201 + elog "for this."
202 +
203 + if use ssl
204 + then
205 + install_cert /etc/news/cert/cert
206 + chown news:news \
207 + "${ROOT}"etc/news/cert/cert.{crt,csr,key,pem}
208 +
209 + elog
210 + elog "You may want to start nnrpd manually for native ssl support."
211 + elog "If you choose to do so, automating this with a bootscript might"
212 + elog "also be a good choice."
213 + elog "Have a look at man nnrpd for valid parameters."
214 + elog
215 + elog "The certificate location in /etc/news/sasl.conf has been changed"
216 + elog "to /etc/news/cert!"
217 +
218 + fi
219 +}
220 +
221 +pkg_postrm() {
222 + elog
223 + elog "If you want your newsspool or altered configuration files"
224 + elog "to be removed, please do so now manually."
225 + elog
226 +}
227 +
228 +pkg_config() {
229 + NEWSSPOOL_DIR="${ROOT}var/spool/news"
230 + NEWS_SHELL="$( awk -F':' '/^news:/ {print $7;}' ${ROOT}etc/passwd )"
231 + NEWS_ERRFLAG="0"
232 +
233 + if [[ ${NEWS_SHELL} == /bin/false || ${NEWS_SHELL} == /dev/null ]]; then
234 + einfo "Changing shell to /bin/bash for user news..."
235 + usermod -s /bin/bash news
236 + else
237 + einfo "Shell for user news unchanged ('${NEWS_SHELL}')."
238 + if [[ ${NEWS_SHELL} != /bin/sh && ${NEWS_SHELL} != /bin/bash ]]; then
239 + ewarn "You might want to change it to '/bin/bash', though."
240 + fi
241 + fi
242 +
243 + if [[ ! -e ${NEWSSPOOL_DIR}/db/history ]]; then
244 + if [[ ! -f ${NEWSSPOOL_DIR}/db/history.dir \
245 + && ! -f ${NEWSSPOOL_DIR}/db/history.pag \
246 + && ! -f ${NEWSSPOOL_DIR}/db/history.hash \
247 + && ! -f ${NEWSSPOOL_DIR}/db/history.index ]]
248 + then
249 + einfo "Building history database ..."
250 +
251 + touch "${NEWSSPOOL_DIR}"/db/history
252 + chown news:news "${NEWSSPOOL_DIR}"/db/history
253 + chmod 644 "${NEWSSPOOL_DIR}"/db/history
254 +
255 + einfo "Running makedbz -i ..."
256 + su - news -c "/usr/$(get_libdir)/news/bin/makedbz -i"
257 +
258 + einfo "Moving files into place ..."
259 + [[ -f ${NEWSSPOOL_DIR}/db/history.n.dir ]] && \
260 + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.dir \
261 + "${NEWSSPOOL_DIR}"/db/history.dir
262 + [[ -f ${NEWSSPOOL_DIR}/db/history.n.pag ]] && \
263 + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.pag \
264 + "${NEWSSPOOL_DIR}"/db/history.pag
265 + [[ -f ${NEWSSPOOL_DIR}/db/history.n.hash ]] && \
266 + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.hash \
267 + "${NEWSSPOOL_DIR}"/db/history.hash
268 + [[ -f ${NEWSSPOOL_DIR}/db/history.n.index ]] && \
269 + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.index \
270 + "${NEWSSPOOL_DIR}"/db/history.index
271 +
272 + einfo "Running makehistory ..."
273 + su - news -c /usr/$(get_libdir)/news/bin/makehistory
274 + else
275 + NEWS_ERRFLAG="1"
276 + eerror "Your installation seems to be screwed up."
277 + eerror "${NEWSSPOOL_DIR}/db/history does not exist, but there's"
278 + eerror "one of the files history.dir, history.hash or history.index"
279 + eerror "within ${NEWSSPOOL_DIR}/db."
280 + eerror "Use your backup to restore the history database."
281 + fi
282 + else
283 + einfo "${NEWSSPOOL_DIR}/db/history found."
284 + einfo "Leaving history database as it is."
285 + fi
286 +
287 + INNCFG_INODES=$(
288 + sed /etc/news/inn.conf \
289 + -e '/innwatchspoolnodes/ ! d; s:[^ ]*[ ]*\([^ ]*\):\1:'
290 + )
291 + INNSPOOL_INODES=$(
292 + df -Pi ${NEWSSPOOL_DIR} | \
293 + sed -e 's:[^ ]*[ ]*\([^ ]*\).*:\1:; 1 d'
294 + )
295 + if [[ ${INNCFG_INODES} -gt ${INNSPOOL_INODES} ]]; then
296 + ewarn "Setting innwatchspoolinodes to zero, because the filesystem behind"
297 + ewarn "$NEWSSPOOL_DIR works without inodes."
298 + ewarn
299 + cp /etc/news/inn.conf /etc/news/inn.conf.OLD
300 + einfo "A copy of your old inn.conf has been saved to /etc/news/inn.conf.OLD."
301 + sed -i /etc/news/inn.conf \
302 + -e '/innwatchspoolnodes/ s:\([^ ]*\)\([ ]*\).*:\1\20:'
303 + chown news:news /etc/news/inn.conf
304 + chmod 644 /etc/news/inn.conf
305 + fi
306 +
307 + INNCHECK_LINES=$(
308 + su - news -c "/usr/$(get_libdir)/news/bin/inncheck | wc -l"
309 + )
310 + if [[ ${INNCHECK_LINES} -gt 0 ]]; then
311 + NEWS_ERRFLAG="1"
312 + ewarn "inncheck most certainly found an error."
313 + ewarn "Please check its output:"
314 + eerror "`su - news -c /usr/$(get_libdir)/news/bin/inncheck`"
315 + fi
316 +
317 + if [[ ${NEWS_ERRFLAG} -gt 0 ]]; then
318 + eerror "There were one or more errors/warnings checking your"
319 + eerror "configuration. Please read inn's documentation and"
320 + eerror "fix them accordingly."
321 + else
322 + einfo "INN configuration tests passed successfully."
323 + ewarn "Please ensure you have configured inn properly."
324 + fi
325 +}
326
327 diff --git a/net-nntp/inn/inn-2.5.4-r1.ebuild b/net-nntp/inn/inn-2.5.4-r1.ebuild
328 new file mode 100644
329 index 0000000..0d55e3f
330 --- /dev/null
331 +++ b/net-nntp/inn/inn-2.5.4-r1.ebuild
332 @@ -0,0 +1,287 @@
333 +# Copyright 1999-2016 Gentoo Foundation
334 +# Distributed under the terms of the GNU General Public License v2
335 +# $Id$
336 +
337 +EAPI=5
338 +PYTHON_COMPAT=( python2_7 )
339 +
340 +inherit autotools eutils multilib python-single-r1 ssl-cert toolchain-funcs
341 +
342 +DESCRIPTION="The Internet News daemon, fully featured NNTP server"
343 +HOMEPAGE="https://www.isc.org/software/inn"
344 +SRC_URI="ftp://ftp.isc.org/isc/inn/${P}.tar.gz"
345 +
346 +# GPL-2 only for init script
347 +LICENSE="ISC GPL-2+ public-domain BSD-4 BSD-2 RSA BSD MIT GPL-2"
348 +SLOT="0"
349 +KEYWORDS="~amd64 ~ppc ~x86"
350 +IUSE="berkdb innkeywords inntaggedhash ipv6 kerberos perl python sasl ssl"
351 +
352 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
353 +
354 +DEPEND="
355 + virtual/mta
356 + dev-perl/MIME-tools
357 + sys-libs/pam
358 + sys-libs/zlib
359 + kerberos? ( virtual/krb5 )
360 + sasl? ( >=dev-libs/cyrus-sasl-2 )
361 + ssl? ( dev-libs/openssl )
362 + python? ( ${PYTHON_DEPS} )
363 + berkdb? ( sys-libs/db )
364 +"
365 +RDEPEND="${DEPEND}"
366 +
367 +pkg_setup() {
368 + use python && python-single-r1_pkg_setup
369 +}
370 +
371 +src_prepare() {
372 + epatch "${FILESDIR}"/${PN}-2.5.3-ar.patch
373 + epatch "${FILESDIR}"/${PN}-2.5.3-tests.patch
374 +
375 + sed -e 's: -B .OLD::' -i Makefile.global.in || die
376 +
377 + # Do not treat LDFLAGS as if it contained libraries to link to
378 + sed -e 's:LDFLAGS::g' -i m4/python.m4 || die
379 +
380 + # We do not have the biff service, but we do have comsat
381 + sed -e 's:"biff":"comsat":g' -i tests/lib/getnameinfo-t.c || die
382 +
383 + eautoreconf
384 +}
385 +
386 +src_configure() {
387 + tc-export AR
388 +
389 + econf \
390 + --prefix=/usr/$(get_libdir)/news \
391 + --sysconfdir=/etc/news \
392 + --mandir=/usr/share/man \
393 + --infodir=/usr/share/info \
394 + --with-control-dir=/usr/$(get_libdir)/news/bin/control \
395 + --with-filter-dir=/usr/$(get_libdir)/news/bin/filter \
396 + --with-db-dir=/var/spool/news/db \
397 + --with-doc-dir=/usr/share/doc/${PF} \
398 + --with-spool-dir=/var/spool/news \
399 + --with-log-dir=/var/log/news \
400 + --with-run-dir=/run/news \
401 + --with-tmp-dir=/var/spool/news/tmp \
402 + --disable-libtool \
403 + --with-gnu-ld \
404 + --enable-setgid-inews \
405 + --enable-uucp-rnews \
406 + $(use_with perl) \
407 + $(use_with python) \
408 + $(use_with kerberos kerberos /usr) \
409 + $(use_with sasl) \
410 + $(use_with ssl openssl) \
411 + $(use_with berkdb berkeleydb /usr) \
412 + $(use_enable ipv6) \
413 + $(use_enable !inntaggedhash largefiles) \
414 + $(use_enable inntaggedhash tagged-hash) \
415 + $(use_enable innkeywords keywords)
416 +}
417 +
418 +src_install() {
419 + emake DESTDIR="${D}/" P="" SPECIAL="" install
420 +
421 + chown -R root:0 \
422 + "${D}"/usr/$(get_libdir)/news/$(get_libdir) \
423 + "${D}"/usr/$(get_libdir)/news/include \
424 + "${D}"/usr/share/doc \
425 + "${D}"/usr/share/man \
426 + || die
427 + chmod 644 "${D}"/etc/news/* || die
428 + chmod 640 \
429 + "${D}"/etc/news/control.ctl \
430 + "${D}"/etc/news/expire.ctl \
431 + "${D}"/etc/news/incoming.conf \
432 + "${D}"/etc/news/innfeed.conf \
433 + "${D}"/etc/news/nntpsend.ctl \
434 + "${D}"/etc/news/passwd.nntp \
435 + "${D}"/etc/news/readers.conf \
436 + || die
437 +
438 + # Prevent old db/* files from being overwritten
439 + insinto /usr/share/inn/dbexamples
440 + newins site/active.minimal active
441 + newins site/newsgroups.minimal newsgroups
442 +
443 + keepdir \
444 + /var/log/news \
445 + /var/spool/news/archive \
446 + /var/spool/news/articles \
447 + /var/spool/news/db \
448 + /var/spool/news/incoming \
449 + /var/spool/news/incoming/bad \
450 + /var/spool/news/innfeed \
451 + /var/spool/news/outgoing \
452 + /var/spool/news/overview \
453 + /var/spool/news/tmp
454 +
455 + fowners news:news /var/log/news
456 +
457 + dodoc ChangeLog MANIFEST README* doc/checklist
458 + use ipv6 && dodoc doc/IPv6-info
459 +
460 + # So other programs can build against INN
461 + insinto /usr/$(get_libdir)/news/include
462 + doins include/*.h
463 +
464 + newinitd "${FILESDIR}"/innd-r1 innd
465 +}
466 +
467 +pkg_postinst() {
468 + for db_file in active newsgroups
469 + do
470 + [[ -f ${ROOT}var/spool/news/db/${db_file} ]] && continue
471 +
472 + if [[ -f ${ROOT}usr/share/inn/dbexamples/${db_file} ]]
473 + then
474 + cp "${ROOT}"usr/share/inn/dbexamples/${db_file} \
475 + "${ROOT}"var/spool/news/db/${db_file}
476 + else
477 + touch "${ROOT}"var/spool/news/db/${db_file}
478 + fi
479 +
480 + chown news:news "${ROOT}"var/spool/news/db/${db_file}
481 + chmod 664 "${ROOT}"var/spool/news/db/${db_file}
482 + done
483 +
484 + elog "It is recommended to run emerge --config ${CATEGORY}/${PN}"
485 + elog "now to finish setting up this package."
486 + elog
487 + elog "Do not forget to update your cron entries, and also run"
488 + elog "makedbz if you need to. If this is a first-time installation"
489 + elog "a minimal active file has been installed. You will need to"
490 + elog "touch history and run 'makedbz -i' to initialize the history"
491 + elog "database. See INSTALL for more information."
492 + elog
493 + elog "You need to assign a real shell to the news user, or else"
494 + elog "starting inn will fail. You can use 'usermod -s /bin/bash news'"
495 + elog "for this."
496 +
497 + if use ssl
498 + then
499 + install_cert /etc/news/cert/cert
500 + chown news:news \
501 + "${ROOT}"etc/news/cert/cert.{crt,csr,key,pem}
502 +
503 + elog
504 + elog "You may want to start nnrpd manually for native ssl support."
505 + elog "If you choose to do so, automating this with a bootscript might"
506 + elog "also be a good choice."
507 + elog "Have a look at man nnrpd for valid parameters."
508 + elog
509 + elog "The certificate location in /etc/news/sasl.conf has been changed"
510 + elog "to /etc/news/cert!"
511 +
512 + fi
513 +}
514 +
515 +pkg_postrm() {
516 + elog
517 + elog "If you want your newsspool or altered configuration files"
518 + elog "to be removed, please do so now manually."
519 + elog
520 +}
521 +
522 +pkg_config() {
523 + NEWSSPOOL_DIR="${ROOT}var/spool/news"
524 + NEWS_SHELL="$( awk -F':' '/^news:/ {print $7;}' ${ROOT}etc/passwd )"
525 + NEWS_ERRFLAG="0"
526 +
527 + if [[ ${NEWS_SHELL} == /bin/false || ${NEWS_SHELL} == /dev/null ]]; then
528 + einfo "Changing shell to /bin/bash for user news..."
529 + usermod -s /bin/bash news
530 + else
531 + einfo "Shell for user news unchanged ('${NEWS_SHELL}')."
532 + if [[ ${NEWS_SHELL} != /bin/sh && ${NEWS_SHELL} != /bin/bash ]]; then
533 + ewarn "You might want to change it to '/bin/bash', though."
534 + fi
535 + fi
536 +
537 + if [[ ! -e ${NEWSSPOOL_DIR}/db/history ]]; then
538 + if [[ ! -f ${NEWSSPOOL_DIR}/db/history.dir \
539 + && ! -f ${NEWSSPOOL_DIR}/db/history.pag \
540 + && ! -f ${NEWSSPOOL_DIR}/db/history.hash \
541 + && ! -f ${NEWSSPOOL_DIR}/db/history.index ]]
542 + then
543 + einfo "Building history database ..."
544 +
545 + touch "${NEWSSPOOL_DIR}"/db/history
546 + chown news:news "${NEWSSPOOL_DIR}"/db/history
547 + chmod 644 "${NEWSSPOOL_DIR}"/db/history
548 +
549 + einfo "Running makedbz -i ..."
550 + su - news -c "/usr/$(get_libdir)/news/bin/makedbz -i"
551 +
552 + einfo "Moving files into place ..."
553 + [[ -f ${NEWSSPOOL_DIR}/db/history.n.dir ]] && \
554 + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.dir \
555 + "${NEWSSPOOL_DIR}"/db/history.dir
556 + [[ -f ${NEWSSPOOL_DIR}/db/history.n.pag ]] && \
557 + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.pag \
558 + "${NEWSSPOOL_DIR}"/db/history.pag
559 + [[ -f ${NEWSSPOOL_DIR}/db/history.n.hash ]] && \
560 + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.hash \
561 + "${NEWSSPOOL_DIR}"/db/history.hash
562 + [[ -f ${NEWSSPOOL_DIR}/db/history.n.index ]] && \
563 + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.index \
564 + "${NEWSSPOOL_DIR}"/db/history.index
565 +
566 + einfo "Running makehistory ..."
567 + su - news -c /usr/$(get_libdir)/news/bin/makehistory
568 + else
569 + NEWS_ERRFLAG="1"
570 + eerror "Your installation seems to be screwed up."
571 + eerror "${NEWSSPOOL_DIR}/db/history does not exist, but there's"
572 + eerror "one of the files history.dir, history.hash or history.index"
573 + eerror "within ${NEWSSPOOL_DIR}/db."
574 + eerror "Use your backup to restore the history database."
575 + fi
576 + else
577 + einfo "${NEWSSPOOL_DIR}/db/history found."
578 + einfo "Leaving history database as it is."
579 + fi
580 +
581 + INNCFG_INODES=$(
582 + sed /etc/news/inn.conf \
583 + -e '/innwatchspoolnodes/ ! d; s:[^ ]*[ ]*\([^ ]*\):\1:'
584 + )
585 + INNSPOOL_INODES=$(
586 + df -Pi ${NEWSSPOOL_DIR} | \
587 + sed -e 's:[^ ]*[ ]*\([^ ]*\).*:\1:; 1 d'
588 + )
589 + if [[ ${INNCFG_INODES} -gt ${INNSPOOL_INODES} ]]; then
590 + ewarn "Setting innwatchspoolinodes to zero, because the filesystem behind"
591 + ewarn "$NEWSSPOOL_DIR works without inodes."
592 + ewarn
593 + cp /etc/news/inn.conf /etc/news/inn.conf.OLD
594 + einfo "A copy of your old inn.conf has been saved to /etc/news/inn.conf.OLD."
595 + sed -i /etc/news/inn.conf \
596 + -e '/innwatchspoolnodes/ s:\([^ ]*\)\([ ]*\).*:\1\20:'
597 + chown news:news /etc/news/inn.conf
598 + chmod 644 /etc/news/inn.conf
599 + fi
600 +
601 + INNCHECK_LINES=$(
602 + su - news -c "/usr/$(get_libdir)/news/bin/inncheck | wc -l"
603 + )
604 + if [[ ${INNCHECK_LINES} -gt 0 ]]; then
605 + NEWS_ERRFLAG="1"
606 + ewarn "inncheck most certainly found an error."
607 + ewarn "Please check its output:"
608 + eerror "`su - news -c /usr/$(get_libdir)/news/bin/inncheck`"
609 + fi
610 +
611 + if [[ ${NEWS_ERRFLAG} -gt 0 ]]; then
612 + eerror "There were one or more errors/warnings checking your"
613 + eerror "configuration. Please read inn's documentation and"
614 + eerror "fix them accordingly."
615 + else
616 + einfo "INN configuration tests passed successfully."
617 + ewarn "Please ensure you have configured inn properly."
618 + fi
619 +}
620
621 diff --git a/net-nntp/inn/inn-2.5.5-r1.ebuild b/net-nntp/inn/inn-2.5.5-r1.ebuild
622 new file mode 100644
623 index 0000000..0d55e3f
624 --- /dev/null
625 +++ b/net-nntp/inn/inn-2.5.5-r1.ebuild
626 @@ -0,0 +1,287 @@
627 +# Copyright 1999-2016 Gentoo Foundation
628 +# Distributed under the terms of the GNU General Public License v2
629 +# $Id$
630 +
631 +EAPI=5
632 +PYTHON_COMPAT=( python2_7 )
633 +
634 +inherit autotools eutils multilib python-single-r1 ssl-cert toolchain-funcs
635 +
636 +DESCRIPTION="The Internet News daemon, fully featured NNTP server"
637 +HOMEPAGE="https://www.isc.org/software/inn"
638 +SRC_URI="ftp://ftp.isc.org/isc/inn/${P}.tar.gz"
639 +
640 +# GPL-2 only for init script
641 +LICENSE="ISC GPL-2+ public-domain BSD-4 BSD-2 RSA BSD MIT GPL-2"
642 +SLOT="0"
643 +KEYWORDS="~amd64 ~ppc ~x86"
644 +IUSE="berkdb innkeywords inntaggedhash ipv6 kerberos perl python sasl ssl"
645 +
646 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
647 +
648 +DEPEND="
649 + virtual/mta
650 + dev-perl/MIME-tools
651 + sys-libs/pam
652 + sys-libs/zlib
653 + kerberos? ( virtual/krb5 )
654 + sasl? ( >=dev-libs/cyrus-sasl-2 )
655 + ssl? ( dev-libs/openssl )
656 + python? ( ${PYTHON_DEPS} )
657 + berkdb? ( sys-libs/db )
658 +"
659 +RDEPEND="${DEPEND}"
660 +
661 +pkg_setup() {
662 + use python && python-single-r1_pkg_setup
663 +}
664 +
665 +src_prepare() {
666 + epatch "${FILESDIR}"/${PN}-2.5.3-ar.patch
667 + epatch "${FILESDIR}"/${PN}-2.5.3-tests.patch
668 +
669 + sed -e 's: -B .OLD::' -i Makefile.global.in || die
670 +
671 + # Do not treat LDFLAGS as if it contained libraries to link to
672 + sed -e 's:LDFLAGS::g' -i m4/python.m4 || die
673 +
674 + # We do not have the biff service, but we do have comsat
675 + sed -e 's:"biff":"comsat":g' -i tests/lib/getnameinfo-t.c || die
676 +
677 + eautoreconf
678 +}
679 +
680 +src_configure() {
681 + tc-export AR
682 +
683 + econf \
684 + --prefix=/usr/$(get_libdir)/news \
685 + --sysconfdir=/etc/news \
686 + --mandir=/usr/share/man \
687 + --infodir=/usr/share/info \
688 + --with-control-dir=/usr/$(get_libdir)/news/bin/control \
689 + --with-filter-dir=/usr/$(get_libdir)/news/bin/filter \
690 + --with-db-dir=/var/spool/news/db \
691 + --with-doc-dir=/usr/share/doc/${PF} \
692 + --with-spool-dir=/var/spool/news \
693 + --with-log-dir=/var/log/news \
694 + --with-run-dir=/run/news \
695 + --with-tmp-dir=/var/spool/news/tmp \
696 + --disable-libtool \
697 + --with-gnu-ld \
698 + --enable-setgid-inews \
699 + --enable-uucp-rnews \
700 + $(use_with perl) \
701 + $(use_with python) \
702 + $(use_with kerberos kerberos /usr) \
703 + $(use_with sasl) \
704 + $(use_with ssl openssl) \
705 + $(use_with berkdb berkeleydb /usr) \
706 + $(use_enable ipv6) \
707 + $(use_enable !inntaggedhash largefiles) \
708 + $(use_enable inntaggedhash tagged-hash) \
709 + $(use_enable innkeywords keywords)
710 +}
711 +
712 +src_install() {
713 + emake DESTDIR="${D}/" P="" SPECIAL="" install
714 +
715 + chown -R root:0 \
716 + "${D}"/usr/$(get_libdir)/news/$(get_libdir) \
717 + "${D}"/usr/$(get_libdir)/news/include \
718 + "${D}"/usr/share/doc \
719 + "${D}"/usr/share/man \
720 + || die
721 + chmod 644 "${D}"/etc/news/* || die
722 + chmod 640 \
723 + "${D}"/etc/news/control.ctl \
724 + "${D}"/etc/news/expire.ctl \
725 + "${D}"/etc/news/incoming.conf \
726 + "${D}"/etc/news/innfeed.conf \
727 + "${D}"/etc/news/nntpsend.ctl \
728 + "${D}"/etc/news/passwd.nntp \
729 + "${D}"/etc/news/readers.conf \
730 + || die
731 +
732 + # Prevent old db/* files from being overwritten
733 + insinto /usr/share/inn/dbexamples
734 + newins site/active.minimal active
735 + newins site/newsgroups.minimal newsgroups
736 +
737 + keepdir \
738 + /var/log/news \
739 + /var/spool/news/archive \
740 + /var/spool/news/articles \
741 + /var/spool/news/db \
742 + /var/spool/news/incoming \
743 + /var/spool/news/incoming/bad \
744 + /var/spool/news/innfeed \
745 + /var/spool/news/outgoing \
746 + /var/spool/news/overview \
747 + /var/spool/news/tmp
748 +
749 + fowners news:news /var/log/news
750 +
751 + dodoc ChangeLog MANIFEST README* doc/checklist
752 + use ipv6 && dodoc doc/IPv6-info
753 +
754 + # So other programs can build against INN
755 + insinto /usr/$(get_libdir)/news/include
756 + doins include/*.h
757 +
758 + newinitd "${FILESDIR}"/innd-r1 innd
759 +}
760 +
761 +pkg_postinst() {
762 + for db_file in active newsgroups
763 + do
764 + [[ -f ${ROOT}var/spool/news/db/${db_file} ]] && continue
765 +
766 + if [[ -f ${ROOT}usr/share/inn/dbexamples/${db_file} ]]
767 + then
768 + cp "${ROOT}"usr/share/inn/dbexamples/${db_file} \
769 + "${ROOT}"var/spool/news/db/${db_file}
770 + else
771 + touch "${ROOT}"var/spool/news/db/${db_file}
772 + fi
773 +
774 + chown news:news "${ROOT}"var/spool/news/db/${db_file}
775 + chmod 664 "${ROOT}"var/spool/news/db/${db_file}
776 + done
777 +
778 + elog "It is recommended to run emerge --config ${CATEGORY}/${PN}"
779 + elog "now to finish setting up this package."
780 + elog
781 + elog "Do not forget to update your cron entries, and also run"
782 + elog "makedbz if you need to. If this is a first-time installation"
783 + elog "a minimal active file has been installed. You will need to"
784 + elog "touch history and run 'makedbz -i' to initialize the history"
785 + elog "database. See INSTALL for more information."
786 + elog
787 + elog "You need to assign a real shell to the news user, or else"
788 + elog "starting inn will fail. You can use 'usermod -s /bin/bash news'"
789 + elog "for this."
790 +
791 + if use ssl
792 + then
793 + install_cert /etc/news/cert/cert
794 + chown news:news \
795 + "${ROOT}"etc/news/cert/cert.{crt,csr,key,pem}
796 +
797 + elog
798 + elog "You may want to start nnrpd manually for native ssl support."
799 + elog "If you choose to do so, automating this with a bootscript might"
800 + elog "also be a good choice."
801 + elog "Have a look at man nnrpd for valid parameters."
802 + elog
803 + elog "The certificate location in /etc/news/sasl.conf has been changed"
804 + elog "to /etc/news/cert!"
805 +
806 + fi
807 +}
808 +
809 +pkg_postrm() {
810 + elog
811 + elog "If you want your newsspool or altered configuration files"
812 + elog "to be removed, please do so now manually."
813 + elog
814 +}
815 +
816 +pkg_config() {
817 + NEWSSPOOL_DIR="${ROOT}var/spool/news"
818 + NEWS_SHELL="$( awk -F':' '/^news:/ {print $7;}' ${ROOT}etc/passwd )"
819 + NEWS_ERRFLAG="0"
820 +
821 + if [[ ${NEWS_SHELL} == /bin/false || ${NEWS_SHELL} == /dev/null ]]; then
822 + einfo "Changing shell to /bin/bash for user news..."
823 + usermod -s /bin/bash news
824 + else
825 + einfo "Shell for user news unchanged ('${NEWS_SHELL}')."
826 + if [[ ${NEWS_SHELL} != /bin/sh && ${NEWS_SHELL} != /bin/bash ]]; then
827 + ewarn "You might want to change it to '/bin/bash', though."
828 + fi
829 + fi
830 +
831 + if [[ ! -e ${NEWSSPOOL_DIR}/db/history ]]; then
832 + if [[ ! -f ${NEWSSPOOL_DIR}/db/history.dir \
833 + && ! -f ${NEWSSPOOL_DIR}/db/history.pag \
834 + && ! -f ${NEWSSPOOL_DIR}/db/history.hash \
835 + && ! -f ${NEWSSPOOL_DIR}/db/history.index ]]
836 + then
837 + einfo "Building history database ..."
838 +
839 + touch "${NEWSSPOOL_DIR}"/db/history
840 + chown news:news "${NEWSSPOOL_DIR}"/db/history
841 + chmod 644 "${NEWSSPOOL_DIR}"/db/history
842 +
843 + einfo "Running makedbz -i ..."
844 + su - news -c "/usr/$(get_libdir)/news/bin/makedbz -i"
845 +
846 + einfo "Moving files into place ..."
847 + [[ -f ${NEWSSPOOL_DIR}/db/history.n.dir ]] && \
848 + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.dir \
849 + "${NEWSSPOOL_DIR}"/db/history.dir
850 + [[ -f ${NEWSSPOOL_DIR}/db/history.n.pag ]] && \
851 + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.pag \
852 + "${NEWSSPOOL_DIR}"/db/history.pag
853 + [[ -f ${NEWSSPOOL_DIR}/db/history.n.hash ]] && \
854 + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.hash \
855 + "${NEWSSPOOL_DIR}"/db/history.hash
856 + [[ -f ${NEWSSPOOL_DIR}/db/history.n.index ]] && \
857 + mv -vf "${NEWSSPOOL_DIR}"/db/history.n.index \
858 + "${NEWSSPOOL_DIR}"/db/history.index
859 +
860 + einfo "Running makehistory ..."
861 + su - news -c /usr/$(get_libdir)/news/bin/makehistory
862 + else
863 + NEWS_ERRFLAG="1"
864 + eerror "Your installation seems to be screwed up."
865 + eerror "${NEWSSPOOL_DIR}/db/history does not exist, but there's"
866 + eerror "one of the files history.dir, history.hash or history.index"
867 + eerror "within ${NEWSSPOOL_DIR}/db."
868 + eerror "Use your backup to restore the history database."
869 + fi
870 + else
871 + einfo "${NEWSSPOOL_DIR}/db/history found."
872 + einfo "Leaving history database as it is."
873 + fi
874 +
875 + INNCFG_INODES=$(
876 + sed /etc/news/inn.conf \
877 + -e '/innwatchspoolnodes/ ! d; s:[^ ]*[ ]*\([^ ]*\):\1:'
878 + )
879 + INNSPOOL_INODES=$(
880 + df -Pi ${NEWSSPOOL_DIR} | \
881 + sed -e 's:[^ ]*[ ]*\([^ ]*\).*:\1:; 1 d'
882 + )
883 + if [[ ${INNCFG_INODES} -gt ${INNSPOOL_INODES} ]]; then
884 + ewarn "Setting innwatchspoolinodes to zero, because the filesystem behind"
885 + ewarn "$NEWSSPOOL_DIR works without inodes."
886 + ewarn
887 + cp /etc/news/inn.conf /etc/news/inn.conf.OLD
888 + einfo "A copy of your old inn.conf has been saved to /etc/news/inn.conf.OLD."
889 + sed -i /etc/news/inn.conf \
890 + -e '/innwatchspoolnodes/ s:\([^ ]*\)\([ ]*\).*:\1\20:'
891 + chown news:news /etc/news/inn.conf
892 + chmod 644 /etc/news/inn.conf
893 + fi
894 +
895 + INNCHECK_LINES=$(
896 + su - news -c "/usr/$(get_libdir)/news/bin/inncheck | wc -l"
897 + )
898 + if [[ ${INNCHECK_LINES} -gt 0 ]]; then
899 + NEWS_ERRFLAG="1"
900 + ewarn "inncheck most certainly found an error."
901 + ewarn "Please check its output:"
902 + eerror "`su - news -c /usr/$(get_libdir)/news/bin/inncheck`"
903 + fi
904 +
905 + if [[ ${NEWS_ERRFLAG} -gt 0 ]]; then
906 + eerror "There were one or more errors/warnings checking your"
907 + eerror "configuration. Please read inn's documentation and"
908 + eerror "fix them accordingly."
909 + else
910 + einfo "INN configuration tests passed successfully."
911 + ewarn "Please ensure you have configured inn properly."
912 + fi
913 +}