]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - bash/bash.nm
bash: Update to 4.3
[people/ms/ipfire-3.x.git] / bash / bash.nm
CommitLineData
166a6c21 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
166a6c21
MT
4###############################################################################
5
802ea3af 6name = bash
56ba7d19 7version = 4.3
7a5553dc 8release = 11
166a6c21 9
cd711c7b 10groups = System/Tools
802ea3af
MT
11url = http://www.gnu.org/software/bash/
12license = GPLv2+
13summary = Bash is short for born again shell.
166a6c21 14
802ea3af 15description
7a5553dc
SS
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
166a6c21 19 to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard.
802ea3af
MT
20end
21
22source_dl = http://ftp.gnu.org/gnu/bash/
23
24build
25 requires
26 autoconf
27 automake
28 bison
9118c7ca 29 filesystem >= 002
802ea3af 30 ncurses-devel
daf84637 31 texinfo
802ea3af
MT
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 += \
56ba7d19
MT
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)"
802ea3af
MT
52
53 # Test hangs forever
56ba7d19
MT
54 test
55 make tests
56 end
802ea3af
MT
57
58 install_cmds
7a5553dc
SS
59 mkdir -pv %{BUILDROOT}%{sysconfdir}/{profile.d,skel}
60 mkdir -pv %{BUILDROOT}/root
802ea3af
MT
61
62 # Bash startup files
7a5553dc
SS
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
802ea3af
MT
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
9118c7ca 74 ln -svf bash %{BUILDROOT}%{bindir}/sh
56ba7d19
MT
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
802ea3af
MT
85 end
86end
87
88packages
89 package %{name}
cd711c7b
MT
90 groups += Base Build
91
774bad77 92 requires
57b0ba3a 93 coreutils
774bad77
MT
94 /etc/bashrc
95 /etc/profile
96 end
84292e3e 97
9118c7ca
MT
98 provides
99 /bin/bash
100 /bin/sh
101 end
102
103 conflicts
104 filesystem < 002
105 end
106
0e13ce8c 107 script posttransin
84292e3e
MT
108 # Create /etc/shells, if it does not exist.
109 [ -f "/etc/shells" ] || touch /etc/shells
110
c84c1f1a
MT
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
84292e3e
MT
122 echo "/bin/bash" >> /etc/shells
123 fi
124
c84c1f1a 125 if [ "${found_sh}" = "0" ]; then
84292e3e
MT
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
c84c1f1a 135 if [ "/bin/bash" = "${line}" ]; then
84292e3e 136 continue
c84c1f1a 137 elif [ "/bin/sh" = "${line}" ]; then
84292e3e
MT
138 continue
139 fi
140
141 echo "${line}"
142 done < /etc/shells > /etc/shells.$$
143
144 mv -f /etc/shells{.$$,}
145 end
802ea3af 146 end
1f9bc2f0
MT
147
148 package %{name}-debuginfo
149 template DEBUGINFO
150 end
802ea3af 151end