summaryrefslogtreecommitdiff
blob: 249855e4b6661a51eeaa3ed0671bcd24f115d3ec (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
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-news/inn/inn-2.3.5.ebuild,v 1.10 2004/06/25 00:25:29 agriffis Exp $

DESCRIPTION="The Internet News daemon, fully featured NNTP server"
HOMEPAGE="http://www.isc.org/products/INN"
SRC_URI="ftp://ftp.isc.org/isc/inn/${P}.tar.gz
	mirror://gentoo/${P}-gentoo.tar.gz"

LICENSE="as-is BSD"
SLOT="0"
KEYWORDS="x86"
IUSE="ssl tcltk"

RDEPEND="app-crypt/gnupg
	virtual/mta
	tcltk? ( dev-lang/tcl )
	ssl? ( dev-libs/openssl )"
DEPEND="${RDEPEND}
	>=sys-apps/sed-4"

src_unpack() {
	unpack ${A}
	cd ${S}
	sed -i \
		-e 's/\$(P) //' site/Makefile storage/Makefile \
			|| die "sed failed"
}

src_compile() {
	./configure \
		--prefix=/usr/lib/news \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--with-etc-dir=/etc/news \
		--with-db-dir=/var/spool/news/db \
		--with-spool-dir=/var/spool/news \
		--with-log-dir=/var/log/news \
		--with-run-dir=/var/run/news \
		--with-tmp-path=/var/spool/news/tmp \
		--host=${CHOST}  \
		--enable-libtool \
		--enable-setgid-inews \
		--enable-uucp-rnews \
		--with-python \
		--without-perl \
		`use_with tcltk tcl` \
		`use_with ssl openssl` \
			|| die "configure died"

	emake -j1 || die "emake failed"
}

src_install() {
	make prefix=${D}/usr/lib/news \
		PATHETC=${D}/etc/news \
		PATHMAN=${D}/usr/share/man \
		PATHLIB=${D}/usr/lib/news/lib \
		PATHCONTROL=${D}/usr/lib/news/bin/control \
		PATHFILTER=${D}/usr/lib/news/bin/filter \
		PATHRUN=${D}/var/run/news \
		PATHLOG=${D}/var/log/news \
		PATHDB=${D}/var/spool/news/db \
		PATHSPOOL=${D}/var/spool/news \
		PATHTMP=${D}/var/spool/news/tmp \
		MAN1=${D}/usr/share/man/man1 \
		MAN3=${D}/usr/share/man/man3 \
		MAN5=${D}/usr/share/man/man5 \
		MAN8=${D}/usr/share/man/man8 \
			install || die "make install failed"

	keepdir \
		/var/spool/news/tmp/ \
		/var/spool/news/outgoing/ \
		/var/spool/news/overview/ \
		/var/spool/news/innfeed/ \
		/var/spool/news/articles/ \
		/var/spool/news/incoming/bad/ \
		/var/spool/news/archive/ \
		/var/run/news/ \
		/var/log/news/

	dodoc CONTRIBUTORS ChangeLog HACKING HISTORY INSTALL LICENSE \
		MANIFEST NEWS README* doc/control-messages doc/sample-control

# So other programs can build against INN.  (eg. Suck)
	insinto /usr/lib/news/include
	doins include/*.h

	exeinto /etc/init.d
	newexe ${FILESDIR}/innd innd

	cd ${WORKDIR}
	doman send-uucp.pl.8.gz
	insinto /etc/news
	doins send-uucp.cf
	exeinto /usr/lib/news/bin
	newexe send-uucp.pl send-uucp.pl
}

pkg_postinst() {
	chown news:news ${ROOT}/etc/news/send-uucp.cf
	chown news:news ${ROOT}/usr/lib/news/bin/send-uucp.pl
	chown -R news:news ${ROOT}/var/spool/news
	chown -R news:news ${ROOT}/var/log/news/

	einfo 'Do not forget to update your cron entries, and also run'
	einfo 'makedbz if you need to.  If this is a first-time installation'
	einfo 'a minimal active file has been installed.  You will need to'
	einfo 'touch history and run "makedbz -i" to initialize the history'
	einfo 'database.  See INSTALL for more information.'
	einfo ''
	einfo 'You need to assign a real shell to the news user, or else'
	einfo 'starting inn will fail. You can use "usermod -s /bin/bash news"'
	einfo 'for this.'
}