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 = https://ftp.gnu.org/gnu/bash/
36 # Bash uses the RTLD_LAZY option when loading libraries. We want to use
37 # RTLD_NOW (it is defined from <dlfcn.h>:
38 sed -e "s/filename, RTLD_LAZY/filename, RTLD_NOW/" \
39 -i builtins/enable.def
42 CPPFLAGS += -D_GNU_SOURCE %(getconf LFS_CFLAGS)
44 CPPFLAGS += -DNON_INTERACTIVE_LOGIN_SHELLS
45 CPPFLAGS += -DSSH_SOURCE_BASHRC
47 # Recycles pids is neccessary. When bash's last fork's pid was X
48 # and new fork's pid is also X, bash has to wait for this same pid.
49 # Without Recycles pids bash will not wait.
50 CPPFLAGS += -DRECYCLES_PIDS
53 -DDEFAULT_PATH_VALUE='\"/usr/local/bin:/usr/bin\"' \
54 -DSTANDARD_UTILS_PATH='\"/bin:/usr/bin:/sbin:/usr/sbin\"' \
55 -DSYS_BASH_LOGOUT='\"/etc/bash.bash_logout\"'
57 configure_options += \
58 --with-installed-readline \
62 make_build_targets += CPPFLAGS="%{CPPFLAGS}"
69 mkdir -pv %{BUILDROOT}%{sysconfdir}/{profile.d,skel}
70 install -v -m 700 -d %{BUILDROOT}/root
73 cp -vf %{DIR_SOURCE}/dot_bash_logout %{BUILDROOT}%{sysconfdir}/skel/.bash_logout
74 cp -vf %{DIR_SOURCE}/dot_bash_profile %{BUILDROOT}%{sysconfdir}/skel/.bash_profile
75 cp -vf %{DIR_SOURCE}/dot_bashrc %{BUILDROOT}%{sysconfdir}/skel/.bashrc
77 cp -vf %{DIR_SOURCE}/dot_bash_logout %{BUILDROOT}/root/.bash_logout
78 cp -vf %{DIR_SOURCE}/dot_bash_profile %{BUILDROOT}/root/.bash_profile
79 cp -vf %{DIR_SOURCE}/dot_bashrc %{BUILDROOT}/root/.bashrc
82 cp -vf %{DIR_SOURCE}/profile.d/* %{BUILDROOT}/etc/profile.d
84 ln -svf bash %{BUILDROOT}%{bindir}/sh
86 # https://bugzilla.redhat.com/show_bug.cgi?id=820192
87 # bug #820192, need to add execable alternatives for regular built-ins
88 for f in alias bg cd command fc fg getopts jobs read umask unalias wait; do
91 echo "builtin \"${f}\" \"\$@\""
92 ) > "%{BUILDROOT}/%{bindir}/${f}"
93 chmod +x "%{BUILDROOT}%{bindir}/${f}"
96 # Set correct permissions for binaries.
97 find %{BUILDROOT}%{bindir} -type f -executable -exec chmod 755 {} \;
121 # Create /etc/shells, if it does not exist.
122 [ -f "/etc/shells" ] || touch /etc/shells
127 if [ "/bin/bash" = "${line}" ]; then
129 elif [ "/bin/sh" = "${line}" ]; then
134 if [ "${found_bash}" = "0" ]; then
135 echo "/bin/bash" >> /etc/shells
138 if [ "${found_sh}" = "0" ]; then
139 echo "/bin/sh" >> /etc/shells
144 [ -e "/etc/shells" ] || exit 0
146 # Remove /bin/bash and /bin/sh from /etc/shells.
148 if [ "/bin/bash" = "${line}" ]; then
150 elif [ "/bin/sh" = "${line}" ]; then
155 done < /etc/shells > /etc/shells.$$
157 mv -f /etc/shells{.$$,}
161 package %{name}-debuginfo