5 Summary: The GNU Bourne Again shell
6 Url: http://www.gnu.org/software/bash
8 Source0: ftp://ftp.gnu.org/gnu/bash/%{name}-%{version}.tar.gz
9 BuildRequires: autoconf
15 The GNU Bourne Again shell (Bash) is a shell or command language
16 interpreter that is compatible with the Bourne shell (sh). Bash
17 incorporates useful features from the Korn shell (ksh) and the C shell
18 (csh). Most sh scripts can be run by bash without modification.
21 Summary: Documentation files for %{name}
22 Group: Development/Languages
23 Requires: %{name} = %{version}
26 This package contains documentation files for %{name}.
28 %define pkgdocdir %{_datadir}/doc/%{name}-%{version}
35 %configure --enable-largefile --without-bash-malloc --disable-nls
37 # Recycles pids is neccessary. When bash's last fork's pid was X
38 # and new fork's pid is also X, bash has to wait for this same pid.
39 # Without Recycles pids bash will not wait.
40 make "CPPFLAGS=-D_GNU_SOURCE -DDEFAULT_PATH_VALUE='\"/usr/local/bin:/usr/bin\"' -DRECYCLES_PIDS `getconf LFS_CFLAGS`"
46 if [ -e autoconf ]; then
47 # Yuck. We're using autoconf 2.1x.
52 perl -pi -e 's,bashref\.info,bash.info,' doc/bashref.info
56 mkdir -p %{buildroot}/etc
58 #mkdir -p %{buildroot}/%{_bindir}
59 #mv %{buildroot}/bin/* %{buildroot}/%{_bindir}/
61 # make manpages for bash builtins as per suggestion in DOC/README
64 /^\.SH NAME/, /\\- bash built-in commands, see \\fBbash\\fR(1)$/{
67 s/\\- bash built-in commands, see \\fBbash\\fR(1)$//
72 ' builtins.1 > man.pages
73 for i in echo pwd test kill; do
74 perl -pi -e "s,$i,,g" man.pages
75 perl -pi -e "s, , ,g" man.pages
78 install -c -m 644 builtins.1 %{buildroot}%{_mandir}/man1/builtins.1
80 for i in `cat man.pages` ; do
81 echo .so man1/builtins.1 > %{buildroot}%{_mandir}/man1/$i.1
82 chmod 0644 %{buildroot}%{_mandir}/man1/$i.1
86 # Link bash man page to sh so that man sh works.
87 ln -s bash.1 %{buildroot}%{_mandir}/man1/sh.1
89 # Not for printf, true and false (conflict with coreutils)
90 rm -f %{buildroot}/%{_mandir}/man1/printf.1
91 rm -f %{buildroot}/%{_mandir}/man1/true.1
92 rm -f %{buildroot}/%{_mandir}/man1/false.1
95 ln -sf bash ./usr/bin/sh
96 rm -f .%{_infodir}/dir
98 mkdir -p %{buildroot}%{_sysconfdir}/skel
99 #install -c -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/skel/.bashrc
100 #install -c -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/skel/.bash_profile
101 #install -c -m644 %{SOURCE3} %{buildroot}%{_sysconfdir}/skel/.bash_logout
102 LONG_BIT=$(getconf LONG_BIT)
103 mv %{buildroot}%{_bindir}/bashbug \
104 %{buildroot}%{_bindir}/bashbug-"${LONG_BIT}"
106 # Fix missing sh-bangs in example scripts (bug #225609).
108 examples/scripts/krand.bash \
109 examples/scripts/bcsh.sh \
110 examples/scripts/precedence \
111 examples/scripts/shprompt
113 cp "$script" "$script"-orig
114 echo '#!/bin/bash' > "$script"
115 cat "$script"-orig >> "$script"
119 rm -rf %{buildroot}%{_bindir}/bashbug-*
128 f = io.open("/etc/shells", "r");
131 f = io.open("/etc/shells", "w");
147 f = io.open("/etc/shells", "a");
150 f:write("/bin/bash\n")
159 if [ "$1" = 0 ]; then
160 /bin/grep -v '^/bin/bash$' < /etc/shells | \
161 /bin/grep -v '^/bin/sh$' > /etc/shells.new
162 /bin/mv /etc/shells.new /etc/shells