| 1 | Summary: A smaller version of the Bourne shell (sh).
|
|---|
| 2 | Name: ash
|
|---|
| 3 | Version: 0.0.0
|
|---|
| 4 | Release: 1
|
|---|
| 5 | License: BSD
|
|---|
| 6 | Group: System Environment/Shells
|
|---|
| 7 | Source: ash.zip
|
|---|
| 8 | #Source: ftp://ftp.debian.org/debian/dists/woody/main/source/shells/%{name}_%{version}.orig.tar.gz
|
|---|
| 9 | #Patch0: ftp://ftp.debian.org/debian/dists/woody/main/source/shells/%{name}_%{version}-38.diff.gz
|
|---|
| 10 | #Patch2: ash-0.3.8-tempfile.patch
|
|---|
| 11 | #Patch1: ash-0.3.8-build.patch
|
|---|
| 12 | #Patch3: ash-0.3.8-mannewline.patch
|
|---|
| 13 | #Patch4: ash-0.3.8-segv.patch
|
|---|
| 14 | #Prereq: fileutils grep
|
|---|
| 15 | #BuildPrereq: pmake >= 1.45 byacc
|
|---|
| 16 | #Buildroot: %{_tmppath}/%{name}-%{version}-root
|
|---|
| 17 | #Conflicts: mkinitrd <= 1.7
|
|---|
| 18 |
|
|---|
| 19 | %description
|
|---|
| 20 | A shell is a basic system program that interprets keyboard and mouse
|
|---|
| 21 | commands. The ash shell is a clone of Berkeley's Bourne shell
|
|---|
| 22 | (sh). Ash supports all of the standard sh shell commands, but is
|
|---|
| 23 | considerably smaller than sh. The ash shell lacks some Bourne shell
|
|---|
| 24 | features (for example, command-line histories), but it uses a lot less
|
|---|
| 25 | memory.
|
|---|
| 26 |
|
|---|
| 27 | You should install ash if you need a lightweight shell with many of
|
|---|
| 28 | the same capabilities as the sh shell.
|
|---|
| 29 |
|
|---|
| 30 | %prep
|
|---|
| 31 | %setup -q -n ash-%{version}
|
|---|
| 32 | #%patch0 -p1 -b .linux
|
|---|
| 33 | #%patch2 -p1 -b .tempfile
|
|---|
| 34 | #%ifarch alpha
|
|---|
| 35 | #%patch1 -p1 -b .alpha
|
|---|
| 36 | #%endif
|
|---|
| 37 | #%patch3 -p1
|
|---|
| 38 | #%patch4 -p0 -b .segv
|
|---|
| 39 | #chmod -R a+rX .
|
|---|
| 40 |
|
|---|
| 41 | %build
|
|---|
| 42 | #chmod u+x debian/bsdyacc
|
|---|
| 43 | #pmake CFLAGS="-g ${RPM_OPT_FLAGS} \
|
|---|
| 44 | # -DBSD=1 -DSMALL -D_GNU_SOURCE \
|
|---|
| 45 | # -DGLOB_BROKEN -D__COPYRIGHT\(x\)= \
|
|---|
| 46 | # -D__RCSID\(x\)= -D_DIAGASSERT\(x\)=" \
|
|---|
| 47 | # YACC=`pwd`/debian/bsdyacc
|
|---|
| 48 | #mv sh sh.dynamic
|
|---|
| 49 | #
|
|---|
| 50 | #pmake CFLAGS="-g ${RPM_OPT_FLAGS} \
|
|---|
| 51 | # -DBSD=1 -DSMALL -D_GNU_SOURCE \
|
|---|
| 52 | # -DGLOB_BROKEN -D__COPYRIGHT\(x\)= \
|
|---|
| 53 | # -D__RCSID\(x\)= -D_DIAGASSERT\(x\)=" \
|
|---|
| 54 | # YACC=`pwd`/debian/bsdyacc LDFLAGS="-static"
|
|---|
| 55 | #mv sh sh.static
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 | %install
|
|---|
| 59 | rm -rf %{buildroot}
|
|---|
| 60 | mkdir -p %{buildroot}/@unixroot/bin
|
|---|
| 61 | mkdir -p %{buildroot}%{_bindir}
|
|---|
| 62 | mkdir -p %{buildroot}%{_mandir}/man1
|
|---|
| 63 |
|
|---|
| 64 | cp bin/ash.exe %{buildroot}/@unixroot/bin/sh
|
|---|
| 65 | cp bin/ash.exe %{buildroot}%{_bindir}/sh.exe
|
|---|
| 66 |
|
|---|
| 67 | cp bin/ash.exe %{buildroot}/@unixroot/bin/env
|
|---|
| 68 | cp bin/env.exe %{buildroot}%{_bindir}/env
|
|---|
| 69 |
|
|---|
| 70 | cp usr/man/man1/ash.1.gz %{buildroot}%{_mandir}/man1/ash.1.gz
|
|---|
| 71 | #ln -sf ash.1 %{buildroot}%{_mandir}/man1/bsh.1
|
|---|
| 72 | #ln -sf ash %{buildroot}/bin/bsh
|
|---|
| 73 | #install -m 755 sh.static %{buildroot}/bin/ash.static
|
|---|
| 74 |
|
|---|
| 75 | #%post
|
|---|
| 76 | #if [ ! -f /etc/shells ]; then
|
|---|
| 77 | # echo "/bin/ash" > /etc/shells
|
|---|
| 78 | # echo "/bin/bsh" >> /etc/shells
|
|---|
| 79 | #else
|
|---|
| 80 | # if ! grep '^/bin/ash$' /etc/shells > /dev/null; then
|
|---|
| 81 | # echo "/bin/ash" >> /etc/shells
|
|---|
| 82 | # fi
|
|---|
| 83 | # if ! grep '^/bin/bsh$' /etc/shells > /dev/null; then
|
|---|
| 84 | # echo "/bin/bsh" >> /etc/shells
|
|---|
| 85 | # fi
|
|---|
| 86 | #fi
|
|---|
| 87 |
|
|---|
| 88 | #%postun
|
|---|
| 89 | #if [ "$1" = "0" ]; then
|
|---|
| 90 | # grep -v '^/bin/ash' < /etc/shells | grep -v '^/bin/bsh' > /etc/shells.new
|
|---|
| 91 | # mv /etc/shells.new /etc/shells
|
|---|
| 92 | #fi
|
|---|
| 93 |
|
|---|
| 94 | %verifyscript
|
|---|
| 95 | #
|
|---|
| 96 | #for n in ash bsh; do
|
|---|
| 97 | # echo -n "Looking for $n in /etc/shells... "
|
|---|
| 98 | # if ! grep "^/bin/${n}\$" /etc/shells > /dev/null; then
|
|---|
| 99 | # echo "missing"
|
|---|
| 100 | # echo "${n} missing from /etc/shells" >&2
|
|---|
| 101 | # else
|
|---|
| 102 | # echo "found"
|
|---|
| 103 | # fi
|
|---|
| 104 | #done
|
|---|
| 105 |
|
|---|
| 106 | %clean
|
|---|
| 107 | rm -rf %{buildroot}
|
|---|
| 108 |
|
|---|
| 109 | %files
|
|---|
| 110 | %defattr(-,root,root)
|
|---|
| 111 | /@unixroot/bin/sh
|
|---|
| 112 | /@unixroot/bin/env
|
|---|
| 113 | %{_bindir}/sh.exe
|
|---|
| 114 | %{_bindir}/env
|
|---|
| 115 | #/bin/bsh
|
|---|
| 116 | %{_mandir}/man1/*
|
|---|