]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - bash/bash.nm
bash: Update to 4.3
[people/ms/ipfire-3.x.git] / bash / bash.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = bash
7 version = 4.3
8 release = 11
9
10 groups = System/Tools
11 url = http://www.gnu.org/software/bash/
12 license = GPLv2+
13 summary = Bash is short for born again shell.
14
15 description
16 Bash is the shell, or command language interpreter, that will appear in
17 the GNU operating system. Bash is an sh-compatible shell that incorporates
18 useful features from the Korn shell (ksh) and C shell (csh). It is intended
19 to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard.
20 end
21
22 source_dl = http://ftp.gnu.org/gnu/bash/
23
24 build
25 requires
26 autoconf
27 automake
28 bison
29 filesystem >= 002
30 ncurses-devel
31 texinfo
32 end
33
34 prepare_cmds
35 # Bash uses the RTLD_LAZY option when loading libraries. We want to use
36 # RTLD_NOW (it is defined from <dlfcn.h>:
37 sed -e "s/filename, RTLD_LAZY/filename, RTLD_NOW/" \
38 -i builtins/enable.def
39
40 sed -i "s|htmldir = @htmldir@|htmldir = /usr/share/doc/%{thisapp}|" \
41 Makefile.in
42 end
43
44 configure_options += \
45 --with-afs \
46 --with-bash-malloc=no
47
48 # Recycles pids is neccessary. When bash's last fork's pid was X
49 # and new fork's pid is also X, bash has to wait for this same pid.
50 # Without Recycles pids bash will not wait.
51 make_build_targets += "CPPFLAGS=-D_GNU_SOURCE -DRECYCLES_PIDS -DDEFAULT_PATH_VALUE='\"/usr/local/bin:/usr/bin\"' $(getconf LFS_CFLAGS)"
52
53 # Test hangs forever
54 test
55 make tests
56 end
57
58 install_cmds
59 mkdir -pv %{BUILDROOT}%{sysconfdir}/{profile.d,skel}
60 mkdir -pv %{BUILDROOT}/root
61
62 # Bash startup files
63 cp -vf %{DIR_SOURCE}/dot_bash_logout %{BUILDROOT}%{sysconfdir}/skel/.bash_logout
64 cp -vf %{DIR_SOURCE}/dot_bash_profile %{BUILDROOT}%{sysconfdir}/skel/.bash_profile
65 cp -vf %{DIR_SOURCE}/dot_bashrc %{BUILDROOT}%{sysconfdir}/skel/.bashrc
66
67 cp -vf %{DIR_SOURCE}/dot_bash_logout %{BUILDROOT}/root/.bash_logout
68 cp -vf %{DIR_SOURCE}/dot_bash_profile %{BUILDROOT}/root/.bash_profile
69 cp -vf %{DIR_SOURCE}/dot_bashrc %{BUILDROOT}/root/.bashrc
70
71 # /etc/profile.d
72 cp -vf %{DIR_SOURCE}/profile.d/* %{BUILDROOT}/etc/profile.d
73
74 ln -svf bash %{BUILDROOT}%{bindir}/sh
75
76 # https://bugzilla.redhat.com/show_bug.cgi?id=820192
77 # bug #820192, need to add execable alternatives for regular built-ins
78 for f in alias bg cd command fc fg getopts jobs read umask unalias wait; do
79 (
80 echo "#!/bin/sh"
81 echo "builtin \"${f}\" \"\$@\""
82 ) > "%{BUILDROOT}/%{bindir}/${f}"
83 chmod +x "%{BUILDROOT}%{bindir}/${f}"
84 done
85 end
86 end
87
88 packages
89 package %{name}
90 groups += Base Build
91
92 requires
93 coreutils
94 /etc/bashrc
95 /etc/profile
96 end
97
98 provides
99 /bin/bash
100 /bin/sh
101 end
102
103 conflicts
104 filesystem < 002
105 end
106
107 script posttransin
108 # Create /etc/shells, if it does not exist.
109 [ -f "/etc/shells" ] || touch /etc/shells
110
111 found_sh=0
112 found_bash=0
113 while read line; do
114 if [ "/bin/bash" = "${line}" ]; then
115 found_bash=1
116 elif [ "/bin/sh" = "${line}" ]; then
117 found_sh=1
118 fi
119 done < /etc/shells
120
121 if [ "${found_bash}" = "0" ]; then
122 echo "/bin/bash" >> /etc/shells
123 fi
124
125 if [ "${found_sh}" = "0" ]; then
126 echo "/bin/sh" >> /etc/shells
127 fi
128 end
129
130 script postun
131 [ -e "/etc/shells" ] || exit 0
132
133 # Remove /bin/bash and /bin/sh from /etc/shells.
134 while read line; do
135 if [ "/bin/bash" = "${line}" ]; then
136 continue
137 elif [ "/bin/sh" = "${line}" ]; then
138 continue
139 fi
140
141 echo "${line}"
142 done < /etc/shells > /etc/shells.$$
143
144 mv -f /etc/shells{.$$,}
145 end
146 end
147
148 package %{name}-debuginfo
149 template DEBUGINFO
150 end
151 end