| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/games-misc/fortune-mod/fortune-mod-1.99.1-r2.ebuild,v 1.11 2012/03/03 11:42:59 grobian Exp $
|
| 4 |
|
| 5 |
EAPI=3
|
| 6 |
inherit eutils toolchain-funcs
|
| 7 |
|
| 8 |
DESCRIPTION="The notorious fortune program"
|
| 9 |
HOMEPAGE="http://www.redellipse.net/code/fortune"
|
| 10 |
SRC_URI="http://www.redellipse.net/code/downloads/${P}.tar.gz"
|
| 11 |
|
| 12 |
LICENSE="BSD"
|
| 13 |
SLOT="0"
|
| 14 |
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
|
| 15 |
IUSE="offensive elibc_glibc"
|
| 16 |
|
| 17 |
DEPEND="app-text/recode"
|
| 18 |
|
| 19 |
src_prepare() {
|
| 20 |
epatch "${FILESDIR}"/${P}-gentoo.patch \
|
| 21 |
"${FILESDIR}"/01_all_fortune_all-fix.patch
|
| 22 |
|
| 23 |
sed -i \
|
| 24 |
-e 's:/games::' \
|
| 25 |
-e 's:/fortunes:/fortune:' \
|
| 26 |
-e '/^FORTDIR=/s:=.*:=$(prefix)/usr/bin:' \
|
| 27 |
-e '/^all:/s:$: fortune/fortune.man:' \
|
| 28 |
-e "/^OFFENSIVE=/s:=.*:=`use offensive && echo 1 || echo 0`:" \
|
| 29 |
Makefile || die "sed Makefile failed"
|
| 30 |
|
| 31 |
if ! use elibc_glibc ; then
|
| 32 |
[[ ${CHOST} == *-*bsd* ]] && local reglibs="-lcompat"
|
| 33 |
[[ ${CHOST} == *-darwin* ]] && local reglibs="-lc"
|
| 34 |
has_version "app-text/recode[nls]" && reglibs="${reglibs} -lintl"
|
| 35 |
sed -i \
|
| 36 |
-e "/^REGEXLIBS=/s:=.*:= ${reglibs}:" \
|
| 37 |
Makefile \
|
| 38 |
|| die "sed REGEXLIBS failed"
|
| 39 |
fi
|
| 40 |
if [[ ${CHOST} == *-solaris* ]] ; then
|
| 41 |
sed -i -e 's:u_int:uint:g' util/strfile.h || die "sed strfile.h failed"
|
| 42 |
fi
|
| 43 |
if [[ ${CHOST} == *-darwin* ]] ; then
|
| 44 |
sed -i -e 's/-DBSD_REGEX/-DPOSIX_REGEX/' Makefile || die "sed Makefile failed"
|
| 45 |
fi
|
| 46 |
}
|
| 47 |
|
| 48 |
src_compile() {
|
| 49 |
local myrex=
|
| 50 |
[[ ${CHOST} == *-interix* ]] && myrex="REGEXDEFS=-DNO_REGEX"
|
| 51 |
emake prefix="${EPREFIX}" CC="$(tc-getCC)" $myrex || die "emake failed"
|
| 52 |
}
|
| 53 |
|
| 54 |
src_install() {
|
| 55 |
emake prefix="${ED}" install || die "emake install failed"
|
| 56 |
dodoc ChangeLog INDEX Notes Offensive README TODO cookie-files
|
| 57 |
}
|