summaryrefslogtreecommitdiff
blob: a85a55d6dd7803231083d8a8bc3113bbf4fdf5a1 (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
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-irc/eiwic/eiwic-1.1.4.ebuild,v 1.5 2011/05/28 07:59:47 phajdan.jr Exp $

inherit autotools eutils multilib flag-o-matic

DESCRIPTION="A modular IRC bot written in C"
HOMEPAGE="https://github.com/lordi/Eiwic"
SRC_URI="mirror://gentoo/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="debug doc ipv6 rss"

DEPEND="rss? ( <media-libs/raptor-1.9.0 )"
RDEPEND="${DEPEND}"

src_unpack() {
	unpack ${A}
	cd "${S}"
	sed -i "/^set MODULE_PATH/s:modules:/usr/$(get_libdir)/eiwic:" sample.conf
	sed -i "/^load MODULE/s:$:.so:" sample.conf
	epatch "${FILESDIR}"/${PN}-1.1.3-ldflags.patch
	eautoreconf
}

src_compile() {
	econf \
		$(use_enable debug vv-debug) \
		$(use_enable ipv6)
	emake || die "emake failed"
}

src_install() {
	emake DESTDIR="${D}" install || die "install failed"
	dodoc AUTHORS ChangeLog README NEWS TODO sample.conf

	if use doc; then
		dohtml doc/*
	fi
}

pkg_postinst() {
	echo
	einfo "You need a configuration file to run eiwic"
	einfo "A sample configuration was installed to"
	einfo "/usr/share/doc/${PF}/"
	echo
	if use debug; then
		einfo "For debugging options please see eiwic -h"
		echo
	fi
}