diff --git a/.cvsignore b/.cvsignore index e69de29..eb93d96 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +less-358.tar.gz diff --git a/less.csh b/less.csh new file mode 100755 index 0000000..709dc2d --- /dev/null +++ b/less.csh @@ -0,0 +1,4 @@ +# less initialization script (csh) +if ( -x /usr/bin/lesspipe.sh ) then + setenv LESSOPEN "|/usr/bin/lesspipe.sh %s" +endif diff --git a/less.sh b/less.sh new file mode 100755 index 0000000..a7569fb --- /dev/null +++ b/less.sh @@ -0,0 +1,2 @@ +# less initialization script (sh) +[ -x /usr/bin/lesspipe.sh ] && export LESSOPEN="|/usr/bin/lesspipe.sh %s" diff --git a/less.spec b/less.spec new file mode 100644 index 0000000..34c58f3 --- /dev/null +++ b/less.spec @@ -0,0 +1,126 @@ +Summary: A text file browser similar to more, but better. +Name: less +Version: 358 +Release: 7 +License: GPL +Group: Applications/Text +Source: http://www.flash.net/~marknu/less/%{name}-%{version}.tar.gz +Source1: lesspipe.sh +Source2: less.sh +Source3: less.csh +Patch: less-shell.patch +URL: http://www.flash.net/~marknu/less/ +Buildroot: /var/tmp/less-root + +%description +The less utility is a text file browser that resembles more, but has +more capabilities. Less allows you to move backwards in the file as +well as forwards. Since less doesn't have to read the entire input file +before it starts, less starts up more quickly than text editors (for +example, vi). + +You should install less because it is a basic utility for viewing text +files, and you'll use it frequently. + +%prep +%setup -q +%patch -p1 -b .bug + +%build +%configure +make CC="gcc $RPM_OPT_FLAGS" datadir=%{_docdir} + +%install +rm -rf $RPM_BUILD_ROOT +%makeinstall +strip -R .comment $RPM_BUILD_ROOT/usr/bin/less +mkdir -p $RPM_BUILD_ROOT/etc/profile.d +install -c -m 755 %{SOURCE1} $RPM_BUILD_ROOT/usr/bin/ +install -c -m 755 %{SOURCE2} $RPM_BUILD_ROOT/etc/profile.d +install -c -m 755 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d + +%files +%defattr(-,root,root) +/etc/profile.d/* +/usr/bin/* +%{_mandir}/man1/* + +%clean +rm -rf $RPM_BUILD_ROOT + +%changelog +* Wed Aug 23 2000 Bernhard Rosenkraenzer +- support files with spaces in their names (Bug #16777) + +* Tue Aug 8 2000 Bernhard Rosenkraenzer +- Support gzipped man pages in lesspipe.sh (Bug #15610) + +* Thu Aug 3 2000 Bernhard Rosenkraenzer +- Tweak init script (Bug #14622) + +* Thu Jul 27 2000 Bernhard Rosenkraenzer +- Oops, actually apply the patch for 9443. ;) + +* Wed Jul 26 2000 Bernhard Rosenkraenzer +- Fix up messed output if a user outputs anything in ~/.bashrc or the + likes (Bug #9443) +- handle RPM_OPT_FLAGS + +* Thu Jul 13 2000 Prospector +- automatic rebuild + +* Thu Jul 13 2000 Bernhard Rosenkraenzer +- 358 + +* Mon Jun 26 2000 Matt Wilson +- defattr root + +* Mon Jun 19 2000 Bernhard Rosenkraenzer +- FHSify + +* Fri Apr 14 2000 Bernhard Rosenkraenzer +- 354 + +* Mon Mar 20 2000 Bernhard Rosenkraenzer +- Update to v352 + +* Tue Mar 7 2000 Jeff Johnson +- rebuild for sparc baud rates > 38400. + +* Tue Jan 25 2000 Bernhard Rosenkraenzer +- Update to v346 +- Update download URL +- use the configure marcro +- strip binary +- fix up lesspipe stuff (Bug #8750 and a couple of non-reported bugs) + (Karsten, did I mention I'll kill you when you return from SAP? ;) ) + +* Sun Jan 07 2000 Karsten Hopp +- added lesspipe.sh to show listings of package + contents instead of binary output. + +* Fri Aug 27 1999 Preston Brown +- less finally gets maintenance, upgraded to 340 + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 6) + +* Tue Mar 16 1999 Preston Brown +- removed ifarch axp stuff for /bin/more, more now works on alpha properly. + +* Wed Feb 24 1999 Preston Brown +- Injected new description and group. + +* Fri Dec 18 1998 Preston Brown +- bumped spec number for initial rh 6.0 build + +* Thu May 07 1998 Prospector System + +- translations modified for de, fr, tr + +* Wed Apr 08 1998 Cristian Gafton +- updated to 332 and built for Manhattan +- added buildroot + +* Mon Jun 02 1997 Erik Troan +- built against glibc diff --git a/lesspipe.sh b/lesspipe.sh new file mode 100755 index 0000000..5dda022 --- /dev/null +++ b/lesspipe.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# +# To use this filter with less, define LESSOPEN: +# export LESSOPEN="|/usr/bin/lesspipe.sh %s" + +lesspipe() { + case "$1" in + *.1.gz|*.2.gz|*.3.gz|*.4.gz|*.5.gz|*.7.gz|*.8.gz|*.9.gz|*.n.gz|*.man.gz) + if gunzip -c "$1" |file - |grep troff &>/dev/null; then + gunzip -c "$1" |groff -s -p -t -e -Tlatin1 -mandoc - + fi ;; + *.1.bz2|*.2.bz2|*.3.bz2|*.4.bz2|*.5.bz2|*.7.bz2|*.8.bz2|*.9.bz2|*.n.bz2|*.man.bz2) + if bunzip2 -c "$1" |file - |grep troff &>/dev/null; then + bunzip2 -c "$1" |groff -s -p -t -e -Tlatin1 -mandoc - + fi ;; + *.tar) tar tvvf "$1" 2>/dev/null ;; # View contents of .tar and .tgz files + *.tgz) tar tzvvf "$1" 2>/dev/null ;; + *.tar.gz) tar tzvvf "$1" 2>/dev/null ;; + *.tar.bz2) bzip2 -dc "$1" | tar tvvf - 2>/dev/null ;; + *.tar.Z) tar tzvvf "$1" 2>/dev/null ;; + *.tar.z) tar tzvvf "$1" 2>/dev/null ;; + *.Z) gzip -dc "$1" 2>/dev/null ;; # View compressed files correctly + *.z) gzip -dc "$1" 2>/dev/null ;; + *.gz) gzip -dc "$1" 2>/dev/null ;; + *.bz2) bzip2 -dc "$1" 2>/dev/null ;; + *.zip) unzip -l "$1" 2>/dev/null ;; + *.rpm) rpm -qpivl "$1" 2>/dev/null ;; # view contents of .rpm files + *.1|*.2|*.3|*.4|*.5|*.6|*.7|*.8|*.9|*.n|*.man) FILE=`file -L "$1"` ; # groff src + FILE=`echo "$FILE" | cut -d ' ' -f 2` + if [ "$FILE" = "troff" ]; then + groff -s -p -t -e -Tascii -mandoc "$1" + fi ;; + esac +} + +lesspipe "$1" + diff --git a/sources b/sources index e69de29..b7b9cc2 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +692a94060a50dd35a4d65176cb899444 less-358.tar.gz