/[gentoo-x86]/app-shells/bash/bash-4.0_p38.ebuild
Gentoo

Diff of /app-shells/bash/bash-4.0_p38.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-4.0_p38.ebuild,v 1.5 2012/11/19 22:26:11 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.0_p38.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-4.0-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}
14[[ ${PV} != *_p* ]] && PLEVEL=0 15[[ ${PV} != *_p* ]] && PLEVEL=0
15READLINE_VER=6.0
16READLINE_PLEVEL=0 # both readline patches are also released as bash patches
17patches() { 16patches() {
18 local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}} 17 local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
19 [[ ${plevel} -eq 0 ]] && return 1 18 [[ ${plevel} -eq 0 ]] && return 1
20 eval set -- {1..${plevel}} 19 eval set -- {1..${plevel}}
21 set -- $(printf "${pn}${pv/\.}-%03d " "$@") 20 set -- $(printf "${pn}${pv/\.}-%03d " "$@")
29 fi 28 fi
30} 29}
31 30
32DESCRIPTION="The standard GNU Bourne again shell" 31DESCRIPTION="The standard GNU Bourne again shell"
33HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html" 32HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
34SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches) 33SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
35 $(patches ${READLINE_PLEVEL} readline ${READLINE_VER})"
36 34
37LICENSE="GPL-3" 35LICENSE="GPL-3"
38SLOT="0" 36SLOT="${MY_PV}"
39KEYWORDS="~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"
40IUSE="afs bashlogger mem-scramble +net nls plugins vanilla" 38IUSE="afs mem-scramble +net nls +readline"
41 39
42DEPEND=">=sys-libs/ncurses-5.2-r2 40DEPEND=">=sys-libs/ncurses-5.2-r2
41 readline? ( >=sys-libs/readline-6.2 )
43 nls? ( virtual/libintl )" 42 nls? ( virtual/libintl )"
44RDEPEND="${DEPEND} 43RDEPEND="${DEPEND}"
45 !<sys-apps/portage-2.1.5
46 !<sys-apps/paludis-0.26.0_alpha5"
47 44
48S=${WORKDIR}/${MY_P} 45S=${WORKDIR}/${MY_P}
49 46
50pkg_setup() { 47pkg_setup() {
51 if is-flag -malign-double ; then #7332 48 if is-flag -malign-double ; then #7332
55 fi 52 fi
56} 53}
57 54
58src_unpack() { 55src_unpack() {
59 unpack ${MY_P}.tar.gz 56 unpack ${MY_P}.tar.gz
60 cd "${S}" 57}
61 58
59src_prepare() {
62 # Include official patches 60 # Include official patches
63 [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s) 61 [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
64 cd lib/readline 62
65 [[ ${READLINE_PLEVEL} -gt 0 ]] && epatch $(patches -s ${READLINE_PLEVEL} readline ${READLINE_VER}) 63 # Clean out local libs so we know we use system ones
66 cd ../.. 64 rm -rf lib/{readline,termcap}/*
65 touch lib/{readline,termcap}/Makefile.in # for config.status
66 sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
67 67
68 epatch "${FILESDIR}"/${PN}-4.0-configure.patch #304901 68 epatch "${FILESDIR}"/${PN}-4.0-configure.patch #304901
69 epatch "${FILESDIR}"/${PN}-4.x-deferred-heredocs.patch 69 epatch "${FILESDIR}"/${PN}-4.x-deferred-heredocs.patch
70 sed -i '1i#define NEED_FPURGE_DECL' execute_cmd.c # needs fpurge() decl
71 epatch "${FILESDIR}"/${PN}-3.2-parallel-build.patch #189671
72 epatch "${FILESDIR}"/${PN}-4.0-ldflags-for-build.patch #211947
73 epatch "${FILESDIR}"/${PN}-4.0-negative-return.patch
74 epatch "${FILESDIR}"/${PN}-4.0-parallel-build.patch #267613
75 sed -i '/\.o: .*shell\.h/s:$: pathnames.h:' Makefile.in #267613
70 76
71 if ! use vanilla ; then 77 epatch_user
72 sed -i '1i#define NEED_FPURGE_DECL' execute_cmd.c # needs fpurge() decl
73 epatch "${FILESDIR}"/${PN}-3.2-parallel-build.patch #189671
74 epatch "${FILESDIR}"/${PN}-4.0-ldflags-for-build.patch #211947
75 epatch "${FILESDIR}"/${PN}-4.0-negative-return.patch
76 epatch "${FILESDIR}"/${PN}-4.0-parallel-build.patch #267613
77 # Log bash commands to syslog #91327
78 if use bashlogger ; then
79 ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
80 ewarn "This will log ALL output you enter into the shell, you have been warned."
81 ebeep
82 epause
83 epatch "${FILESDIR}"/${PN}-3.1-bash-logger.patch
84 fi
85 sed -i '/\.o: .*shell\.h/s:$: pathnames.h:' Makefile.in #267613
86 fi
87} 78}
88 79
89src_compile() { 80src_configure() {
90 local myconf= 81 local myconf=()
91 82
92 # For descriptions of these, see config-top.h 83 # For descriptions of these, see config-top.h
93 # bashrc/#26952 bash_logout/#90488 ssh/#24762 84 # bashrc/#26952 bash_logout/#90488 ssh/#24762
94 append-cppflags \ 85 append-cppflags \
95 -DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \ 86 -DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
97 -DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \ 88 -DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
98 -DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \ 89 -DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
99 -DNON_INTERACTIVE_LOGIN_SHELLS \ 90 -DNON_INTERACTIVE_LOGIN_SHELLS \
100 -DSSH_SOURCE_BASHRC 91 -DSSH_SOURCE_BASHRC
101 92
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 #myconf="${myconf} $(use_with !readline installed-readline)"
106 myconf="${myconf} --without-installed-readline"
107
108 # Don't even think about building this statically without 93 # Don't even think about building this statically without
109 # reading Bug 7714 first. If you still build it statically, 94 # reading Bug 7714 first. If you still build it statically,
110 # don't come crying to us with bugs ;). 95 # don't come crying to us with bugs ;).
111 #use static && export LDFLAGS="${LDFLAGS} -static" 96 #use static && export LDFLAGS="${LDFLAGS} -static"
112 use nls || myconf="${myconf} --disable-nls" 97 use nls || myconf+=( --disable-nls )
98
99 # Historically, we always used the builtin readline, but since
100 # our handling of SONAME upgrades has gotten much more stable
101 # in the PM (and the readline ebuild itself preserves the old
102 # libs during upgrades), linking against the system copy should
103 # be safe.
104 # Exact cached version here doesn't really matter as long as it
105 # is at least what's in the DEPEND up above.
106 export ac_cv_rl_version=6.2
113 107
114 # Force linking with system curses ... the bundled termcap lib 108 # Force linking with system curses ... the bundled termcap lib
115 # sucks bad compared to ncurses 109 # sucks bad compared to ncurses. For the most part, ncurses
116 myconf="${myconf} --with-curses" 110 # is here because readline needs it. But bash itself calls
111 # ncurses in one or two small places :(.
117 112
118 use plugins && append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash 113 tc-export AR #444070
119 econf \ 114 econf \
115 --with-installed-readline=. \
116 --with-curses \
120 $(use_with afs) \ 117 $(use_with afs) \
121 $(use_enable net net-redirections) \ 118 $(use_enable net net-redirections) \
122 --disable-profiling \ 119 --disable-profiling \
123 $(use_enable mem-scramble) \ 120 $(use_enable mem-scramble) \
124 $(use_with mem-scramble bash-malloc) \ 121 $(use_with mem-scramble bash-malloc) \
125 ${myconf} || die 122 $(use_enable readline) \
126 emake || die "make failed" 123 $(use_enable readline history) \
127 124 $(use_enable readline bang-history) \
128 if use plugins ; then 125 "${myconf[@]}"
129 emake -C examples/loadables all others || die
130 fi
131} 126}
132 127
133src_install() { 128src_install() {
134 emake install DESTDIR="${D}" || die 129 into /
130 newbin bash bash-${SLOT}
135 131
136 dodir /bin 132 newman doc/bash.1 bash-${SLOT}.1
137 mv "${D}"/usr/bin/bash "${D}"/bin/ || die 133 newman doc/builtins.1 builtins-${SLOT}.1
138 dosym bash /bin/rbash
139 134
140 insinto /etc/bash 135 insinto /usr/share/info
141 doins "${FILESDIR}"/{bashrc,bash_logout} 136 newins doc/bashref.info bash-${SLOT}.info
142 insinto /etc/skel 137 dosym bash-${SLOT}.info /usr/share/info/bashref-${SLOT}.info
143 for f in bash{_logout,_profile,rc} ; do
144 newins "${FILESDIR}"/dot-${f} .${f}
145 done
146 138
147 sed -i -e "s:#${USERLAND}#@::" "${D}"/etc/skel/.bashrc "${D}"/etc/bash/bashrc
148 sed -i -e '/#@/d' "${D}"/etc/skel/.bashrc "${D}"/etc/bash/bashrc
149
150 if use plugins ; then
151 exeinto /usr/$(get_libdir)/bash
152 doexe $(echo examples/loadables/*.o | sed 's:\.o::g') || die
153 fi
154
155 doman doc/*.1
156 dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO 139 dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
157 dosym bash.info /usr/share/info/bashref.info
158} 140}
159
160pkg_preinst() {
161 if [[ -e ${ROOT}/etc/bashrc ]] && [[ ! -d ${ROOT}/etc/bash ]] ; then
162 mkdir -p "${ROOT}"/etc/bash
163 mv -f "${ROOT}"/etc/bashrc "${ROOT}"/etc/bash/
164 fi
165
166 if [[ -L ${ROOT}/bin/sh ]]; then
167 # rewrite the symlink to ensure that its mtime changes. having /bin/sh
168 # missing even temporarily causes a fatal error with paludis.
169 local target=$(readlink "${ROOT}"/bin/sh)
170 local tmp=$(emktemp "${ROOT}"/bin)
171 ln -sf "${target}" "${tmp}"
172 mv -f "${tmp}" "${ROOT}"/bin/sh
173 fi
174}
175
176pkg_postinst() {
177 # If /bin/sh does not exist, provide it
178 if [[ ! -e ${ROOT}/bin/sh ]]; then
179 ln -sf bash "${ROOT}"/bin/sh
180 fi
181}

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

  ViewVC Help
Powered by ViewVC 1.1.20