%define name ash %define version 0.2 %define prefix %{_prefix} %define release 22mdk Name: %{name} Summary: A smaller version of the Bourne shell. Version: %{version} Release: %{release} Copyright: BSD Group: Shells Source: http://metalab.unc.edu/pub/Linux/system/shells/ash-linux-%{version}.tar.bz2 Patch0: ftp://ftp.redhat.com/pub/ash-0.2-make.patch.bz2 Patch1: ash-linux-0.2-glibc21.patch.bz2 Patch2: ash-fd.patch.bz2 Patch3: ash-echo.patch.bz2 Prereq: fileutils grep BuildRoot: %{_tmppath}/%{name}-buildroot Conflicts: mkinitrd <= 1.7 %description The ash shell is a clone of Berkeley's Bourne shell. Ash supports all of the standard sh shell commands, but is considerably smaller than bash. The ash shell lacks some features (for example, command-line histories), but needs a lot less memory. You should install ash if you need a lightweight shell with many of the same capabilities as the bash shell. %prep %setup -q -n ash-linux-%{version} %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 %build make RPM_OPT_FLAGS="$RPM_OPT_FLAGS" cp sh ash make STATIC=-static %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/bin mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 install -m 755 ash $RPM_BUILD_ROOT/bin/ash install -m 755 sh $RPM_BUILD_ROOT/bin/ash.static install -m 644 sh.1 $RPM_BUILD_ROOT%{_mandir}/man1/ash.1 ln -s ash.1 $RPM_BUILD_ROOT%{_mandir}/man1/bsh.1 ln -s ash $RPM_BUILD_ROOT/bin/bsh %post if [ ! -f /etc/shells ]; then echo "/bin/ash" > /etc/shells echo "/bin/bsh" >> /etc/shells else if ! grep '^/bin/ash$' /etc/shells > /dev/null; then echo "/bin/ash" >> /etc/shells fi if ! grep '^/bin/bsh$' /etc/shells > /dev/null; then echo "/bin/bsh" >> /etc/shells fi fi %postun if [ "$1" = 0 ]; then grep -v '^/bin/ash' < /etc/shells | grep -v '^/bin/bsh' > /etc/shells.new mv /etc/shells.new /etc/shells fi %verifyscript for n in ash bsh; do echo -n "Looking for $n in /etc/shells... " if ! grep "^/bin/${n}\$" /etc/shells > /dev/null; then echo "missing" echo "${n} missing from /etc/shells" >&2 else echo "found" fi done %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc README.Linux /bin/ash /bin/ash.static /bin/bsh %{_mandir}/man1/* %changelog * Thu Jul 20 2000 Guillaume Cottenceau <gc@mandrakesoft.com> 0.2-22mdk - BM * Wed Mar 22 2000 Daouda LO <daouda@mandrakesoft.com> 0.2-21mdk - match new group architecture * Tue Oct 19 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com> - fix bogosity with fd's > 0 (r). - fix builtin echo to understand -n & -e at the same time (r). * Fri Apr 9 1999 Bernhard Rosenkraenzer <bero@linux-mandrake.com> - Mandrake adaptions - bzip2 man pages - correct download URL * Wed Feb 24 1999 Preston Brown <pbrown@redhat.com> - Injected new description and group. * Tue Jan 12 1999 Cristian Gafton <gafton@redhat.com> - build on glibc 2.1 * Fri Nov 06 1998 Preston Brown <pbrown@redhat.com> - updated to correct path on SunSITE. * Fri Aug 28 1998 Jeff Johnson <jbj@redhat.com> - recompile statically linked binary for 5.2/sparc * Tue May 05 1998 Prospector System <bugs@redhat.com> - translations modified for de, fr, tr * Mon Oct 20 1997 Erik Troan <ewt@redhat.com> - made /bin/ash built shared - added ash.static - uses a buildroot and %attr * Sun Aug 24 1997 Erik Troan <ewt@redhat.com> - built against glibc - statically linked * Wed Apr 16 1997 Erik Troan <ewt@redhat.com> - fixed preinstall script to >> /etc/shells for bsh.