| 1 | %define patchleveltag .0
|
|---|
| 2 | %define baseversion 3.2
|
|---|
| 3 |
|
|---|
| 4 | Summary: The GNU Bourne Again shell
|
|---|
| 5 | Name: bash
|
|---|
| 6 | Version: %{baseversion}%{patchleveltag}
|
|---|
| 7 | Release: 4%{?dist}
|
|---|
| 8 | License: BSD
|
|---|
| 9 | Group: System Environment/Shells
|
|---|
| 10 | Source: bash.zip
|
|---|
| 11 | #Source: ftp://ftp.debian.org/debian/dists/woody/main/source/shells/%{name}_%{version}.orig.tar.gz
|
|---|
| 12 | #Patch0: ftp://ftp.debian.org/debian/dists/woody/main/source/shells/%{name}_%{version}-38.diff.gz
|
|---|
| 13 | #Patch2: ash-0.3.8-tempfile.patch
|
|---|
| 14 | #Patch1: ash-0.3.8-build.patch
|
|---|
| 15 | #Patch3: ash-0.3.8-mannewline.patch
|
|---|
| 16 | #Patch4: ash-0.3.8-segv.patch
|
|---|
| 17 | #Prereq: fileutils grep
|
|---|
| 18 | #BuildPrereq: pmake >= 1.45 byacc
|
|---|
| 19 | #Buildroot: %{_tmppath}/%{name}-%{version}-root
|
|---|
| 20 | #Conflicts: mkinitrd <= 1.7
|
|---|
| 21 |
|
|---|
| 22 | %description
|
|---|
| 23 | The GNU Bourne Again shell (Bash) is a shell or command language
|
|---|
| 24 | interpreter that is compatible with the Bourne shell (sh). Bash
|
|---|
| 25 | incorporates useful features from the Korn shell (ksh) and the C shell
|
|---|
| 26 | (csh). Most sh scripts can be run by bash without modification.
|
|---|
| 27 |
|
|---|
| 28 | %prep
|
|---|
| 29 | %setup -q -n bash-%{version}
|
|---|
| 30 | #%patch0 -p1 -b .linux
|
|---|
| 31 | #%patch2 -p1 -b .tempfile
|
|---|
| 32 | #%ifarch alpha
|
|---|
| 33 | #%patch1 -p1 -b .alpha
|
|---|
| 34 | #%endif
|
|---|
| 35 | #%patch3 -p1
|
|---|
| 36 | #%patch4 -p0 -b .segv
|
|---|
| 37 | #chmod -R a+rX .
|
|---|
| 38 |
|
|---|
| 39 | %build
|
|---|
| 40 | #chmod u+x debian/bsdyacc
|
|---|
| 41 | #pmake CFLAGS="-g ${RPM_OPT_FLAGS} \
|
|---|
| 42 | # -DBSD=1 -DSMALL -D_GNU_SOURCE \
|
|---|
| 43 | # -DGLOB_BROKEN -D__COPYRIGHT\(x\)= \
|
|---|
| 44 | # -D__RCSID\(x\)= -D_DIAGASSERT\(x\)=" \
|
|---|
| 45 | # YACC=`pwd`/debian/bsdyacc
|
|---|
| 46 | #mv sh sh.dynamic
|
|---|
| 47 | #
|
|---|
| 48 | #pmake CFLAGS="-g ${RPM_OPT_FLAGS} \
|
|---|
| 49 | # -DBSD=1 -DSMALL -D_GNU_SOURCE \
|
|---|
| 50 | # -DGLOB_BROKEN -D__COPYRIGHT\(x\)= \
|
|---|
| 51 | # -D__RCSID\(x\)= -D_DIAGASSERT\(x\)=" \
|
|---|
| 52 | # YACC=`pwd`/debian/bsdyacc LDFLAGS="-static"
|
|---|
| 53 | #mv sh sh.static
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 | %install
|
|---|
| 57 | rm -rf %{buildroot}
|
|---|
| 58 | mkdir -p %{buildroot}/@unixroot/bin
|
|---|
| 59 |
|
|---|
| 60 | cp usr/bin/bash.exe %{buildroot}/@unixroot/bin/bash.exe
|
|---|
| 61 | ln -s bash.exe %{buildroot}/@unixroot/bin/bash
|
|---|
| 62 |
|
|---|
| 63 | #%post
|
|---|
| 64 | #if [ ! -f /etc/shells ]; then
|
|---|
| 65 | # echo "/bin/ash" > /etc/shells
|
|---|
| 66 | # echo "/bin/bsh" >> /etc/shells
|
|---|
| 67 | #else
|
|---|
| 68 | # if ! grep '^/bin/ash$' /etc/shells > /dev/null; then
|
|---|
| 69 | # echo "/bin/ash" >> /etc/shells
|
|---|
| 70 | # fi
|
|---|
| 71 | # if ! grep '^/bin/bsh$' /etc/shells > /dev/null; then
|
|---|
| 72 | # echo "/bin/bsh" >> /etc/shells
|
|---|
| 73 | # fi
|
|---|
| 74 | #fi
|
|---|
| 75 |
|
|---|
| 76 | #%postun
|
|---|
| 77 | #if [ "$1" = "0" ]; then
|
|---|
| 78 | # grep -v '^/bin/ash' < /etc/shells | grep -v '^/bin/bsh' > /etc/shells.new
|
|---|
| 79 | # mv /etc/shells.new /etc/shells
|
|---|
| 80 | #fi
|
|---|
| 81 |
|
|---|
| 82 | %verifyscript
|
|---|
| 83 | #
|
|---|
| 84 | #for n in ash bsh; do
|
|---|
| 85 | # echo -n "Looking for $n in /etc/shells... "
|
|---|
| 86 | # if ! grep "^/bin/${n}\$" /etc/shells > /dev/null; then
|
|---|
| 87 | # echo "missing"
|
|---|
| 88 | # echo "${n} missing from /etc/shells" >&2
|
|---|
| 89 | # else
|
|---|
| 90 | # echo "found"
|
|---|
| 91 | # fi
|
|---|
| 92 | #done
|
|---|
| 93 |
|
|---|
| 94 | %clean
|
|---|
| 95 | rm -rf %{buildroot}
|
|---|
| 96 |
|
|---|
| 97 | %files
|
|---|
| 98 | %defattr(-,root,root)
|
|---|
| 99 | /@unixroot/bin/bash
|
|---|
| 100 | /@unixroot/bin/bash.exe
|
|---|
| 101 | #/bin/bsh
|
|---|
| 102 | #%{_mandir}/man1/*
|
|---|