Contents of /smage/branches/alx-0_6_0/core/bash/bash-4.2-r1.smage2
Parent Directory | Revision Log
Revision 2051 -
(show annotations)
(download)
Wed May 11 20:56:33 2011 UTC (13 years ago) by niro
File size: 3785 byte(s)
Wed May 11 20:56:33 2011 UTC (13 years ago) by niro
File size: 3785 byte(s)
-use alx-split_postinstall
1 | # $Id$ |
2 | |
3 | PNAME="bash" |
4 | PVER="4.2" |
5 | PBUILD="r1" |
6 | |
7 | PATCH_LEVEL="5" |
8 | |
9 | PCATEGORIE="app-shells" |
10 | STATE="unstable" |
11 | |
12 | DESCRIPTION="The standard GNU Bourne again shell." |
13 | HOMEPAGE="http://www.gnu.org/software/bash/bash.html" |
14 | |
15 | DEPEND=">= sys-libs/ncurses-5.8" |
16 | |
17 | SRCFILE="${PNAME}-${PVER}.tar.gz" |
18 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
19 | |
20 | REMOVE_DEPRECATED_MAGE_TARGETS=1 |
21 | ALX_ONLY_KEEP="bin/bash bin/sh etc/*" |
22 | sminclude mtools alx-split |
23 | |
24 | SRC_URI=( |
25 | gnu://${PNAME}/${SRCFILE} |
26 | mirror://${PNAME}/${SRCFILE} |
27 | mirror://${PNAME}/dot.bashrc |
28 | mirror://${PNAME}/dot.bash_profile |
29 | mirror://${PNAME}/dot.bash_logout |
30 | mirror://${PNAME}/bashrc |
31 | mirror://${PNAME}/bash_logout |
32 | $(for ((i=1;i <= PATCH_LEVEL; i++)) |
33 | do |
34 | ver=00${i} |
35 | [[ ${i} -ge 10 ]] && ver=0${i} |
36 | [[ ${i} -ge 100 ]] && ver=${i} |
37 | echo "gnu://${PNAME}/${PNAME}-${PVER}-patches/${PNAME}${PVER/./}-${ver}" |
38 | echo "mirror://${PNAME}/${PNAME}${PVER/./}-${ver}" |
39 | done) |
40 | mirror://${PNAME}/${PNAME}-3.0-parallel-build.patch |
41 | mirror://${PNAME}/${PNAME}-3.0-trap-fg-signals.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 | # enable SSH_SOURCE_BASHRC |
73 | sed -i 's:^.*\(#define SSH_SOURCE_BASHRC\).*$:\1:' config-top.h || die |
74 | |
75 | # location of the default mail directory |
76 | # (not using config-top.h but config.h.in to suppress annoying warnings) |
77 | sed -i 's:^\(#define DEFAULT_MAIL_DIRECTORY\).*:\1 "/usr/spool/mail":' config.h.in || die |
78 | |
79 | # run the startup files |
80 | echo '#define NON_INTERACTIVE_LOGIN_SHELLS' >> config-top.h || die |
81 | |
82 | # location of system-wide bashrc |
83 | echo '#define SYS_BASHRC "/etc/bash/bashrc"' >> config-top.h || die |
84 | |
85 | # location of system-wide bash_logout |
86 | echo '#define SYS_BASH_LOGOUT "/etc/bash/bash_logout"' >> config-top.h || die |
87 | |
88 | # Force pgrp synchronization |
89 | # (https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653) |
90 | # |
91 | # The session will hang cases where you 'su' (not 'su -') and |
92 | # then run a piped command in emacs. |
93 | # This problem seem to happen due to scheduler changes kernel |
94 | # side - although reproduceble with later 2.4 kernels, it is |
95 | # especially easy with 2.6 kernels. |
96 | echo '#define PGRP_PIPE 1' >> config-bot.h || die |
97 | } |
98 | |
99 | src_compile() |
100 | { |
101 | cd ${SRCDIR} |
102 | |
103 | mconfigure \ |
104 | --bindir=/bin \ |
105 | --disable-profiling \ |
106 | --with-curses \ |
107 | --without-gnu-malloc \ |
108 | || die |
109 | |
110 | # on x86_64 parallel is broken; patch not work |
111 | mmake -j1 || die |
112 | } |
113 | |
114 | alx_generic_src_install() |
115 | { |
116 | cd ${SRCDIR} |
117 | make DESTDIR=${BINDIR} bindir=/bin install || die |
118 | |
119 | # some needed symlinks |
120 | mlink bash /bin/sh || die |
121 | mlink bash /bin/rbash || die |
122 | |
123 | # install skeletons |
124 | for i in bashrc bash_profile bash_logout |
125 | do |
126 | minstalletc dot.${i} .${i} /etc/skel || die |
127 | done |
128 | |
129 | # install global rcs |
130 | minstalletc bashrc bashrc /etc/bash || die |
131 | minstalletc bash_logout bash_logout /etc/bash || die |
132 | |
133 | minstalldocs ABOUT-NLS AUTHORS CHANGES COMPAT COPYING MANIFEST \ |
134 | NEWS NOTES POSIX RBASH README || die |
135 | } |
136 | |
137 | postinstall() |
138 | { |
139 | # install skeletons for root, as bash is our default shell |
140 | if [[ ! -f ${MROOT}/root/.bashrc ]] |
141 | then |
142 | install -m0644 ${MROOT}/etc/skel/.bashrc ${MROOT}/root |
143 | fi |
144 | if [[ ! -f ${MROOT}/root/.bash_profile ]] |
145 | then |
146 | install -m0644 ${MROOT}/etc/skel/.bash_profile ${MROOT}/root |
147 | fi |
148 | if [[ ! -f ${MROOT}/root/.bash_logout ]] |
149 | then |
150 | install -m0644 ${MROOT}/etc/skel/.bash_logout ${MROOT}/root |
151 | fi |
152 | |
153 | alx-split_postinstall |
154 | } |