Summary: A text file browser similar to more, but better.
Name: less
Version: 382
Release: 1
License: IBM_ILA
Group: Applications/Text
Source: http://www.flash.net/~marknu/less/%{name}-%{version}.tar.gz
Source1: IBM_ILA
URL: http://www.flash.net/~marknu/less/
Buildroot: /var/tmp/less-root

%define DEFCC cc

%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

# Add license info
cat $RPM_SOURCE_DIR/IBM_ILA > LICENSE.new
cat LICENSE >> LICENSE.new
mv LICENSE.new LICENSE

%build
# Use the default compiler for this platform - gcc otherwise
if [[ -z "$CC" ]]
then
    if test "X`type %{DEFCC} 2>/dev/null`" != 'X'; then
       export CC=%{DEFCC}
    else
       export CC=gcc
    fi
fi
if test "X$CC" != "Xgcc"
then
       export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's:-fsigned-char::'`
       if test "X$CC" = "Xcc"
       then
	  # Workaround compiler bug
          export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's:-O2::'`
       fi
       export CFLAGS="$RPM_OPT_FLAGS"
fi
%define optflags $RPM_OPT_FLAGS
%configure
make

%install
rm -rf $RPM_BUILD_ROOT
make install prefix=$RPM_BUILD_ROOT%{_prefix} \
     exec_prefix=$RPM_BUILD_ROOT%{_prefix} \
     bindir=$RPM_BUILD_ROOT%{_prefix}/bin \
     mandir=$RPM_BUILD_ROOT%{_prefix}/man
#strip -R .comments $RPM_BUILD_ROOT%{_prefix}/bin/less
/usr/bin/strip $RPM_BUILD_ROOT/%{_prefix}/bin/less*
mkdir -p $RPM_BUILD_ROOT/usr/bin
cd $RPM_BUILD_ROOT/usr/bin
ln -s ../..%{_prefix}/bin/* .

%files
%defattr(-,root,system)
%doc LICENSE
/usr/bin/*
%{_prefix}/bin/*
%{_prefix}/man/man1/*

%clean
rm -rf $RPM_BUILD_ROOT

%changelog
* Fri Aug 19 2005 David Clissold <cliss@austin.ibm.com> 382-1
- Update to version 382.

* Fri Nov 22 2002 David Clissold <cliss@austin.ibm.com>
- Add IBM ILA license.

* Mon Apr 29 2002 David Clissold <cliss@austin.ibm.com>
- Update to less version 374

* Tue Mar 27 2001 Marc Stephenson <marc@austin.ibm.com>
- Workaround cc optimization problem on IA64

* Wed Mar 21 2001 Marc Stephenson <marc@austin.ibm.com>
- Rebuild against new shared objects
- Use default compiler

* Fri Oct 27 2000 pkgmgr <pkgmgr@austin.ibm.com>
- Modify for AIX Freeware distribution

* Tue Mar  7 2000 Jeff Johnson <jbj@redhat.com>
- rebuild for sparc baud rates > 38400.

* Tue Jan 25 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- 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 <karsten@redhat.de>
- added lesspipe.sh to show listings of package
  contents instead of binary output.

* Fri Aug 27 1999 Preston Brown <pbrown@redhat.com>
- less finally gets maintenance, upgraded to 340

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com>
- auto rebuild in the new build environment (release 6)

* 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
