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

Contents of /app-shells/bash/bash-4.2_p10.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Fri Sep 16 17:25:35 2011 UTC (20 months ago) by vapier
Branch: MAIN
Changes since 1.3: +3 -1 lines
Fix building when job controls are disabled (like when cross-compiling) #383237 by Maciej Grela.

(Portage version: 2.2.0_alpha58/cvs/Linux x86_64)

1 vapier 1.1 # Copyright 1999-2011 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 vapier 1.4 # $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.2_p10.ebuild,v 1.3 2011/08/11 02:23:47 vapier 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     READLINE_VER=6.1
17     READLINE_PLEVEL=0 # both readline patches are also released as bash patches
18     patches() {
19     local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
20     [[ ${plevel} -eq 0 ]] && return 1
21     eval set -- {1..${plevel}}
22     set -- $(printf "${pn}${pv/\.}-%03d " "$@")
23     if [[ ${opt} == -s ]] ; then
24     echo "${@/#/${DISTDIR}/}"
25     else
26     local u
27     for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
28     printf "${u}/${pn}-${pv}-patches/%s " "$@"
29     done
30     fi
31     }
32    
33     DESCRIPTION="The standard GNU Bourne again shell"
34     HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
35     SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)
36     $(patches ${READLINE_PLEVEL} readline ${READLINE_VER})"
37    
38     LICENSE="GPL-3"
39     SLOT="0"
40     KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
41     IUSE="afs bashlogger examples mem-scramble +net nls plugins vanilla"
42    
43     DEPEND=">=sys-libs/ncurses-5.2-r2
44     nls? ( virtual/libintl )"
45     RDEPEND="${DEPEND}
46     !<sys-apps/portage-2.1.7.16
47     !<sys-apps/paludis-0.26.0_alpha5"
48 vapier 1.3 # we only need yacc when the .y files get patched (bash42-005)
49     DEPEND+=" virtual/yacc"
50 vapier 1.1
51     S=${WORKDIR}/${MY_P}
52    
53     pkg_setup() {
54     if is-flag -malign-double ; then #7332
55     eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
56     eerror "as it breaks LFS (struct stat64) on x86."
57     die "remove -malign-double from your CFLAGS mr ricer"
58     fi
59     if use bashlogger ; then
60     ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
61     ewarn "This will log ALL output you enter into the shell, you have been warned."
62     fi
63     }
64    
65     src_unpack() {
66     unpack ${MY_P}.tar.gz
67     cd "${S}"
68    
69     # Include official patches
70     [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
71     cd lib/readline
72     [[ ${READLINE_PLEVEL} -gt 0 ]] && epatch $(patches -s ${READLINE_PLEVEL} readline ${READLINE_VER})
73     cd ../..
74 vapier 1.4
75     epatch "${FILESDIR}"/${PN}-4.2-execute-job-control.patch #383237
76 vapier 1.1 }
77    
78     src_compile() {
79     local myconf=
80    
81     # For descriptions of these, see config-top.h
82     # bashrc/#26952 bash_logout/#90488 ssh/#24762
83     append-cppflags \
84     -DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
85     -DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \
86     -DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
87     -DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
88     -DNON_INTERACTIVE_LOGIN_SHELLS \
89     -DSSH_SOURCE_BASHRC \
90     $(use bashlogger && echo -DSYSLOG_HISTORY)
91    
92     # Always use the buildin readline, else if we update readline
93     # bash gets borked as readline is usually not binary compadible
94     # between minor versions.
95     #myconf="${myconf} $(use_with !readline installed-readline)"
96     myconf="${myconf} --without-installed-readline"
97    
98     # Don't even think about building this statically without
99     # reading Bug 7714 first. If you still build it statically,
100     # don't come crying to us with bugs ;).
101     #use static && export LDFLAGS="${LDFLAGS} -static"
102     use nls || myconf="${myconf} --disable-nls"
103    
104     # Force linking with system curses ... the bundled termcap lib
105     # sucks bad compared to ncurses
106     myconf="${myconf} --with-curses"
107    
108     use plugins && append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
109     econf \
110     $(use_with afs) \
111     $(use_enable net net-redirections) \
112     --disable-profiling \
113     $(use_enable mem-scramble) \
114     $(use_with mem-scramble bash-malloc) \
115     ${myconf} || die
116     emake || die "make failed"
117    
118     if use plugins ; then
119     emake -C examples/loadables all others || die
120     fi
121     }
122    
123     src_install() {
124     emake install DESTDIR="${D}" || die
125    
126     dodir /bin
127     mv "${D}"/usr/bin/bash "${D}"/bin/ || die
128     dosym bash /bin/rbash
129    
130     insinto /etc/bash
131     doins "${FILESDIR}"/{bashrc,bash_logout}
132     insinto /etc/skel
133     for f in bash{_logout,_profile,rc} ; do
134     newins "${FILESDIR}"/dot-${f} .${f}
135     done
136    
137     sed -i -e "s:#${USERLAND}#@::" "${D}"/etc/skel/.bashrc "${D}"/etc/bash/bashrc
138     sed -i -e '/#@/d' "${D}"/etc/skel/.bashrc "${D}"/etc/bash/bashrc
139    
140     if use plugins ; then
141     exeinto /usr/$(get_libdir)/bash
142     doexe $(echo examples/loadables/*.o | sed 's:\.o::g') || die
143     fi
144    
145     if use examples ; then
146     for d in examples/{functions,misc,scripts,scripts.noah,scripts.v2} ; do
147     exeinto /usr/share/doc/${PF}/${d}
148     insinto /usr/share/doc/${PF}/${d}
149     for f in ${d}/* ; do
150     if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
151     doexe ${f}
152     else
153     doins ${f}
154     fi
155     done
156     done
157     fi
158    
159     doman doc/*.1
160     dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
161     dosym bash.info /usr/share/info/bashref.info
162     }
163    
164     pkg_preinst() {
165     if [[ -e ${ROOT}/etc/bashrc ]] && [[ ! -d ${ROOT}/etc/bash ]] ; then
166     mkdir -p "${ROOT}"/etc/bash
167     mv -f "${ROOT}"/etc/bashrc "${ROOT}"/etc/bash/
168     fi
169    
170     if [[ -L ${ROOT}/bin/sh ]]; then
171     # rewrite the symlink to ensure that its mtime changes. having /bin/sh
172     # missing even temporarily causes a fatal error with paludis.
173     local target=$(readlink "${ROOT}"/bin/sh)
174 nyhm 1.2 local tmp=$(emktemp "${ROOT}"/bin)
175     ln -sf "${target}" "${tmp}"
176     mv -f "${tmp}" "${ROOT}"/bin/sh
177 vapier 1.1 fi
178     }
179    
180     pkg_postinst() {
181     # If /bin/sh does not exist, provide it
182     if [[ ! -e ${ROOT}/bin/sh ]]; then
183     ln -sf bash "${ROOT}"/bin/sh
184     fi
185     }

  ViewVC Help
Powered by ViewVC 1.1.13