Magellan Linux

Contents of /smage/trunk/core/bash/bash-4.3-r7.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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