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