Use https by default
[gentoo.git] / app-shells / tcsh / tcsh-6.17-r1.ebuild
1 # Copyright 1999-2012 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.8"
10
11 MY_P="${P}.00"
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"
16
17 LICENSE="BSD"
18 SLOT="0"
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"
20 IUSE="catalogs doc"
21 RESTRICT="test"
22
23 # we need gettext because we run autoconf (AM_ICONV)
24 RDEPEND=">=sys-libs/ncurses-5.1
25         virtual/libiconv"
26 DEPEND="${RDEPEND}
27         sys-devel/gettext
28         doc? ( dev-lang/perl )"
29
30 S=${WORKDIR}/${MY_P}
31 CONFDIR=${WORKDIR}/tcsh-gentoo-patches-r${CONFVER}
32
33 src_prepare() {
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
37         eautoreconf
38
39         if use catalogs ; then
40                 einfo "enabling NLS catalogs support..."
41                 sed -i -e "s/#undef NLS_CATALOGS/#define NLS_CATALOGS/" \
42                         config_f.h || die
43                 eend $?
44         fi
45
46         # unify ECHO behaviour
47         echo "#undef ECHO_STYLE" >> config_f.h
48         echo "#define ECHO_STYLE      BOTH_ECHO" >> config_f.h
49
50         eprefixify "${CONFDIR}"/*
51         # activate the right default PATH
52         if [[ -z ${EPREFIX} ]] ; then
53                 sed -i \
54                         -e 's/^#MAIN//' -e '/^#PREFIX/d' \
55                         "${CONFDIR}"/csh.login || die
56         else
57                 sed -i \
58                         -e 's/^#PREFIX//' -e '/^#MAIN/d' \
59                         "${CONFDIR}"/csh.login || die
60         fi
61 }
62
63 src_configure() {
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"'"'"
70
71         econf \
72                 --prefix="${EPREFIX:-/}" \
73                 --datarootdir='${prefix}/usr/share'
74 }
75
76 src_install() {
77         emake DESTDIR="${D}" install install.man || die
78
79         if use doc ; then
80                 perl tcsh.man2html tcsh.man || die
81                 dohtml tcsh.html/*.html
82         fi
83
84         insinto /etc
85         doins \
86                 "${CONFDIR}"/csh.cshrc \
87                 "${CONFDIR}"/csh.login
88
89         dodoc FAQ Fixes NewThings Ported README WishList Y2K
90
91         # bug #119703: add csh -> tcsh symlink
92         dosym /bin/tcsh /bin/csh
93 }