Summary: A GNU program for formatting C code.
Name: indent
Version: 2.2.7
Release: 2
Copyright: GPL
Group: Applications/Text
Source: ftp://ftp.gnu.org/pub/gnu/indent-%{version}.tar.gz
URL: http://www.gnu.org/software/indent
Prereq: /sbin/install-info
Prefix: %{_prefix}
BuildRoot: /var/tmp/%{name}-root

%define DEFCC cc

%description
Indent is a GNU program for beautifying C code, so that it is easier to
read.  Indent can also convert from one C writing style to a different
one.  Indent understands correct C syntax and tries to handle incorrect
C syntax.

Install the indent package if you are developing applications in C and
you want a program to format your code.

%prep
%setup -q

%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 [[ "$CC" != "gcc" ]]
then
       export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's:-fsigned-char::'`
fi
export CFLAGS=$RPM_OPT_FLAGS

%configure
make

%install
rm -rf $RPM_BUILD_ROOT

./configure --prefix=${RPM_BUILD_ROOT}%{_prefix}
make prefix=${RPM_BUILD_ROOT}%{_prefix} install

( cd $RPM_BUILD_ROOT
  /usr/bin/strip .%{_prefix}/bin/indent
  gzip -9nf .%{_prefix}/info/indent.info*
)

(cd $RPM_BUILD_ROOT
    mkdir -p usr/linux/bin
    cd usr/linux/bin
    ln -sf ../../..%{_prefix}/bin/* .
    cd -
)

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/install-info %{_prefix}/info/indent.info.gz %{_prefix}/info/dir \
 --entry="* indent: (indent).				Program to format source code."

%preun
if [ "$1" = 0 ]; then

  /sbin/install-info --delete %{_prefix}/info/indent.info.gz \
    %{_prefix}/info/dir \
    --entry="* indent: (indent).                 	 Program to format source code."

fi

%files
%defattr(-,root,root)
%doc AUTHORS COPYING NEWS README
%{_prefix}/bin/indent
%{_prefix}/man/man1/indent.1*
%{_prefix}/info/indent.info*
/usr/linux/bin/indent


%changelog
* Thu Jul 10 2003 David Clissold <cliss@austin.ibm.com>
- Add missing %doc files; switch to IBM VAC compiler for size/performance.

* Wed Jan 30 2002 David Clissold <cliss@austin.ibm.com>
- 2.2.7

* Thu Mar 01 2001 Marc Stephenson <marc@austin.ibm.com>
- 2.2.6

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

* Thu Feb 03 2000 Cristian Gafton <gafton@redhat.com>
- man pages are compressed

* Thu Jan 20 2000 Bill Nottingham <notting@redhat.com>
- 2.2.5

* Mon Jul 26 1999 Bill Nottingham <notting@redhat.com>
- 2.2.0

* Fri Jul 16 1999 Bill Nottingham <notting@redhat.com>
- update to 2.1.1

* Sun May 30 1999 Jeff Johnson <jbj@redhat.com>
- update to 1.10.0.

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

* Fri Dec 18 1998 Bill Nottingham <notting@redhat.com>
- build for 6.0 tree

* Thu Aug 13 1998 Jeff Johnson <jbj@redhat.com>
- build root

* Thu May 07 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr

* Tue Oct 21 1997 Otto Hammersmith <otto@redhat.com>
- use install-info

* Thu Jul 10 1997 Erik Troan <ewt@redhat.com>
- built against glibc
