Magellan Linux

Contents of /smage/trunk/core/bash/bash-4.2-r4.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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