1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
11 url = http://www.gnu.org/software/bash/
13 summary = Bash is short for born again shell.
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.
22 source_dl = http://ftp.gnu.org/gnu/bash/
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
40 sed -i "s|htmldir = @htmldir@|htmldir = /usr/share/doc/%{thisapp}|" \
44 configure_options += \
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)"
59 mkdir -pv %{BUILDROOT}%{sysconfdir}/{profile.d,skel}
60 mkdir -pv %{BUILDROOT}/root
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
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
72 cp -vf %{DIR_SOURCE}/profile.d/* %{BUILDROOT}/etc/profile.d
74 ln -svf bash %{BUILDROOT}%{bindir}/sh
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
81 echo "builtin \"${f}\" \"\$@\""
82 ) > "%{BUILDROOT}/%{bindir}/${f}"
83 chmod +x "%{BUILDROOT}%{bindir}/${f}"
108 # Create /etc/shells, if it does not exist.
109 [ -f "/etc/shells" ] || touch /etc/shells
114 if [ "/bin/bash" = "${line}" ]; then
116 elif [ "/bin/sh" = "${line}" ]; then
121 if [ "${found_bash}" = "0" ]; then
122 echo "/bin/bash" >> /etc/shells
125 if [ "${found_sh}" = "0" ]; then
126 echo "/bin/sh" >> /etc/shells
131 [ -e "/etc/shells" ] || exit 0
133 # Remove /bin/bash and /bin/sh from /etc/shells.
135 if [ "/bin/bash" = "${line}" ]; then
137 elif [ "/bin/sh" = "${line}" ]; then
142 done < /etc/shells > /etc/shells.$$
144 mv -f /etc/shells{.$$,}
148 package %{name}-debuginfo