summaryrefslogtreecommitdiff
path: root/net-nntp/tin/tin-2.6.5.ebuild
blob: b651e8aacb061abeca408f3b98e4cef9ccfd63b9 (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
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit optfeature toolchain-funcs

DESCRIPTION="A threaded NNTP and spool based UseNet newsreader"
HOMEPAGE="http://www.tin.org/"
SRC_URI="ftp://ftp.tin.org/pub/news/clients/tin/stable/${P}.tar.xz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 arm ppc x86"
IUSE="cancel-locks debug gnutls gpg libtls nls sasl socks5 ssl"

RDEPEND="
	dev-libs/icu:=
	dev-libs/libpcre2:=
	>=dev-libs/uriparser-0.9.8
	dev-libs/uulib
	net-dns/libidn2:=
	sys-libs/ncurses:=
	virtual/zlib:=
	virtual/libiconv
	cancel-locks? ( >=net-libs/canlock-3.0:= )
	gpg? ( app-alternatives/gpg )
	nls? ( virtual/libintl )
	sasl? ( net-misc/gsasl[client] )
	socks5? ( net-proxy/dante )
	ssl? (
		gnutls? ( net-libs/gnutls:= )
		!gnutls? (
			libtls? ( dev-libs/libretls:= )
			!libtls? ( dev-libs/openssl:= )
		)
	)
"
DEPEND="${RDEPEND}"
BDEPEND="
	app-alternatives/yacc
	virtual/pkgconfig
	nls? ( sys-devel/gettext )
"

QA_CONFIG_IMPL_DECL_SKIP=(
	# Windows only (bug #900278)
	memset_s

	# checking if the socks library uses socks4 prefix
	Rinit
	init
)

DOCS=(
	README{,.MAC,.WIN}
	doc/{CHANGES{,.old},CREDITS,TODO,WHATSNEW,filtering}
)

PATCHES=(
	"${FILESDIR}/tin-2.6.5-fix-install_nls_man.patch"
)

src_configure() {
	tc-export AR CC RANLIB
	tc-export_build_env

	# The build incorrectly discards its local -I if $CPPFLAGS is set.
	if [[ -n ${BUILD_CPPFLAGS} ]]; then
		BUILD_CPPFLAGS+=' -I$(INCDIR)'
	fi

	local myeconfargs=(
		$(use_enable cancel-locks)
		$(use_with cancel-locks canlock)

		$(use_enable debug)
		$(use_enable gpg pgp-gpg)
		$(use_enable nls)
		$(use_with socks5)
		--disable-mime-strict-charset
		--enable-nntp
		--enable-prototypes
		--without-pcre
		--with-pcre2-config
		--with-coffee # easter egg :)
		--with-nntp-default-server="${TIN_DEFAULT_SERVER:-${NNTPSERVER:-news.gmane.io}}"
		--with-screen=ncursesw
	)

	if use ssl; then
		if use gnutls; then
			myeconfargs+=( --with-nntps=gnutls )
		elif use libtls; then
			myeconfargs+=( --with-nntps=libtls )
		else
			myeconfargs+=( --with-nntps=openssl )
		fi
	fi

	myeconfargs+=(
		# set default paths for utilities
		--with-editor="${EPREFIX}"/usr/libexec/editor
		--with-gpg="${EPREFIX}"/usr/bin/gpg
		--with-ispell="${EPREFIX}"/usr/bin/aspell
		--with-mailer="${EPREFIX}"/bin/mail

		# set default paths for directories
		--with-libdir="${EPREFIX}"/var/lib/news
		--with-spooldir="${EPREFIX}"/var/spool/news
	)

	econf "${myeconfargs[@]}"
}

src_compile() {
	# To build from the root dir you have to call `make build`, not just `make`.
	emake build
}

src_install() {
	default

	emake DESTDIR="${D}" install_sysdefs
	if use nls; then
		emake -C src DESTDIR="${D}" install_nls
		emake -C src DESTDIR="${D}" install_nls_man
	fi

	dodoc doc/{*.sample,*.txt}
}

pkg_postinst() {
	optfeature "spell checker support" app-text/aspell
}