]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blame - bash/bash.nm
bash: Update to 4.4
[people/stevee/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
f4587ad0
MT
7version = 4.4
8release = 1
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
f4587ad0 31 readline-devel >= 7.0
daf84637 32 texinfo
802ea3af
MT
33 end
34
f4587ad0
MT
35 # Disable parallel build
36 MAKETUNING =
37
802ea3af
MT
38 prepare_cmds
39 # Bash uses the RTLD_LAZY option when loading libraries. We want to use
40 # RTLD_NOW (it is defined from <dlfcn.h>:
41 sed -e "s/filename, RTLD_LAZY/filename, RTLD_NOW/" \
42 -i builtins/enable.def
802ea3af
MT
43 end
44
f4587ad0
MT
45 CPPFLAGS += -D_GNU_SOURCE %(getconf LFS_CFLAGS)
46
47 CPPFLAGS += -DNON_INTERACTIVE_LOGIN_SHELLS
48 CPPFLAGS += -DSSH_SOURCE_BASHRC
56ba7d19
MT
49
50 # Recycles pids is neccessary. When bash's last fork's pid was X
51 # and new fork's pid is also X, bash has to wait for this same pid.
52 # Without Recycles pids bash will not wait.
f4587ad0
MT
53 CPPFLAGS += -DRECYCLES_PIDS
54
55 CPPFLAGS += \
56 -DDEFAULT_PATH_VALUE='\"/usr/local/bin:/usr/bin\"' \
57 -DSTANDARD_UTILS_PATH='\"/bin:/usr/bin:/sbin:/usr/sbin\"' \
58 -DSYS_BASH_LOGOUT='\"/etc/bash.bash_logout\"'
59
60 configure_options += \
61 --with-installed-readline \
62 --with-afs \
63 --with-bash-malloc=no
64
65 make_build_targets += CPPFLAGS="%{CPPFLAGS}"
802ea3af 66
56ba7d19
MT
67 test
68 make tests
69 end
802ea3af
MT
70
71 install_cmds
7a5553dc
SS
72 mkdir -pv %{BUILDROOT}%{sysconfdir}/{profile.d,skel}
73 mkdir -pv %{BUILDROOT}/root
802ea3af
MT
74
75 # Bash startup files
7a5553dc
SS
76 cp -vf %{DIR_SOURCE}/dot_bash_logout %{BUILDROOT}%{sysconfdir}/skel/.bash_logout
77 cp -vf %{DIR_SOURCE}/dot_bash_profile %{BUILDROOT}%{sysconfdir}/skel/.bash_profile
78 cp -vf %{DIR_SOURCE}/dot_bashrc %{BUILDROOT}%{sysconfdir}/skel/.bashrc
79
802ea3af
MT
80 cp -vf %{DIR_SOURCE}/dot_bash_logout %{BUILDROOT}/root/.bash_logout
81 cp -vf %{DIR_SOURCE}/dot_bash_profile %{BUILDROOT}/root/.bash_profile
82 cp -vf %{DIR_SOURCE}/dot_bashrc %{BUILDROOT}/root/.bashrc
83
84 # /etc/profile.d
85 cp -vf %{DIR_SOURCE}/profile.d/* %{BUILDROOT}/etc/profile.d
86
9118c7ca 87 ln -svf bash %{BUILDROOT}%{bindir}/sh
56ba7d19
MT
88
89 # https://bugzilla.redhat.com/show_bug.cgi?id=820192
90 # bug #820192, need to add execable alternatives for regular built-ins
91 for f in alias bg cd command fc fg getopts jobs read umask unalias wait; do
92 (
93 echo "#!/bin/sh"
94 echo "builtin \"${f}\" \"\$@\""
95 ) > "%{BUILDROOT}/%{bindir}/${f}"
96 chmod +x "%{BUILDROOT}%{bindir}/${f}"
97 done
802ea3af
MT
98 end
99end
100
101packages
102 package %{name}
cd711c7b
MT
103 groups += Base Build
104
774bad77 105 requires
57b0ba3a 106 coreutils
774bad77
MT
107 /etc/bashrc
108 /etc/profile
109 end
84292e3e 110
9118c7ca
MT
111 provides
112 /bin/bash
113 /bin/sh
114 end
115
116 conflicts
117 filesystem < 002
118 end
119
0e13ce8c 120 script posttransin
84292e3e
MT
121 # Create /etc/shells, if it does not exist.
122 [ -f "/etc/shells" ] || touch /etc/shells
123
c84c1f1a
MT
124 found_sh=0
125 found_bash=0
126 while read line; do
127 if [ "/bin/bash" = "${line}" ]; then
128 found_bash=1
129 elif [ "/bin/sh" = "${line}" ]; then
130 found_sh=1
131 fi
132 done < /etc/shells
133
134 if [ "${found_bash}" = "0" ]; then
84292e3e
MT
135 echo "/bin/bash" >> /etc/shells
136 fi
137
c84c1f1a 138 if [ "${found_sh}" = "0" ]; then
84292e3e
MT
139 echo "/bin/sh" >> /etc/shells
140 fi
141 end
142
143 script postun
144 [ -e "/etc/shells" ] || exit 0
145
146 # Remove /bin/bash and /bin/sh from /etc/shells.
147 while read line; do
c84c1f1a 148 if [ "/bin/bash" = "${line}" ]; then
84292e3e 149 continue
c84c1f1a 150 elif [ "/bin/sh" = "${line}" ]; then
84292e3e
MT
151 continue
152 fi
153
154 echo "${line}"
155 done < /etc/shells > /etc/shells.$$
156
157 mv -f /etc/shells{.$$,}
158 end
802ea3af 159 end
1f9bc2f0
MT
160
161 package %{name}-debuginfo
162 template DEBUGINFO
163 end
802ea3af 164end