summaryrefslogtreecommitdiff
path: root/net-nntp/inn/inn-2.7.1.ebuild
blob: 4312b61f8cf91647fe277a62bfbe0514b6f7068c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Copyright 2022-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{12..13} )
inherit optfeature perl-functions python-single-r1 tmpfiles verify-sig

DESCRIPTION="InterNetNews - the Internet meets Netnews"
HOMEPAGE="
	https://www.isc.org/othersoftware/#INN
	https://www.eyrie.org/~eagle/software/inn/
	https://github.com/InterNetNews/inn
"
SRC_URI="https://downloads.isc.org/isc/${PN}/${P}.tar.gz
	https://github.com/InterNetNews/inn/releases/download/${PV}/${P}.tar.gz
	verify-sig? (
		https://downloads.isc.org/isc/${PN}/${P}.tar.gz.asc
		https://github.com/InterNetNews/inn/releases/download/${PV}/${P}.tar.gz.asc
	)"

LICENSE="BSD BSD-2 BSD-4 GPL-2+ ISC MIT RSA powell public-domain"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+bzip2 cancel-locks gzip kerberos low-memory python sasl sqlite ssl test zlib"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
RESTRICT="!test? ( test )"

DEPEND="
	app-crypt/gnupg
	dev-lang/perl:=
	sys-libs/gdbm:=
	sys-libs/pam
	virtual/libcrypt:=
	virtual/mta
	bzip2? ( app-alternatives/bzip2 )
	cancel-locks? ( net-libs/canlock:= )
	gzip? ( app-alternatives/gzip )
	kerberos? ( virtual/krb5 )
	python? ( ${PYTHON_DEPS} )
	sasl? ( dev-libs/cyrus-sasl:2 )
	sqlite? ( dev-db/sqlite:3 )
	ssl? ( dev-libs/openssl:= )
	zlib? ( virtual/zlib:= )
"
RDEPEND="${DEPEND}"
BDEPEND="
	app-alternatives/lex
	app-alternatives/yacc
	dev-lang/perl
	virtual/pkgconfig
	test? ( dev-perl/Test-Pod )
	verify-sig? ( >=sec-keys/openpgp-keys-russallbery-20230000 )
"

DOCS=( CONTRIBUTORS HACKING INSTALL NEWS README TODO )

VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/russallbery.asc"

src_configure() {
	econf_args=(
		UUSTAT="${EPREFIX}/usr/bin/uustat"
		inn_cv_compiler_c__g="no"
		inn_cv_compiler_c__O3="no"
		inn_cv_compiler_c__Werror="no"

		--prefix="${EPREFIX}"/opt/${PN}
		--includedir="${EPREFIX}"/usr/include
		--sysconfdir="${EPREFIX}"/etc/news

		--with-control-dir="${EPREFIX}"/usr/libexec/inn/control
		--with-db-dir="${EPREFIX}"/var/db/news
		--with-doc-dir="${EPREFIX}"/usr/share/doc/${PF}
		--with-filter-dir="${EPREFIX}"/usr/libexec/inn/filter
		--with-http-dir="${EPREFIX}"/usr/share/${PN}/http
		--with-libperl-dir="$(perl_get_vendorlib)"
		--with-log-dir="${EPREFIX}"/var/log/news
		--with-run-dir="${EPREFIX}"/run/news
		--with-spool-dir="${EPREFIX}"/var/spool/news
		--with-tmp-dir="${EPREFIX}"/var/tmp/news

		$(use_enable !low-memory largefiles)
		$(use_enable low-memory tagged-hash)
		$(use_with cancel-locks canlock)
		$(use_with kerberos krb5)
		$(use_with python)
		$(use_with sasl)
		$(use_with sqlite sqlite3)
		$(use_with ssl openssl)
		$(use_with zlib)
		--disable-hardening-flags
		--enable-keywords
		--with-perl
		--without-bdb # deprecated db
		--without-blacklist # FreeBSD-only
	)

	if use bzip2; then
		econf_args+=( --with-log-compress=bzip2 )
	elif use gzip; then
		econf_args+=( --with-log-compress=gzip )
	else
		econf_args+=( --with-log-compress=cat )
	fi

	econf "${econf_args[@]}"
}

src_install() {
	default

	keepdir /var/log/news/OLD
	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 "${ED}"/var/tmp || die

	for svc in cnfsstat innwatch; do
		newinitd "${FILESDIR}"/${svc}.initd ${svc}
		newconfd "${FILESDIR}"/${svc}.confd ${svc}
	done
	newinitd "${FILESDIR}"/innd.initd-r1 innd
	newconfd "${FILESDIR}"/innd.confd innd

	if use sqlite; then
		newinitd "${FILESDIR}"/ovsqlite.initd ovsqlite
	fi

	newtmpfiles "${FILESDIR}"/inn.tmpfiles-r1 inn.conf
}

pkg_postinst() {
	optfeature "controlchan script" dev-perl/MIME-tools
	optfeature "innreport script" dev-perl/GD
	optfeature "send-uucp backend" net-misc/taylor-uucp

	if use sqlite; then
		optfeature "ovsqlite-util script" dev-perl/DBD-SQLite
	fi

	tmpfiles_process inn.conf
}