Magellan Linux

Annotation of /branches/R11-stable/core/bash/bash-4.2-r9.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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