Magellan Linux

Annotation of /smage/branches/alx07x-stable/core/bash/bash-5.0-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 14930 - (hide annotations) (download)
Thu Aug 6 12:51:20 2020 UTC (3 years, 9 months ago) by niro
File size: 4085 byte(s)
-release branches/alx07x-stable
1 niro 13900 # $Id$
2    
3     PNAME="bash"
4     PVER="5.0"
5     PBUILD="r2"
6    
7     PATCH_LEVEL="17"
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-6.2"
15     SDEPEND=">= sys-libs/ncurses-dev-6.2"
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     )
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     # enable SSH_SOURCE_BASHRC
72     sed -i 's:^.*\(#define SSH_SOURCE_BASHRC\).*$:\1:' config-top.h || die
73    
74     # location of the default mail directory
75     # (not using config-top.h but config.h.in to suppress annoying warnings)
76     sed -i 's:^\(#define DEFAULT_MAIL_DIRECTORY\).*:\1 "/usr/spool/mail":' config.h.in || die
77    
78     # run the startup files
79     echo '#define NON_INTERACTIVE_LOGIN_SHELLS' >> config-top.h || die
80    
81     # location of system-wide bashrc
82     echo '#define SYS_BASHRC "/etc/bash/bashrc"' >> config-top.h || die
83    
84     # location of system-wide bash_logout
85     echo '#define SYS_BASH_LOGOUT "/etc/bash/bash_logout"' >> config-top.h || die
86    
87     # Force pgrp synchronization
88     # (https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653)
89     #
90     # The session will hang cases where you 'su' (not 'su -') and
91     # then run a piped command in emacs.
92     # This problem seem to happen due to scheduler changes kernel
93     # side - although reproduceble with later 2.4 kernels, it is
94     # especially easy with 2.6 kernels.
95     echo '#define PGRP_PIPE 1' >> config-bot.h || die
96     }
97    
98     src_compile()
99     {
100     cd ${SRCDIR}
101    
102     mconfigure \
103     --disable-profiling \
104     --with-curses \
105     --without-gnu-malloc \
106     || die
107    
108     # on x86_64 parallel is broken; patch not work
109     mmake -j1 || die
110     }
111    
112     alx_generic_src_install()
113     {
114     cd ${SRCDIR}
115     make DESTDIR=${BINDIR} install || die
116    
117     # some needed symlinks
118     mlink bash /usr/bin/sh || die
119     mlink bash /usr/bin/rbash || die
120    
121     # install skeletons
122     for i in bashrc bash_profile bash_logout
123     do
124     minstalletc dot.${i} .${i} /etc/skel || die
125     done
126    
127     # install global rcs
128     minstalletc bashrc bashrc /etc/bash || die
129     minstalletc bash_logout bash_logout /etc/bash || die
130    
131     # alx only - added some aliases to fix broken output of systemd with its internal pager and busybox
132     local i
133     for i in /etc/skel/.bashrc /etc/bash/bashrc
134     do
135     echo 'alias systemctl="systemctl --no-pager"' >> ${BINDIR}/${i}
136     echo 'alias journalctl="journalctl --no-pager"' >> ${BINDIR}/${i}
137     done
138    
139     minstalldocs ABOUT-NLS AUTHORS CHANGES COMPAT COPYING MANIFEST \
140     NEWS NOTES POSIX RBASH README || die
141     }
142    
143     preinstall()
144     {
145     add_conf_prot_mask /etc/skel /etc/bash
146     }
147    
148     postinstall()
149     {
150     # install skeletons for root, as bash is our default shell
151     if [[ ! -f ${MROOT}/root/.bashrc ]]
152     then
153     install -m0644 ${MROOT}/etc/skel/.bashrc ${MROOT}/root
154     fi
155     if [[ ! -f ${MROOT}/root/.bash_profile ]]
156     then
157     install -m0644 ${MROOT}/etc/skel/.bash_profile ${MROOT}/root
158     fi
159     if [[ ! -f ${MROOT}/root/.bash_logout ]]
160     then
161     install -m0644 ${MROOT}/etc/skel/.bash_logout ${MROOT}/root
162     fi
163     }