1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils flag-o-matic autotools prefix
11 DESCRIPTION="Enhanced version of the Berkeley C shell (csh)"
12 HOMEPAGE="http://www.tcsh.org/"
13 SRC_URI="ftp://ftp.astron.com/pub/tcsh/${P}.tar.gz
14 https://www.gentoo.org/~grobian/distfiles/tcsh-gentoo-patches-r${CONFVER}.tar.bz2"
18 KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
22 # we need gettext because we run autoconf (AM_ICONV)
23 RDEPEND=">=sys-libs/ncurses-5.1
27 doc? ( dev-lang/perl )"
29 CONFDIR=${WORKDIR}/tcsh-gentoo-patches-r${CONFVER}
32 epatch "${FILESDIR}"/${PN}-6.14.00-debian-dircolors.patch # bug #120792
33 epatch "${FILESDIR}"/${PN}-6.14-makefile.patch # bug #151951
34 epatch "${FILESDIR}"/${PN}-6.14-use-ncurses.patch
38 sed -i -e 's/cat \$\^ \$> | \$(GENCAT) \$@/rm -f $@; $(GENCAT) $@ $> $^/' \
39 nls/Makefile.in || die
41 # unify ECHO behaviour
42 echo "#undef ECHO_STYLE" >> config_f.h
43 echo "#define ECHO_STYLE BOTH_ECHO" >> config_f.h
45 eprefixify "${CONFDIR}"/*
46 # activate the right default PATH
47 if [[ -z ${EPREFIX} ]] ; then
49 -e 's/^#MAIN//' -e '/^#PREFIX/d' \
50 "${CONFDIR}"/csh.login || die
53 -e 's/^#PREFIX//' -e '/^#MAIN/d' \
54 "${CONFDIR}"/csh.login || die
59 # make tcsh look and live along the lines of the prefix
60 append-cppflags -D_PATH_DOTCSHRC="'"'"${EPREFIX}/etc/csh.cshrc"'"'"
61 append-cppflags -D_PATH_DOTLOGIN="'"'"${EPREFIX}/etc/csh.login"'"'"
62 append-cppflags -D_PATH_DOTLOGOUT="'"'"${EPREFIX}/etc/csh.logout"'"'"
63 append-cppflags -D_PATH_USRBIN="'"'"${EPREFIX}/usr/bin"'"'"
64 append-cppflags -D_PATH_BIN="'"'"${EPREFIX}/bin"'"'"
67 --prefix="${EPREFIX:-/}" \
68 --datarootdir='${prefix}/usr/share' \
73 emake DESTDIR="${D}" install install.man || die
76 perl tcsh.man2html tcsh.man || die
77 dohtml tcsh.html/*.html
82 "${CONFDIR}"/csh.cshrc \
83 "${CONFDIR}"/csh.login
85 dodoc FAQ Fixes NewThings Ported README WishList Y2K
87 # bug #119703: add csh -> tcsh symlink
88 dosym /bin/tcsh /bin/csh