aboutsummaryrefslogtreecommitdiffstats
path: root/net-irc/ircu/ircu-2.10.12.12.ebuild
blob: 2b4f9f187450c5372f7bbe5a09e71b5c777864ae (plain) (blame)
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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils flag-o-matic

DESCRIPTION="Undernet IRC Server Development"
HOMEPAGE="http://coder-com.undernet.org/"
SRC_URI="mirror://sourceforge/undernet-ircu/${PN}${PVR}.tar.gz"
S="${WORKDIR}/${PN}${PVR}"

LICENSE="GPL-1"
SLOT="0"
KEYWORDS="~x86 ~amd64"

IUSE="debug"

src_compile() {
	# by more gentle by setting the max connections
	# than the configure script by unternet
	MAXFD=$(ulimit -Sn)
	MAXCON=${IRCD_MAX_CONNECTIONS:-$(($MAXFD-4))}

	if [ -z "${IRCD_MAX_CONNECTIONS}" ]; then
		ewarn "This ircd will allow ${MAXCON} connections."
		ewarn "You could change this by setting IRCD_MAX_CONNECTIONS in you make.conf."
	fi

	econf \
		--with-symlink=ircu-ircd \
		--with-dpath=/etc/ircu \
		--with-cpath=/etc/ircu/ircd.conf \
		--with-lpath=/var/log/ircu/ircu.log \
		--with-maxcon=${MAXCON} \
		$(use_enable debug) \
		|| die "econf failed"
	emake || die "emake failed"
}

src_install() {
	newbin ircd/ircd ircu-ircd || die "newbin failed"
	newman doc/ircd.8 ircu-ircd.8 || die "newman failed"

	insinto /etc/ircu
	newins doc/example.conf ircd.conf.sample || die "doins failed"

	newinitd ${FILESDIR}/ircu.init.d ircu || die "newinitd failed"
	newconfd ${FILESDIR}/ircu.conf.d ircu || die "newconfd failed"

	keepdir /var/log/ircu

	dodoc \
		INSTALL* LICENSE README* RELEASE.NOTES doc/readme.* \
		doc/p10.html doc/features.txt doc/Authors \
		|| die "dodoc failed"
}

pkg_postinst() {
	enewuser ircu
	chown ircu ${ROOT}/var/log/ircu

	elog
	elog "A sample config file can be found at /etc/ircu/ircd.conf.sample"
	elog
}