summaryrefslogtreecommitdiff
blob: 7dffb0871c9ae745481661127a96c1dfb98d32b5 (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
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-misc/fortune-mod/fortune-mod-1.99.1.ebuild,v 1.2 2004/05/13 07:52:01 kumba Exp $

inherit eutils

DESCRIPTION="The notorious fortune program"
HOMEPAGE="http://www.redellipse.net/code/fortune/"
SRC_URI="http://www.redellipse.net/code/downloads/${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~x86 ~sparc ~mips"
IUSE="offensive"

DEPEND="virtual/glibc
	app-text/recode"

[ `use offensive` ] && off=1 || off=0

src_unpack() {
	unpack ${A}
	cd ${S}

	sed -i \
		-e 's:/games::' \
		-e 's:/fortunes:/fortune:' \
		-e 's:FORTDIR=$(prefix)/usr:FORTDIR=$(prefix)/usr/bin:' \
		-e "s:^CFLAGS=.*$:CFLAGS=\$(DEFINES) ${CFLAGS}:" \
		Makefile
	sed -i 's:char a, b;:short int a, b;:' util/rot.c

	# fixes the '-m' segfault problem on _my_ computer, it might screw something else up i don't know about.
	sed -i \
		'/if (fp->utf8_charset)/{
			N
			/free (output);/d
		}' fortune/fortune.c
}

src_compile() {
	emake \
		OFFENSIVE="${off}" \
		|| die
}

src_install() {
	make \
		OFFENSIVE="${off}" \
		prefix="${D}" \
		install \
		|| die

	dodoc ChangeLog INDEX INSTALL Notes Offensive README TODO cookie-files
}