1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils flag-o-matic autotools prefix
12 DESCRIPTION="Enhanced version of the Berkeley C shell (csh)"
13 HOMEPAGE="http://www.tcsh.org/"
14 SRC_URI="ftp://ftp.astron.com/pub/tcsh/old/${MY_P}.tar.gz
15 https://www.gentoo.org/~grobian/distfiles/tcsh-gentoo-patches-r${CONFVER}.tar.bz2"
19 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"
23 # we need gettext because we run autoconf (AM_ICONV)
24 RDEPEND=">=sys-libs/ncurses-5.1
28 doc? ( dev-lang/perl )"
31 CONFDIR=${WORKDIR}/tcsh-gentoo-patches-r${CONFVER}
34 epatch "${FILESDIR}/${MY_P/17/14}"-debian-dircolors.patch # bug #120792
35 epatch "${FILESDIR}"/${PN}-6.14-makefile.patch # bug #151951
36 epatch "${FILESDIR}"/${PN}-6.14-use-ncurses.patch
39 if use catalogs ; then
40 einfo "enabling NLS catalogs support..."
41 sed -i -e "s/#undef NLS_CATALOGS/#define NLS_CATALOGS/" \
46 # unify ECHO behaviour
47 echo "#undef ECHO_STYLE" >> config_f.h
48 echo "#define ECHO_STYLE BOTH_ECHO" >> config_f.h
50 eprefixify "${CONFDIR}"/*
51 # activate the right default PATH
52 if [[ -z ${EPREFIX} ]] ; then
54 -e 's/^#MAIN//' -e '/^#PREFIX/d' \
55 "${CONFDIR}"/csh.login || die
58 -e 's/^#PREFIX//' -e '/^#MAIN/d' \
59 "${CONFDIR}"/csh.login || die
64 # make tcsh look and live along the lines of the prefix
65 append-flags -D_PATH_DOTCSHRC="'"'"${EPREFIX}/etc/csh.cshrc"'"'"
66 append-flags -D_PATH_DOTLOGIN="'"'"${EPREFIX}/etc/csh.login"'"'"
67 append-flags -D_PATH_DOTLOGOUT="'"'"${EPREFIX}/etc/csh.logout"'"'"
68 append-flags -D_PATH_USRBIN="'"'"${EPREFIX}/usr/bin"'"'"
69 append-flags -D_PATH_BIN="'"'"${EPREFIX}/bin"'"'"
72 --prefix="${EPREFIX:-/}" \
73 --datarootdir='${prefix}/usr/share'
77 emake DESTDIR="${D}" install install.man || die
80 perl tcsh.man2html tcsh.man || die
81 dohtml tcsh.html/*.html
86 "${CONFDIR}"/csh.cshrc \
87 "${CONFDIR}"/csh.login
89 dodoc FAQ Fixes NewThings Ported README WishList Y2K
91 # bug #119703: add csh -> tcsh symlink
92 dosym /bin/tcsh /bin/csh