%define name less %define version 418 %define less_p_vers 1.60 Summary: A text file browser similar to more, but better Name: %{name} Version: %{version} Release: %mkrel 6 License: GPLv3+ or BSD-like Url: http://www.greenwoodsoftware.com/less Group: File tools BuildRequires: libncursesw-devel Source0: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz Source1: faq_less.html Source2: http://www-zeuthen.desy.de/~friebel/unix/less/lesspipe-%{less_p_vers}.tar.gz Patch0: less-374-manpages.patch Patch2: lesspipe-1.60-posix.patch Patch3: less-382-fixline.patch Patch4: less-392-Foption.patch #gw we don't have o3read, use the filter that comes with lesspipe Patch5: lesspipe-1.60-no-o3read.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot # lesspipe.sh requires file Requires: file Suggests: html2text %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 -a 2 %patch0 -p1 cd lesspipe-%less_p_vers %patch2 -p1 %patch5 -p1 cd .. %patch3 -p1 -b .fixline %patch4 -p1 -b .Foption chmod a+r lesspipe-%less_p_vers/* cp lesspipe-%less_p_vers/README README.lesspipe %build CFLAGS=$(echo "%{optflags} -DHAVE_LOCALE" | sed -e s/-fomit-frame-pointer//) %configure2_5x %make cd lesspipe-%less_p_vers ./configure --yes cd .. %install rm -rf %{buildroot} %makeinstall # faq install -m 644 %{SOURCE1} . cd lesspipe-%less_p_vers %makeinstall PREFIX=%{buildroot}%{_prefix} cd .. mkdir -p %buildroot%_sysconfdir/profile.d/ cat << EOF > %buildroot%_sysconfdir/profile.d/20less.sh CHARSET=\$(locale charmap 2> /dev/null) case "\$CHARSET" in UTF-8) export LESSCHARSET="\${LESSCHARSET:-utf-8}" ;; * ) export LESSCHARSET="\${LESSCHARSET:-koi8-r}" ;; esac # Make a filter for less export LESSOPEN="|/usr/bin/lesspipe.sh %s" EOF cat << EOF > %buildroot%_sysconfdir/profile.d/20less.csh if ! ( \$?LESSCHARSET ) then set CHARSET=\`locale charmap\` if ( "\$CHARSET" == "UTF-8" ) then setenv LESSCHARSET utf-8 else setenv LESSCHARSET koi8-r endif endif # Make a filter for less setenv LESSOPEN "|/usr/bin/lesspipe.sh %s" EOF cat << EOF > README.urpmi This version of less includes lesspipe.sh from Wolfgang Friebel ( http://www-zeuthen.desy.de/~friebel//unix/less/ ). This enables you to view gz, bz2, lzma, zip, rpm and html files among others with less. It works by setting the LESSOPEN environment variable, see the man pages for details. If you want to disable this behavior, either use 'unset LESSOPEN' or use an alias ( alias less='less -l' ). less will open html files with lynx, then html2text, then cat if none of the previous were found. EOF install -m644 lessecho.1 %{buildroot}%{_mandir}/man1 %check cd lesspipe-%less_p_vers make test %clean rm -rf %{buildroot} %files %defattr(-,root,root) %doc README NEWS README.lesspipe %doc faq_less.html lesspipe-%less_p_vers/{ChangeLog,german.txt,TODO} %doc README.urpmi %attr(755,root,root) %{_bindir}/* %{_mandir}/man1/* %{_sysconfdir}/profile.d/* %changelog * Mon Apr 06 2009 Funda Wang <fundawang@mandriva.org> 418-6mdv2009.1 + Revision: 364389 - suggests html2text for displaying html content * Tue Dec 02 2008 Götz Waschk <waschk@mandriva.org> 418-5mdv2009.1 + Revision: 309057 - new lesspipe 1.6.0 - update patches 2,5 - update documentation * Thu Aug 14 2008 Götz Waschk <waschk@mandriva.org> 418-4mdv2009.0 + Revision: 271984 - lesspipe 1.55 - update patch 5 - drop patch 6 * Mon Jul 28 2008 Götz Waschk <waschk@mandriva.org> 418-3mdv2009.0 + Revision: 251026 - lesspipe 1.54 - drop patch 1 (lesspipe now prefers links for html) * Tue Jun 17 2008 Thierry Vignaud <tvignaud@mandriva.com> 418-2mdv2009.0 + Revision: 222385 - rebuild * Wed Jan 23 2008 Gustavo De Nardin <gustavodn@mandriva.com> 418-1mdv2008.1 + Revision: 157090 - new version 418 (probably fixes bug #35182) - license change: "GPLv2+" -> "GPLv3+ or BSD-like" (Less license, like "FreeBSD BSD Variant (2 clause BSD)", without requirement to reproduce list of conditions and the disclaimer) * Sat Dec 22 2007 Guillaume Rousse <guillomovitch@mandriva.org> 416-3mdv2008.1 + Revision: 136997 - rename README.mdk into README.urpmi - no executable bit on profile scriptlets order prefix on profile scriptlets + Olivier Blin <oblin@mandriva.com> - restore BuildRoot + Thierry Vignaud <tvignaud@mandriva.com> - kill re-definition of %%buildroot on Pixel's request * Tue Nov 27 2007 Funda Wang <fundawang@mandriva.org> 416-1mdv2008.1 + Revision: 113446 - New version 416 - drop UTF-8 patch (merged upstream) - Build against ncursesw * Thu Nov 22 2007 Thierry Vignaud <tvignaud@mandriva.com> 415-2mdv2008.1 + Revision: 111277 - patch 7: fix crash on UTF-8 files (#35710) * Fri Nov 16 2007 Funda Wang <fundawang@mandriva.org> 415-1mdv2008.1 + Revision: 109082 - update to new version 415 * Sun Oct 14 2007 Gustavo De Nardin <gustavodn@mandriva.com> 409-1mdv2008.1 + Revision: 98231 - new version 409, fixes an UTF-8 related crash when searching * Fri Oct 12 2007 Thierry Vignaud <tvignaud@mandriva.com> 408-1mdv2008.1 + Revision: 97436 - new release - update URL * Mon Jul 09 2007 Funda Wang <fundawang@mandriva.org> 406-1mdv2008.0 + Revision: 50443 - New version * Thu Jun 07 2007 Per Ãyvind Karlsen <peroyvind@mandriva.org> 403-2mdv2008.0 + Revision: 36721 - bump - fix lzma patch * Thu May 31 2007 Götz Waschk <waschk@mandriva.org> 403-1mdv2008.0 + Revision: 33458 - new version - unpack patches * Fri May 04 2007 Per Ãyvind Karlsen <peroyvind@mandriva.org> 394-5mdv2008.0 + Revision: 22159 - add support for lzma (P6) - Import less * Wed Sep 20 2006 Nicolas Lécureuil <neoclust@mandriva.org> 394-4mdv2007.0 - Rebuild against ncurse * Wed Apr 12 2006 Götz Waschk <waschk@mandriva.org> 394-3mdk - improve lesspipe configuration * Tue Apr 11 2006 Götz Waschk <waschk@mandriva.org> 394-2mdk - rediff patch 2 - lesspipe 1.53 * Thu Dec 15 2005 Thierry Vignaud <tvignaud@mandriva.com> 394-1mdk - new release * Tue Oct 25 2005 Per Ãyvind Karlsen <pkarlsen@mandriva.com> 392-1mdk - 392 (fixes #18754 - add fedora patches: o fix displaying of bogus newline for growing files (P3) o fix the -F option (P4) - %%mkrel - cosmetics * Tue Jul 19 2005 Götz Waschk <waschk@mandriva.org> 382-12mdk - lesspipe 1.52 * Thu May 26 2005 Götz Waschk <waschk@mandriva.org> 382-11mdk - use lesspipe's included man page - lesspipe 1.51 * Fri Apr 22 2005 Götz Waschk <waschk@mandriva.org> 382-10mdk - move LESSOPEN variable to the profile.d scripts - remove less wrapper, add profile.d scripts (fixes bug #15413) - lesspipe 1.50 * Wed Mar 16 2005 Michael Scherer <misc@mandrake.org> 382-9mdk - really fix #14521, this time for real. * Sun Mar 13 2005 Michael Scherer <misc@mandrake.org> 382-8mdk - really fix #14521 * Sat Mar 12 2005 Michael Scherer <misc@mandrake.org> 382-7mdk - do not force koi8 charset on UTF-8, patch from <arvidjaar@mail.ru> - fix summary-ended-with-dot * Fri Jan 7 2005 Warly <warly@mandrakesoft.com> 382-6mdk - Fix lesspipe.sh for new /bin/sh POSIX compliance (trap PIPE no longer valid) * Thu May 06 2004 Michael Scherer <misc@mandrake.org> 382-5mdk - fixes on README.mdk, thanks to Rafael Garcia-Suarez * Thu May 06 2004 Michael Scherer <misc@mandrake.org> 382-4mdk - added patch #1, thanks to Robert Vojta - added a README.mdk * Mon Apr 19 2004 Michael Scherer <misc@mandrake.org> 382-3mdk - update lesspipe to 1.42 - rebuild for new libcurses * Tue Apr 06 2004 Michael Scherer <misc@mandrake.org> 382-2mdk - update lessopen.sh, use the tarball with all option if possible * Tue Apr 06 2004 Thierry Vignaud <tvignaud@mandrakesoft.com> 382-1mdk - new release * Sun Jun 15 2003 Stefan van der Eijk <stefan@eijk.nu> 381-2mdk - BuildRequires * Tue Feb 04 2003 Thierry Vignaud <tvignaud@mandrakesoft.com> 381-1mdk - new release * Thu Jan 02 2003 Thierry Vignaud <tvignaud@mandrakesoft.com> 378-2mdk - build release * Thu Oct 10 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 378-1mdk - new release * Wed Aug 14 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 376-3mdk - Automated rebuild with gcc 3.2-0.3mdk * Tue Jul 16 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 376-2mdk - requires file for lord gnome * Tue Jul 16 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 376-1mdk - new release - update lesspipe.sh from 1.33 to 1.34 - requires less for lord gnome - drop patch1 * Thu Apr 25 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 374-4mdk - use koi8-r as default charset since this is the closest charset to an raw charset * Wed Apr 24 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 374-3mdk - really use utf-8 only by default, so that we don't overwrite $LESSCHARSET (escape $) - "exec less.bin" instead of "less.bin; return $?" * Mon Apr 22 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 374-2mdk - less: $LESSCHARSET - to screen.c: properly sets raw mode if stderr is redirected to /dev/null [Patch1] * Mon Apr 15 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 374-1mdk - new release - utf8 overstriking fix has been merged upstream, dropping patch0 - upgrade to lesspipe.sh-1.33 - add Url - add less{echo,pipe}(1) man pages * Fri Jul 20 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 358-14mdk - Don't hardcode /usr/bin in the less wrapper script (pixel). * Sat Jun 23 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 358-13mdk - Put double quotes around the definition of the LESSCHARSET variable in the hope that we can the tcltk build. * Thu May 03 2001 Pablo Saratxaga <pablo@mandrakesoft.com> 358-12mdk - improved the utf8 patch so it also works for underscores * Thu May 03 2001 Pablo Saratxaga <pablo@mandrakesoft.com> 358-11mdk - improved the utf8 patch so it also works for underscores * Fri Apr 20 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 358-10mdk - Fix the script (oh silly me). * Fri Apr 20 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 358-9mdk - Wrapper script to define LESSCHARSET=utf-8 before running less. * Sun Apr 08 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 358-8mdk - Make it build without -fomit-frame-pointer to get -DHAVE_LOCALE support, or else we get a segfault. * Sun Apr 1 2001 Chmouel Boudjnah <chmouel@mandrakesoft.com> 358-7mdk - By default don't render .html file in lesspipe. * Fri Jan 12 2001 Frederic Crozat <fcrozat@mandrakesoft.com> 358-6mdk - Rebuild against last ncurses * Thu Jan 4 2001 Chmouel Boudjnah <chmouel@mandrakesoft.com> 358-5mdk - Improve lesspipe.sh and don't make depend of file rpm. * Sat Aug 26 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 358-4mdk - Add lesspipe.sh here. * Mon Aug 07 2000 Frederic Lepied <flepied@mandrakesoft.com> 358-3mdk - automatically added BuildRequires * Thu Jul 27 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 358-2mdk - rebuild for BM * Wed Jul 12 2000 Thierry Vignaud <tvignaud@mandrakesoft.com> 358-1mdk - new release - use more macros * Thu Jun 29 2000 Pablo Saratxaga <pablo@mandrakesoft.com> 346-2mdk - added UTF-8 patch from Alastair.McKinstry@compaq.com - modularized path names * Mon Jun 26 2000 Thierry Vignaud <tvignaud@mandrakesoft.com> 346-1mdk - new release * Fri Mar 31 2000 Jerome Dumonteil <jd@mandrakesoft.com> - use of _tmppath _prefix - change copyright *Mon Nov 01 1999 Vincent Saugey <vincent@mandrakesoft.com> - add faq page to /usr/doc * Wed Oct 20 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com> - 340. * Sat Apr 10 1999 Bernhard Rosenkraenzer <bero@linux-mandrake.com> - Update to 337 - Fix up URL - Mandrake adaptions - bzip2 man/info pages - add de locale - relocatable * Tue Mar 16 1999 Preston Brown <pbrown@redhat.com> - removed ifarch axp stuff for /bin/more, more now works on alpha properly. * Wed Feb 24 1999 Preston Brown <pbrown@redhat.com> - Injected new description and group. * Fri Dec 18 1998 Preston Brown <pbrown@redhat.com> - bumped spec number for initial rh 6.0 build * Thu May 07 1998 Prospector System <bugs@redhat.com> - translations modified for de, fr, tr * Wed Apr 08 1998 Cristian Gafton <gafton@redhat.com> - updated to 332 and built for Manhattan - added buildroot * Mon Jun 02 1997 Erik Troan <ewt@redhat.com> - built against glibc