# Copyright 1999-2001 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # $Header: /home/anoncvs/gentoo-x86/app-games/fortune-mod/fortune-mod-9708.ebuild,v 1.5 2002/07/17 20:37:32 bass Exp $ S=${WORKDIR}/${P} DESCRIPTION="The notorious fortune program." SRC_URI="http://www.ibiblio.org/pub/Linux/games/amusements/fortune/${P}.tar.gz" #For lack of a better one. HOMEPAGE="http://www.ibiblio.org/pub/Linux/games/amusements/fortune/fortune-mod-9708.README" LICENSE="" SLOT="0" DEPEND="virtual/glibc" KEYWORDS="x86 ppc" #Turn offensive fortunes off by default, set equal to "1" #if you want to be offended. offensive= src_compile() { cp Makefile Makefile.orig if [ "$offensive" == "1" ]; then #Note the mixture of single and double quotes below is by design #Set install locations in System location for the compile. sed \ -e "s:\(FORTDIR=/usr/\).*:\1bin:" \ -e "s:\(COOKIEDIR=/usr/\)local/\(share\).*:\1\2/fortune:" \ -e "s:\(BINDIR=/usr/\)local/\(bin\).*:\1\2:" \ -e "s:\(BINMANDIR=/usr/\)local/\(man/man1\).*:\1share/\2:" \ -e "s:\(FORTMANDIR=/usr/\)local/\(man/man6\).*:\1share/\2:" \ -e 's:\(CFLAGS=\)-O2 \($(DEFINES)\).*:'"\1${CFLAGS} \2:" \ Makefile.orig > Makefile else sed \ -e "s:\(FORTDIR=/usr/\).*:\1bin:" \ -e "s:\(COOKIEDIR=/usr/\)local/\(share\).*:\1\2/fortune:" \ -e "s:\(BINDIR=/usr/\)local/\(bin\).*:\1\2:" \ -e "s:\(BINMANDIR=/usr/\)local/\(man/man1\).*:\1share/\2:" \ -e "s:\(FORTMANDIR=/usr/\)local/\(man/man6\).*:\1share/\2:" \ -e "s:\(OFFENSIVE=\)1.*:\1$offensive:" \ -e 's:\(CFLAGS=\)-O2 \($(DEFINES)\).*:'"\1${CFLAGS} \2:" \ Makefile.orig > Makefile fi emake || die } src_install () { if [ "$offensive" == "1" ]; then #Install into portage image directory ${D}. sed \ -e "s:\(FORTDIR=\)\(/usr/\).*:\1${D}\2bin:" \ -e "s:\(COOKIEDIR=\)\(/usr/\)local/\(share\).*:\1${D}\2\3/fortune:" \ -e "s:\(BINDIR=\)\(/usr/\)local/\(bin\).*:\1${D}\2\3:" \ -e "s:\(BINMANDIR=\)\(/usr/\)local/\(man/man1\).*:\1${D}\2share/\3:" \ -e "s:\(FORTMANDIR=\)\(/usr/\)local/\(man/man6\).*:\1${D}\2share/\3:" \ Makefile.orig > Makefile else sed \ -e "s:\(FORTDIR=\)\(/usr/\).*:\1${D}\2bin:" \ -e "s:\(COOKIEDIR=\)\(/usr/\)local/\(share\).*:\1${D}\2\3/fortune:" \ -e "s:\(BINDIR=\)\(/usr/\)local/\(bin\).*:\1${D}\2\3:" \ -e "s:\(BINMANDIR=\)\(/usr/\)local/\(man/man1\).*:\1${D}\2share/\3:" \ -e "s:\(FORTMANDIR=\)\(/usr/\)local/\(man/man6\).*:\1${D}\2share/\3:" \ -e "s:\(OFFENSIVE=\)1.*:\1$offensive:" \ Makefile.orig > Makefile fi make install || die dodoc ChangeLog INDEX INSTALL Notes README TODO }