summaryrefslogtreecommitdiff
blob: 6b5a308bbf186e36727972a474ae2fa91b2accc6 (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
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6

inherit readme.gentoo-r1 toolchain-funcs

DESCRIPTION="UNIX compatible IRC bot programmed in the C language"
HOMEPAGE="http://www.energymech.net/"
SRC_URI="http://www.energymech.net/files/${P/_/}.tar.gz"
S="${WORKDIR}/${P/_/}"

LICENSE="GPL-2"
SLOT="0"
IUSE="debug session tcl"
KEYWORDS="amd64 ppc x86"

RDEPEND="virtual/libcrypt:="
DEPEND="${RDEPEND}"

DOC_CONTENTS="You can find a compressed sample config file at /usr/share/doc/${PF}"

src_prepare() {
	eapply "${FILESDIR}/${P}-buildfix.patch"

	sed -i \
		-e 's: "help/":"/usr/share/energymech/help/":' \
		-e 's: "messages/":"/usr/share/energymech/messages/":' \
		src/config.h.in || die
	# Respect CFLAGS and LDFLAGS
	sed -i \
		-e '/^LFLAGS/s/\$(PIPEFLAG)/\0 \$(OPTIMIZE) \$(LDFLAGS)/' \
		-e '/^GDBFLAG/d' \
		-e '/^PIPEFLAG/d' \
		src/Makefile.in || die

	eapply_user
}

myconf() {
	tc-export CC
	echo ./configure $*
	./configure $* || die "./configure failed"
}

src_configure() {
	myconf \
		--with-alias \
		--with-botnet \
		--with-bounce \
		--with-ctcp \
		--with-dccfile \
		--with-dynamode \
		--with-dyncmd \
		--with-greet \
		--with-ircd_ext \
		--with-md5 \
		--with-newbie \
		--with-note \
		--with-notify \
		--with-rawdns \
		--with-seen \
		--with-stats \
		--with-telnet \
		--with-toybox \
		--with-trivia \
		--without-uptime \
		--with-web \
		--with-wingate \
		--without-profiling \
		--without-redirect \
		$(use_with tcl) \
		$(use_with session) \
		$(use_with debug)
}

src_compile() {
	emake -C src CC="$(tc-getCC)" OPTIMIZE="${CFLAGS}"
}

src_install() {
	dobin src/energymech

	insinto /usr/share/energymech
	doins -r help

	insinto /usr/share/energymech/messages
	doins messages/*.txt

	dodoc sample.* README* TODO VERSIONS CREDITS checkmech
	readme.gentoo_create_doc
}