/[gentoo-x86]/app-shells/bash/bash-4.2_p24-r1.ebuild
Gentoo

Contents of /app-shells/bash/bash-4.2_p24-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Wed May 23 01:13:17 2012 UTC (11 months, 4 weeks ago) by zmedico
Branch: MAIN
Changes since 1.2: +2 -2 lines
Adjust the portage blocker from bug #297933 to play nicely with portage-2.1.6.7_p1 (which has a backported fix for this bug). This should not hurt people upgrading from later portage-2.1.6.x or 2.1.7.x releases, since the message about BASHOPTS being readonly is only cosmetic.

(Portage version: 2.2.0_alpha107/cvs/Linux i686)

1 vapier 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 zmedico 1.3 # $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.2_p24-r1.ebuild,v 1.2 2012/04/26 13:22:12 aballier Exp $
4 vapier 1.1
5     EAPI="1"
6    
7     inherit eutils flag-o-matic toolchain-funcs multilib
8    
9     # Official patchlevel
10     # See ftp://ftp.cwru.edu/pub/bash/bash-4.2-patches/
11     PLEVEL=${PV##*_p}
12     MY_PV=${PV/_p*}
13     MY_PV=${MY_PV/_/-}
14     MY_P=${PN}-${MY_PV}
15     [[ ${PV} != *_p* ]] && PLEVEL=0
16     patches() {
17     local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
18     [[ ${plevel} -eq 0 ]] && return 1
19     eval set -- {1..${plevel}}
20     set -- $(printf "${pn}${pv/\.}-%03d " "$@")
21     if [[ ${opt} == -s ]] ; then
22     echo "${@/#/${DISTDIR}/}"
23     else
24     local u
25     for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
26     printf "${u}/${pn}-${pv}-patches/%s " "$@"
27     done
28     fi
29     }
30    
31     DESCRIPTION="The standard GNU Bourne again shell"
32     HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
33     SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
34    
35     LICENSE="GPL-3"
36     SLOT="0"
37 aballier 1.2 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
38 vapier 1.1 IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline vanilla"
39    
40     DEPEND=">=sys-libs/ncurses-5.2-r2
41     readline? ( >=sys-libs/readline-6.2 )
42     nls? ( virtual/libintl )"
43     RDEPEND="${DEPEND}
44 zmedico 1.3 !<sys-apps/portage-2.1.6.7_p1
45 vapier 1.1 !<sys-apps/paludis-0.26.0_alpha5"
46     # we only need yacc when the .y files get patched (bash42-005)
47     DEPEND+=" virtual/yacc"
48    
49     S=${WORKDIR}/${MY_P}
50    
51     pkg_setup() {
52     if is-flag -malign-double ; then #7332
53     eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
54     eerror "as it breaks LFS (struct stat64) on x86."
55     die "remove -malign-double from your CFLAGS mr ricer"
56     fi
57     if use bashlogger ; then
58     ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
59     ewarn "This will log ALL output you enter into the shell, you have been warned."
60     fi
61     }
62    
63     src_unpack() {
64     unpack ${MY_P}.tar.gz
65     cd "${S}"
66    
67     # Include official patches
68     [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
69    
70     # Clean out local libs so we know we use system ones
71     rm -rf lib/{readline,termcap}/*
72     touch lib/{readline,termcap}/Makefile.in # for config.status
73     sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
74    
75     # Avoid regenerating docs after patches #407985
76     sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
77     touch -r . doc/*
78    
79     epatch "${FILESDIR}"/${PN}-4.2-execute-job-control.patch #383237
80     epatch "${FILESDIR}"/${PN}-4.2-parallel-build.patch
81     epatch "${FILESDIR}"/${PN}-4.2-no-readline.patch
82     epatch "${FILESDIR}"/${PN}-4.2-extglob-multibyte.patch #412867
83     }
84    
85     src_compile() {
86     local myconf=
87    
88     # For descriptions of these, see config-top.h
89     # bashrc/#26952 bash_logout/#90488 ssh/#24762
90     append-cppflags \
91     -DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
92     -DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \
93     -DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
94     -DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
95     -DNON_INTERACTIVE_LOGIN_SHELLS \
96     -DSSH_SOURCE_BASHRC \
97     $(use bashlogger && echo -DSYSLOG_HISTORY)
98    
99     # Don't even think about building this statically without
100     # reading Bug 7714 first. If you still build it statically,
101     # don't come crying to us with bugs ;).
102     #use static && export LDFLAGS="${LDFLAGS} -static"
103     use nls || myconf="${myconf} --disable-nls"
104    
105     # Historically, we always used the builtin readline, but since
106     # our handling of SONAME upgrades has gotten much more stable
107     # in the PM (and the readline ebuild itself preserves the old
108     # libs during upgrades), linking against the system copy should
109     # be safe.
110     # Exact cached version here doesn't really matter as long as it
111     # is at least what's in the DEPEND up above.
112     export ac_cv_rl_version=6.2
113    
114     # Force linking with system curses ... the bundled termcap lib
115     # sucks bad compared to ncurses. For the most part, ncurses
116     # is here because readline needs it. But bash itself calls
117     # ncurses in one or two small places :(.
118    
119     use plugins && append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
120     econf \
121     --with-installed-readline=. \
122     --with-curses \
123     $(use_with afs) \
124     $(use_enable net net-redirections) \
125     --disable-profiling \
126     $(use_enable mem-scramble) \
127     $(use_with mem-scramble bash-malloc) \
128     $(use_enable readline) \
129     $(use_enable readline history) \
130     $(use_enable readline bang-history) \
131     ${myconf}
132     emake || die
133    
134     if use plugins ; then
135     emake -C examples/loadables all others || die
136     fi
137     }
138    
139     src_install() {
140     emake install DESTDIR="${D}" || die
141    
142     dodir /bin
143     mv "${D}"/usr/bin/bash "${D}"/bin/ || die
144     dosym bash /bin/rbash
145    
146     insinto /etc/bash
147     doins "${FILESDIR}"/{bashrc,bash_logout}
148     insinto /etc/skel
149     for f in bash{_logout,_profile,rc} ; do
150     newins "${FILESDIR}"/dot-${f} .${f}
151     done
152    
153     sed -i -e "s:#${USERLAND}#@::" "${D}"/etc/skel/.bashrc "${D}"/etc/bash/bashrc
154     sed -i -e '/#@/d' "${D}"/etc/skel/.bashrc "${D}"/etc/bash/bashrc
155    
156     if use plugins ; then
157     exeinto /usr/$(get_libdir)/bash
158     doexe $(echo examples/loadables/*.o | sed 's:\.o::g') || die
159     fi
160    
161     if use examples ; then
162     for d in examples/{functions,misc,scripts,scripts.noah,scripts.v2} ; do
163     exeinto /usr/share/doc/${PF}/${d}
164     insinto /usr/share/doc/${PF}/${d}
165     for f in ${d}/* ; do
166     if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
167     doexe ${f}
168     else
169     doins ${f}
170     fi
171     done
172     done
173     fi
174    
175     doman doc/*.1
176     dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
177     dosym bash.info /usr/share/info/bashref.info
178     }
179    
180     pkg_preinst() {
181     if [[ -e ${ROOT}/etc/bashrc ]] && [[ ! -d ${ROOT}/etc/bash ]] ; then
182     mkdir -p "${ROOT}"/etc/bash
183     mv -f "${ROOT}"/etc/bashrc "${ROOT}"/etc/bash/
184     fi
185    
186     if [[ -L ${ROOT}/bin/sh ]]; then
187     # rewrite the symlink to ensure that its mtime changes. having /bin/sh
188     # missing even temporarily causes a fatal error with paludis.
189     local target=$(readlink "${ROOT}"/bin/sh)
190     local tmp=$(emktemp "${ROOT}"/bin)
191     ln -sf "${target}" "${tmp}"
192     mv -f "${tmp}" "${ROOT}"/bin/sh
193     fi
194     }
195    
196     pkg_postinst() {
197     # If /bin/sh does not exist, provide it
198     if [[ ! -e ${ROOT}/bin/sh ]]; then
199     ln -sf bash "${ROOT}"/bin/sh
200     fi
201     }

  ViewVC Help
Powered by ViewVC 1.1.13