1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 inherit eutils toolchain-funcs
7 DESCRIPTION="The notorious fortune program"
8 HOMEPAGE="http://www.redellipse.net/code/fortune"
9 SRC_URI="http://www.redellipse.net/code/downloads/${P}.tar.gz"
13 KEYWORDS="~alpha amd64 arm ~arm64 hppa m68k ~mips ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
14 IUSE="offensive elibc_glibc"
16 DEPEND="app-text/recode"
20 epatch "${FILESDIR}"/${P}-gentoo.patch \
21 "${FILESDIR}"/01_all_fortune_all-fix.patch
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"
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"
36 -e "/^REGEXLIBS=/s:=.*:= ${reglibs}:" \
38 || die "sed REGEXLIBS failed"
40 if [[ ${CHOST} == *-solaris* ]] ; then
41 sed -i -e 's:u_int:uint:g' util/strfile.h || die "sed strfile.h failed"
43 if [[ ${CHOST} == *-darwin* ]] ; then
44 sed -i -e 's/-DBSD_REGEX/-DPOSIX_REGEX/' Makefile || die "sed Makefile failed"
50 [[ ${CHOST} == *-interix* ]] && myrex="REGEXDEFS=-DNO_REGEX"
51 emake prefix="${EPREFIX}" CC="$(tc-getCC)" $myrex
55 emake prefix="${ED}" install
56 dodoc ChangeLog INDEX Notes Offensive README TODO cookie-files