%define less_p_vers 1.72 Summary: A text file browser similar to more, but better Name: less Version: 451 Release: %mkrel 2 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.72-posix.patch Patch3: less-382-fixline.patch Patch4: less-443-Foption.patch Patch5: less-445-Foption-fix.patch # 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 cd .. %patch3 -p1 -b .fixline %patch4 -p1 -b .Foption %patch5 -p1 -b .Foption2 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 %if 0 %check cd lesspipe-%less_p_vers # make sure we're testing stuff with new less and not currently installed one export PATH=$PWD/../:$PATH make test %endif %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 * Sat Jan 12 2013 umeabot <umeabot> 451-2.mga3 + Revision: 356752 - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild * Thu Sep 20 2012 tv <tv> 451-1.mga3 + Revision: 296277 - new release - drop useless macros - rediff patch * Sun Jul 01 2012 luigiwalser <luigiwalser> 449-1.mga3 + Revision: 266267 - 449 + colin <colin> - Update to latest fedora patch regarding the -F (quit if one screen) - Fix the -F option to properly count lines before deciding to disable init options. * Sat Jan 28 2012 tv <tv> 445-1.mga2 + Revision: 202500 - new release * Wed Jul 13 2011 ahmad <ahmad> 444-1.mga2 + Revision: 123678 - Update to 444 - Update lesspipe to 1.71 - Rediff patch2 (posix) - Drop patch5, fixed differently upstream - Disable the lesspipe tests, (e.g. one of them requires unrar) + tmb <tmb> - imported package less