Use https by default
[gentoo.git] / app-shells / tcsh / tcsh-6.18.01.ebuild
1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="3"
6
7 inherit eutils flag-o-matic autotools prefix
8
9 CONFVER="1.9"
10
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"
15
16 LICENSE="BSD"
17 SLOT="0"
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"
19 IUSE="nls doc"
20 RESTRICT="test"
21
22 # we need gettext because we run autoconf (AM_ICONV)
23 RDEPEND=">=sys-libs/ncurses-5.1
24         virtual/libiconv"
25 DEPEND="${RDEPEND}
26         sys-devel/gettext
27         doc? ( dev-lang/perl )"
28
29 CONFDIR=${WORKDIR}/tcsh-gentoo-patches-r${CONFVER}
30
31 src_prepare() {
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
35         eautoreconf
36
37         # fix gencat usage
38         sed -i -e 's/cat \$\^ \$> | \$(GENCAT) \$@/rm -f $@; $(GENCAT) $@ $> $^/' \
39                 nls/Makefile.in || die
40
41         # unify ECHO behaviour
42         echo "#undef ECHO_STYLE" >> config_f.h
43         echo "#define ECHO_STYLE      BOTH_ECHO" >> config_f.h
44
45         eprefixify "${CONFDIR}"/*
46         # activate the right default PATH
47         if [[ -z ${EPREFIX} ]] ; then
48                 sed -i \
49                         -e 's/^#MAIN//' -e '/^#PREFIX/d' \
50                         "${CONFDIR}"/csh.login || die
51         else
52                 sed -i \
53                         -e 's/^#PREFIX//' -e '/^#MAIN/d' \
54                         "${CONFDIR}"/csh.login || die
55         fi
56 }
57
58 src_configure() {
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"'"'"
65
66         econf \
67                 --prefix="${EPREFIX:-/}" \
68                 --datarootdir='${prefix}/usr/share' \
69                 $(use_enable nls)
70 }
71
72 src_install() {
73         emake DESTDIR="${D}" install install.man || die
74
75         if use doc ; then
76                 perl tcsh.man2html tcsh.man || die
77                 dohtml tcsh.html/*.html
78         fi
79
80         insinto /etc
81         doins \
82                 "${CONFDIR}"/csh.cshrc \
83                 "${CONFDIR}"/csh.login
84
85         dodoc FAQ Fixes NewThings Ported README WishList Y2K
86
87         # bug #119703: add csh -> tcsh symlink
88         dosym /bin/tcsh /bin/csh
89 }