Contents of /branches/R11-stable/core/bash/bash-4.3-r2.smage2
Parent Directory | Revision Log
Revision 21327 -
(show annotations)
(download)
Thu Jun 12 07:54:28 2014 UTC (10 years, 3 months ago) by niro
Original Path: trunk/core/bash/bash-4.3-r2.smage2
File size: 3877 byte(s)
Thu Jun 12 07:54:28 2014 UTC (10 years, 3 months ago) by niro
Original Path: trunk/core/bash/bash-4.3-r2.smage2
File size: 3877 byte(s)
-fixed missing readline dependency
1 | # $Id$ |
2 | |
3 | PNAME="bash" |
4 | PVER="4.3" |
5 | PBUILD="r2" |
6 | |
7 | PATCH_LEVEL="18" |
8 | |
9 | PCAT="app-shells" |
10 | |
11 | DESCRIPTION="The standard GNU Bourne again shell." |
12 | HOMEPAGE="http://www.gnu.org/software/bash/bash.html" |
13 | |
14 | DEPEND=">= sys-libs/ncurses-5.9 |
15 | >= sys-libs/readline-6.3" |
16 | |
17 | SRCFILE="${PNAME}-${PVER}.tar.gz" |
18 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
19 | |
20 | sminclude mtools |
21 | |
22 | SRC_URI=( |
23 | gnu://${PNAME}/${SRCFILE} |
24 | mirror://${PNAME}/${SRCFILE} |
25 | mirror://${PNAME}/dot.bashrc |
26 | mirror://${PNAME}/dot.bash_profile |
27 | mirror://${PNAME}/dot.bash_logout |
28 | mirror://${PNAME}/bashrc |
29 | mirror://${PNAME}/bash_logout |
30 | $(for ((i=1;i <= PATCH_LEVEL; i++)) |
31 | do |
32 | ver=00${i} |
33 | [[ ${i} -ge 10 ]] && ver=0${i} |
34 | [[ ${i} -ge 100 ]] && ver=${i} |
35 | echo "gnu://${PNAME}/${PNAME}-${PVER}-patches/${PNAME}${PVER/./}-${ver}" |
36 | echo "mirror://${PNAME}/${PNAME}${PVER/./}-${ver}" |
37 | done) |
38 | mirror://${PNAME}/${PNAME}-3.0-parallel-build.patch |
39 | mirror://${PNAME}/${PNAME}-3.0-trap-fg-signals.patch |
40 | mirror://${PNAME}/${PNAME}-${PVER}-fix-setuid.patch |
41 | ) |
42 | |
43 | [[ ! -z ${PATCH_LEVEL} ]] && UP2PVER="${PVER}.${PATCH_LEVEL}" |
44 | UP2DATE="updatecmd_gnu ${PNAME} gz" |
45 | |
46 | src_prepare() |
47 | { |
48 | munpack ${SRCFILE} || die |
49 | cd ${SRCDIR} |
50 | |
51 | # apply all upstream patches |
52 | local i |
53 | local ver |
54 | for ((i=1; i <= PATCH_LEVEL; i++)) |
55 | do |
56 | ver=00${i} |
57 | [[ ${i} -ge 10 ]] && ver=0${i} |
58 | [[ ${i} -ge 100 ]] && ver=${i} |
59 | |
60 | mpatch ${PNAME}${PVER/./}-${ver} || die |
61 | done |
62 | |
63 | # fix parallel make |
64 | mpatch ${PNAME}-3.0-parallel-build.patch || die |
65 | |
66 | # other redhat patches: |
67 | |
68 | # don't barf on handled signals in scripts |
69 | mpatch ${PNAME}-3.0-trap-fg-signals.patch || die |
70 | |
71 | # security fix |
72 | # see: http://hmarco.org/bugs/bash_4.3-setuid-bug.html |
73 | mpatch ${PNAME}-${PVER}-fix-setuid.patch || die |
74 | |
75 | # enable SSH_SOURCE_BASHRC |
76 | sed -i 's:^.*\(#define SSH_SOURCE_BASHRC\).*$:\1:' config-top.h || die |
77 | |
78 | # location of the default mail directory |
79 | # (not using config-top.h but config.h.in to suppress annoying warnings) |
80 | sed -i 's:^\(#define DEFAULT_MAIL_DIRECTORY\).*:\1 "/usr/spool/mail":' config.h.in || die |
81 | |
82 | # run the startup files |
83 | echo '#define NON_INTERACTIVE_LOGIN_SHELLS' >> config-top.h || die |
84 | |
85 | # location of system-wide bashrc |
86 | echo '#define SYS_BASHRC "/etc/bash/bashrc"' >> config-top.h || die |
87 | |
88 | # location of system-wide bash_logout |
89 | echo '#define SYS_BASH_LOGOUT "/etc/bash/bash_logout"' >> config-top.h || die |
90 | |
91 | # Force pgrp synchronization |
92 | # (https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653) |
93 | # |
94 | # The session will hang cases where you 'su' (not 'su -') and |
95 | # then run a piped command in emacs. |
96 | # This problem seem to happen due to scheduler changes kernel |
97 | # side - although reproduceble with later 2.4 kernels, it is |
98 | # especially easy with 2.6 kernels. |
99 | echo '#define PGRP_PIPE 1' >> config-bot.h || die |
100 | } |
101 | |
102 | src_compile() |
103 | { |
104 | cd ${SRCDIR} |
105 | |
106 | mconfigure \ |
107 | --disable-profiling \ |
108 | --enable-readline \ |
109 | --with-curses \ |
110 | --without-gnu-malloc \ |
111 | --with-installed-readline \ |
112 | || die |
113 | |
114 | # on x86_64 parallel is broken; patch not work |
115 | mmake -j1 || die |
116 | } |
117 | |
118 | src_install() |
119 | { |
120 | cd ${SRCDIR} |
121 | make DESTDIR=${BINDIR} install || die |
122 | |
123 | # some needed symlinks |
124 | mlink bash /usr/bin/sh || die |
125 | mlink bash /usr/bin/rbash || die |
126 | |
127 | # install skeletons |
128 | for i in bashrc bash_profile bash_logout |
129 | do |
130 | minstalletc dot.${i} .${i} /etc/skel || die |
131 | done |
132 | |
133 | # install global rcs |
134 | minstalletc bashrc bashrc /etc/bash || die |
135 | minstalletc bash_logout bash_logout /etc/bash || die |
136 | |
137 | minstalldocs ABOUT-NLS AUTHORS CHANGES COMPAT COPYING MANIFEST \ |
138 | NEWS NOTES POSIX RBASH README || die |
139 | } |
140 | |
141 | postinstall() |
142 | { |
143 | # install skeletons for root, as bash is our default shell |
144 | if [[ ! -f ${MROOT}/root/.bashrc ]] |
145 | then |
146 | install -m0644 ${MROOT}/etc/skel/.bashrc ${MROOT}/root |
147 | fi |
148 | if [[ ! -f ${MROOT}/root/.bash_profile ]] |
149 | then |
150 | install -m0644 ${MROOT}/etc/skel/.bash_profile ${MROOT}/root |
151 | fi |
152 | if [[ ! -f ${MROOT}/root/.bash_logout ]] |
153 | then |
154 | install -m0644 ${MROOT}/etc/skel/.bash_logout ${MROOT}/root |
155 | fi |
156 | } |