Summary: The procmail mail processing program.
Name: procmail
Version: 3.15.1
Release: 1
Copyright: distributable
Group: System Environment/Daemons
Source: ftp://ftp.procmail.org/pub/procmail/procmail-%{version}.tar.gz
URL: http://www.procmail.org
Patch0: %{name}-%{version}-aix.patch
Prefix: %{_prefix}
BuildRoot: %{_tmppath}/%{name}-root
%ifarch ia64
%define DEFCCIA cc
%define DEFCC %{DEFCCIA}
%else
%define DEFCC cc
%endif

%description
Procmail can be used to create mail-servers, mailing lists, sort your incoming
mail into separate folders/files (real convenient when subscribing to one or
more mailing lists or for prioritising your mail), preprocess your mail, start
any programs upon mail arrival (e.g. to generate different chimes on your
workstation for different types of mail) or selectively forward certain
incoming mail automatically to someone.


%prep
%setup -q
%patch0 -p1 -b .aix
find . -type d -exec chmod 755 {} \;

%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::'`
       export CFLAGS="$RPM_OPT_FLAGS"
fi
make CC="$CC" CFLAGS0="$RPM_OPT_FLAGS" LOCKINGTEST="/tmp ."

%install
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1
mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man5

make \
    BASENAME=${RPM_BUILD_ROOT}%{_prefix} MANDIR=${RPM_BUILD_ROOT}%{_mandir} \
	install

/usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || :

mkdir -p ${RPM_BUILD_ROOT}/usr/bin
cd ${RPM_BUILD_ROOT}/usr/bin
ln -sf ../..%{_bindir}/* .
cd -

%clean
rm -rf ${RPM_BUILD_ROOT}

%files
%defattr(-,root,root)
%doc FAQ HISTORY README KNOWN_BUGS FEATURES examples

/usr/bin/*
%{_bindir}/formail
%attr(2755,root,mail)	%{_bindir}/lockfile
%{_bindir}/mailstat
%attr(6755,root,mail)	%{_bindir}/procmail

%{_mandir}/man[15]/*

%changelog
* Thu May 24 2001 Marc Stephenson <marc@austin.ibm.com>
- Upgrade to 3.15
- Use default compiler
- Modify system defaults

* Thu Feb 22 2001 pkgmgr <pkgmgr@austin.ibm.com>
- Modify for AIX freeware distribution.  Based on RedHat SRPM.

* Fri Aug 11 2000 Jeff Johnson <jbj@redhat.com>
- add space in delivery rules with '!' (#15947).

* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Thu Jun 15 2000 Jeff Johnson <jbj@redhat.com>
- FHS packaging.

* Mon Feb  7 2000 Jeff Johnson <jbj@redhat.com>
- compress man pages.

* Fri Jan 14 2000 Jeff Johnson <jbj@redhat.com>
- update to 3.14.

* Mon Aug 16 1999 Bill Nottingham <notting@redhat.com>
- fix doc perms.

* Wed Apr 21 1999 Cristian Gafton <gafton@redhat.com>
- turn on GROUP_PER_USER
- add some docs to the package

* Mon Apr 05 1999 Cristian Gafton <gafton@redhat.com>
- version 3.13

* Fri Mar 26 1999 Cristian Gafton <gafton@redhat.com>
- fixed Group line

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

* Sun Aug 16 1998 Jeff Johnson <jbj@redhat.com>
- build root

* Mon Apr 27 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr

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