/[gentoo-x86]/app-shells/bash/bash-3.2_p51.ebuild
Gentoo

Diff of /app-shells/bash/bash-3.2_p51.ebuild

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.5 Revision 1.6
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2013 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-3.2_p51.ebuild,v 1.5 2012/11/19 22:26:11 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-3.2_p51.ebuild,v 1.6 2013/12/22 13:42:06 vapier Exp $
4 4
5EAPI=1 5EAPI="4"
6 6
7inherit eutils flag-o-matic toolchain-funcs multilib 7inherit eutils flag-o-matic toolchain-funcs
8 8
9# Official patchlevel 9# Official patchlevel
10# See ftp://ftp.cwru.edu/pub/bash/bash-3.2-patches/ 10# See ftp://ftp.cwru.edu/pub/bash/bash-3.2-patches/
11PLEVEL=${PV##*_p} 11PLEVEL=${PV##*_p}
12MY_PV=${PV/_p*} 12MY_PV=${PV/_p*}
13MY_PV=${MY_PV/_/-}
13MY_P=${PN}-${MY_PV} 14MY_P=${PN}-${MY_PV}
14READLINE_VER=5.2 15[[ ${PV} != *_p* ]] && PLEVEL=0
15READLINE_PLEVEL=0 # both readline patches are also released as bash patches 16patches() {
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}
16 30
17DESCRIPTION="The standard GNU Bourne again shell" 31DESCRIPTION="The standard GNU Bourne again shell"
18HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html" 32HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
19SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz 33SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
20 ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz
21 $(for ((i=1; i<=PLEVEL; i++)); do
22 printf 'ftp://ftp.cwru.edu/pub/bash/bash-%s-patches/bash%s-%03d\n' \
23 ${MY_PV} ${MY_PV/\.} ${i}
24 printf 'mirror://gnu/bash/bash-%s-patches/bash%s-%03d\n' \
25 ${MY_PV} ${MY_PV/\.} ${i}
26 done)
27 $(for ((i=1; i<=READLINE_PLEVEL; i++)); do
28 printf 'ftp://ftp.cwru.edu/pub/bash/readline-%s-patches/readline%s-%03d\n' \
29 ${READLINE_VER} ${READLINE_VER/\.} ${i}
30 printf 'mirror://gnu/bash/readline-%s-patches/readline%s-%03d\n' \
31 ${READLINE_VER} ${READLINE_VER/\.} ${i}
32 done)"
33 34
34LICENSE="GPL-2" 35LICENSE="GPL-2"
35SLOT="0" 36SLOT="${MY_PV}"
36KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" 37KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
37IUSE="afs bashlogger +net nls plugins vanilla" 38IUSE="afs +net nls +readline"
38 39
39DEPEND=">=sys-libs/ncurses-5.2-r2 40DEPEND=">=sys-libs/ncurses-5.2-r2
41 readline? ( >=sys-libs/readline-6.2 )
40 nls? ( virtual/libintl )" 42 nls? ( virtual/libintl )"
41RDEPEND="${DEPEND} 43RDEPEND="${DEPEND}"
42 !<sys-apps/portage-2.1.5
43 !<sys-apps/paludis-0.26.0_alpha5"
44 44
45S=${WORKDIR}/${MY_P} 45S=${WORKDIR}/${MY_P}
46 46
47pkg_setup() { 47pkg_setup() {
48 if is-flag -malign-double ; then #7332 48 if is-flag -malign-double ; then #7332
52 fi 52 fi
53} 53}
54 54
55src_unpack() { 55src_unpack() {
56 unpack ${MY_P}.tar.gz 56 unpack ${MY_P}.tar.gz
57 cd "${S}"
58
59 # Include official patches
60 local i
61 for ((i=1; i<=PLEVEL; i++)); do
62 epatch "${DISTDIR}"/${PN}${MY_PV/\.}-$(printf '%03d' ${i})
63 done
64 cd lib/readline
65 for ((i=1; i<=READLINE_PLEVEL; i++)); do
66 epatch "${DISTDIR}"/readline${READLINE_VER/\.}-$(printf '%03d' ${i})
67 done
68 cd ../..
69
70 if ! use vanilla ; then
71 epatch "${FILESDIR}"/autoconf-mktime-2.59.patch #220040
72 epatch "${FILESDIR}"/${PN}-3.1-gentoo.patch
73 epatch "${FILESDIR}"/${PN}-3.2-loadables.patch
74 epatch "${FILESDIR}"/${PN}-3.2-protos.patch
75 epatch "${FILESDIR}"/${PN}-3.2-session-leader.patch #231775
76 epatch "${FILESDIR}"/${PN}-3.2-parallel-build.patch #189671
77 epatch "${FILESDIR}"/${PN}-3.2-ldflags-for-build.patch #211947
78
79 # Fix process substitution on BSD.
80 epatch "${FILESDIR}"/${PN}-3.2-process-subst.patch
81
82 epatch "${FILESDIR}"/${PN}-3.2-ulimit.patch
83 # Don't barf on handled signals in scripts
84 epatch "${FILESDIR}"/${PN}-3.0-trap-fg-signals.patch
85 epatch "${FILESDIR}"/${PN}-3.2-dev-fd-test-as-user.patch #131875
86 # Log bash commands to syslog #91327
87 if use bashlogger ; then
88 echo
89 ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
90 ewarn "This will log ALL output you enter into the shell, you have been warned."
91 ebeep
92 epause
93 epatch "${FILESDIR}"/${PN}-3.1-bash-logger.patch
94 fi
95 fi
96
97 epatch "${FILESDIR}"/${PN}-3.0-configs.patch
98} 57}
99 58
100src_compile() { 59src_prepare() {
101 local myconf= 60 # Include official patches
61 [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
102 62
103 # Always use the buildin readline, else if we update readline 63 # Clean out local libs so we know we use system ones
104 # bash gets borked as readline is usually not binary compadible 64 rm -rf lib/{readline,termcap}/*
105 # between minor versions. 65 touch lib/{readline,termcap}/Makefile.in # for config.status
106 #myconf="${myconf} $(use_with !readline installed-readline)" 66 sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
107 myconf="${myconf} --without-installed-readline" 67
68 epatch "${FILESDIR}"/autoconf-mktime-2.59.patch #220040
69 epatch "${FILESDIR}"/${PN}-3.1-gentoo.patch
70 epatch "${FILESDIR}"/${PN}-3.2-loadables.patch
71 epatch "${FILESDIR}"/${PN}-3.2-protos.patch
72 epatch "${FILESDIR}"/${PN}-3.2-session-leader.patch #231775
73 epatch "${FILESDIR}"/${PN}-3.2-parallel-build.patch #189671
74 epatch "${FILESDIR}"/${PN}-3.2-ldflags-for-build.patch #211947
75 epatch "${FILESDIR}"/${PN}-3.2-process-subst.patch
76 epatch "${FILESDIR}"/${PN}-3.2-ulimit.patch
77 epatch "${FILESDIR}"/${PN}-3.0-trap-fg-signals.patch
78 epatch "${FILESDIR}"/${PN}-3.2-dev-fd-test-as-user.patch #131875
79
80 epatch_user
81}
82
83src_configure() {
84 local myconf=()
85
86 # Force pgrp synchronization
87 # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653
88 export bash_cv_pgrp_pipe=yes
89
90 # For descriptions of these, see config-top.h
91 # bashrc/#26952 bash_logout/#90488 ssh/#24762
92 append-cppflags \
93 -DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
94 -DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \
95 -DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
96 -DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
97 -DNON_INTERACTIVE_LOGIN_SHELLS \
98 -DSSH_SOURCE_BASHRC
108 99
109 # Don't even think about building this statically without 100 # Don't even think about building this statically without
110 # reading Bug 7714 first. If you still build it statically, 101 # reading Bug 7714 first. If you still build it statically,
111 # don't come crying to use with bugs ;). 102 # don't come crying to us with bugs ;).
112 #use static && export LDFLAGS="${LDFLAGS} -static" 103 #use static && export LDFLAGS="${LDFLAGS} -static"
113 use nls || myconf="${myconf} --disable-nls" 104 use nls || myconf+=( --disable-nls )
105
106 # Historically, we always used the builtin readline, but since
107 # our handling of SONAME upgrades has gotten much more stable
108 # in the PM (and the readline ebuild itself preserves the old
109 # libs during upgrades), linking against the system copy should
110 # be safe.
111 # Exact cached version here doesn't really matter as long as it
112 # is at least what's in the DEPEND up above.
113 export ac_cv_rl_version=6.2
114 114
115 # Force linking with system curses ... the bundled termcap lib 115 # Force linking with system curses ... the bundled termcap lib
116 # sucks bad compared to ncurses 116 # sucks bad compared to ncurses. For the most part, ncurses
117 myconf="${myconf} --with-curses" 117 # is here because readline needs it. But bash itself calls
118 # ncurses in one or two small places :(.
118 119
119 # Default path is to use /usr/local/..... regardless. This little 120 tc-export AR #444070
120 # magic will set the default path to /usr/..... and keep us from
121 # worrying about the rest of the path getting out of sync with the
122 # ebuild code.
123 eval $(echo export $(ac_default_prefix=/usr; eval echo $(grep DEBUGGER_START_FILE= configure)))
124
125 use plugins && append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
126 econf \ 121 econf \
122 --with-installed-readline=. \
123 --with-curses \
127 $(use_with afs) \ 124 $(use_with afs) \
128 $(use_enable net net-redirections) \ 125 $(use_enable net net-redirections) \
129 --disable-profiling \ 126 --disable-profiling \
130 --without-gnu-malloc \ 127 --without-gnu-malloc \
131 ${myconf} || die 128 $(use_enable readline) \
132 emake || die "make failed" 129 $(use_enable readline history) \
133 130 $(use_enable readline bang-history) \
134 if use plugins ; then 131 "${myconf[@]}"
135 emake -C examples/loadables all others || die
136 fi
137} 132}
138 133
139src_install() { 134src_install() {
140 emake install DESTDIR="${D}" || die 135 into /
136 newbin bash bash-${SLOT}
141 137
142 dodir /bin 138 newman doc/bash.1 bash-${SLOT}.1
143 mv "${D}"/usr/bin/bash "${D}"/bin/ || die 139 newman doc/builtins.1 builtins-${SLOT}.1
144 dosym bash /bin/rbash
145 140
146 insinto /etc/bash 141 insinto /usr/share/info
147 doins "${FILESDIR}"/{bashrc,bash_logout} 142 newins doc/bashref.info bash-${SLOT}.info
148 insinto /etc/skel 143 dosym bash-${SLOT}.info /usr/share/info/bashref-${SLOT}.info
149 for f in bash{_logout,_profile,rc} ; do
150 newins "${FILESDIR}"/dot-${f} .${f}
151 done
152 144
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 doman doc/*.1
162 dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO 145 dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
163 dosym bash.info /usr/share/info/bashref.info
164} 146}
165
166pkg_preinst() {
167 if [[ -e ${ROOT}/etc/bashrc ]] && [[ ! -d ${ROOT}/etc/bash ]] ; then
168 mkdir -p "${ROOT}"/etc/bash
169 mv -f "${ROOT}"/etc/bashrc "${ROOT}"/etc/bash/
170 fi
171
172 if [[ -L ${ROOT}/bin/sh ]]; then
173 # rewrite the symlink to ensure that its mtime changes. having /bin/sh
174 # missing even temporarily causes a fatal error with paludis.
175 local target=$(readlink "${ROOT}"/bin/sh)
176 local tmp=$(emktemp "${ROOT}"/bin)
177 ln -sf "${target}" "${tmp}"
178 mv -f "${tmp}" "${ROOT}"/bin/sh
179 fi
180}
181
182pkg_postinst() {
183 # If /bin/sh does not exist, provide it
184 if [[ ! -e ${ROOT}/bin/sh ]]; then
185 ln -sf bash "${ROOT}"/bin/sh
186 fi
187}

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.20