/[gentoo-alt]/trunk/prefix-overlay/app-shells/bash/bash-3.0-r13.ebuild
Gentoo

Contents of /trunk/prefix-overlay/app-shells/bash/bash-3.0-r13.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 904 - (show annotations) (download)
Sun Nov 27 21:49:31 2005 UTC (9 years, 1 month ago) by kito
File size: 5106 byte(s)
PATH defaults to prefix, respect sysconfdir for init files.
1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-3.0-r13.ebuild,v 1.2 2005/10/20 16:51:39 flameeyes Exp $
4
5 EAPI="prefix"
6
7 inherit eutils flag-o-matic toolchain-funcs
8
9 # Official patchlevel
10 # See ftp://ftp.cwru.edu/pub/bash/bash-3.0-patches/
11 PLEVEL=16
12
13 DESCRIPTION="The standard GNU Bourne again shell"
14 HOMEPAGE="http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html"
15 # Hit the GNU mirrors before hitting Chet's site
16 SRC_URI="mirror://gnu/bash/${P}.tar.gz
17 ftp://ftp.cwru.edu/pub/bash/${P}.tar.gz
18 $(for ((i=1; i<=PLEVEL; i++)); do
19 printf 'ftp://ftp.cwru.edu/pub/bash/bash-%s-patches/bash%s-%03d\n' \
20 ${PV} ${PV/\.} ${i}
21 printf 'mirror://gnu/bash/bash-%s-patches/bash%s-%03d\n' \
22 ${PV} ${PV/\.} ${i}
23 done)"
24
25 LICENSE="GPL-2"
26 SLOT="0"
27 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc-macos ~ppc64 ~s390 ~sh ~sparc ~x86"
28 IUSE="afs nls build bashlogger unicode"
29
30 # we link statically with ncurses
31 DEPEND=">=sys-libs/ncurses-5.2-r2"
32 RDEPEND=""
33
34 src_unpack() {
35 unpack ${P}.tar.gz
36 cd ${S}
37 epatch "${FILESDIR}"/${P}-gentoo.patch
38
39 # Remove autoconf dependency
40 sed -i -e "/&& autoconf/d" Makefile.in
41
42 # Include official patches
43 local i
44 for ((i=1; i<=PLEVEL; i++)); do
45 epatch "${DISTDIR}"/${PN}${PV/\.}-$(printf '%03d' ${i})
46 done
47
48 # Fall back to /etc/inputrc
49 epatch "${FILESDIR}"/${P}-etc-inputrc.patch
50 # Fix network tests on Darwin #79124
51 epatch "${FILESDIR}"/${P}-darwin-conn.patch
52 # read patch headers for more info ... many ripped from Fedora/Debian/SuSe
53 for i in afs crash jobs manpage pwd read-e-segfault ulimit histtimeformat \
54 locale multibyteifs rl-display rl-self-insert
55 do
56 epatch "${FILESDIR}"/${P}-${i}.patch
57 done
58 # Hacks for bugs in unicode support #69407 #108936
59 if use unicode ; then
60 epatch "${FILESDIR}"/${P}-prompt.patch
61 epatch "${FILESDIR}"/${P}-utf8.patch
62 fi
63 # Fix read-builtin and the -u pipe option #87093
64 epatch "${FILESDIR}"/${P}-read-builtin-pipe.patch
65 # Don't barf on handled signals in scripts
66 epatch "${FILESDIR}"/${P}-trap-fg-signals.patch
67 # Fix a problem when using pipes and PGRP_PIPE #92349
68 epatch "${FILESDIR}"/${P}-pgrp-pipe-fix.patch
69 # Make sure static linking always works #100138
70 epatch "${FILESDIR}"/${P}-force-static-linking.patch
71 # Fix parallel builds #87247
72 epatch "${FILESDIR}"/${P}-parallel.patch
73 # Log bash commands to syslog #91327
74 if use bashlogger ; then
75 echo
76 ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
77 ewarn "This will log ALL output you enter into the shell, you have been warned."
78 ebeep
79 epause
80 epatch "${FILESDIR}"/${P}-bash-logger.patch
81 fi
82
83 epatch "${FILESDIR}"/${P}-configs.patch
84
85 # Add strnlen function for non-glibc systems, as one of Fedora's patches
86 # requires it.
87 epatch "${FILESDIR}"/${P}-strnlen.patch
88
89 epatch "${FILESDIR}"/${P}-pathnames.patch
90
91 sed -i 's:-lcurses:-lncurses:' configure || die "sed configure"
92
93 sed -i -e "s:\@PREFIX\@:${PREFIX}:g" config-top.h pathnames.h.in \
94 || die "sed failed."
95 }
96
97 src_compile() {
98 filter-flags -malign-double
99
100 local myconf=
101
102 # Always use the buildin readline, else if we update readline
103 # bash gets borked as readline is usually not binary compadible
104 # between minor versions.
105 #
106 # Martin Schlemmer <azarah@gentoo.org> (1 Sep 2002)
107 #use readline && myconf="--with-installed-readline"
108
109 # Don't even think about building this statically without
110 # reading Bug 7714 first. If you still build it statically,
111 # don't come crying to use with bugs ;).
112 #use static && export LDFLAGS="${LDFLAGS} -static"
113 use nls || myconf="${myconf} --disable-nls"
114
115 echo 'int main(){}' > "${T}"/term-test.c
116 if ! $(tc-getCC) -static -lncurses "${T}"/term-test.c 2> /dev/null ; then
117 export bash_cv_termcap_lib=gnutermcap
118 else
119 export bash_cv_termcap_lib=libcurses
120 myconf="${myconf} --with-ncurses"
121 fi
122
123 econf \
124 $(use_with afs) \
125 --disable-profiling \
126 --without-gnu-malloc \
127 ${myconf} || die
128 # Make sure we always link statically with ncurses
129 sed -i "/^TERMCAP_LIB/s:-lncurses:-Wl,-Bstatic -lncurses -Wl,-Bdynamic:" Makefile || die "sed failed"
130 emake -j1 || die "make failed" # see bug 102426
131 }
132
133 src_install() {
134 einstall || die
135
136 dodir /bin
137 mv "${D}"/usr/bin/bash "${D}"/bin/
138 [[ ${USERLAND} != "BSD" ]] && dosym bash /bin/sh
139 dosym bash /bin/rbash
140
141 insinto /etc/bash
142 doins "${FILESDIR}"/{bashrc,bash_logout}
143 insinto /etc/skel
144 for f in bash{_logout,_profile,rc} ; do
145 newins "${FILESDIR}"/dot-${f} .${f}
146 done
147
148 if use build ; then
149 rm -rf "${D}"/usr
150 else
151 doman doc/*.1
152 dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
153 dosym bash.info.gz /usr/share/info/bashref.info.gz
154 fi
155 }
156
157 pkg_preinst() {
158 if [[ -e ${ROOT}/etc/bashrc ]] && [[ ! -d ${ROOT}/etc/bash ]] ; then
159 mkdir -p "${ROOT}"/etc/bash
160 mv -f "${ROOT}"/etc/bashrc "${ROOT}"/etc/bash/
161 fi
162
163 # our bash_logout is just a place holder so dont
164 # force users to go through etc-update all the time
165 if [[ -e ${ROOT}/etc/bash/bash_logout ]] ; then
166 rm -f "${D}"/etc/bash/bash_logout
167 fi
168 }

  ViewVC Help
Powered by ViewVC 1.1.20