%define name mutt
%define pversion 1.4.2.1
%define version %{pversion}
%define prefix %{_prefix}

Name:		%{name}
Summary:	A text mode mail user agent.
Version:	%{version}
Release:	1
License:	GPL
Group:		Networking/Mail
URL:		http://www.mutt.org/
Source:		ftp://ftp.mutt.org/pub/mutt/%{name}-%{version}i.tar.gz

# If you use ncurses, mutt doesn't work right in an aixterm.
#Requires:      ncurses >= 5.0
#BuildRequires: ncurses-devel >= 5.0
#BuildConflicts: ncurses, ncurses-devel
Buildroot:	%{_tmppath}/%{name}-buildroot

%define DEFCC cc

%description
Mutt is a text mode mail user agent.  Mutt supports color, threading, arbitrary
key remapping, and a lot of customization.

You should install mutt if you're new to mail programs and you haven't decided
which one you're going to use.

%prep
%setup -q -n %{name}-%{pversion}

%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
CONFIG_SHELL=/opt/freeware/bin/bash
export CONFIG_SHELL

export CFLAGS=$RPM_OPT_FLAGS
configure --prefix=%{_prefix} --with-libdir=%{_libdir} --with-sharedir=%{_sysconfdir} --with-docdir=%{_docdir}/%{name}-%{version} --enable-pop --enable-imap --enable-nfs-fix --without-charmaps
make


%install
[ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot}
mkdir -p %{buildroot}

make install prefix=%{buildroot}%{_prefix} libdir=%{buildroot}%{_libdir} sharedir=%{buildroot}%{_sysconfdir} docdir=%{buildroot}%{_docdir}/%{name}-%{version}

strip $RPM_BUILD_ROOT%{prefix}/bin/* || :

mkdir -p %{buildroot}/etc
cd %{buildroot}%{_sysconfdir}
for file in *; do
  mv $file %{buildroot}/etc
  ln -sf /etc/$file %{buildroot}%{_sysconfdir}
done
cd -

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

%find_lang %{name} 


%files -f %{name}.lang
%defattr(-,root,root)
%config(noreplace) /etc/Muttrc
%config %{_sysconfdir}/Muttrc
%{_mandir}/*/*
%{_bindir}/flea
%{_bindir}/mutt
%{_bindir}/muttbug
%{_bindir}/pgpewrap
%{_bindir}/pgpring
/usr/bin/*
%doc %{_docdir}/*
%defattr(2755,root,mail)
%{_bindir}/mutt_dotlock


%changelog
* Thu May 20 2004 David Clissold <cliss@austin.ibm.com> 1.4.2.1-1
- Update to version 1.4.2.1.

* Wed Jul 09 2003 David Clissold <cliss@austin.ibm.com> 1.4.1-1
- Update to version 1.4.1.

* Tue Jul 08 2003 David Clissold <cliss@austin.ibm.com>
- Switch to build with VisualAge for performance/size.

* Wed Jan 02 2002 David Clissold <cliss@austin.ibm.com>
- Update to 1.2.5.1; contains security fix.

* Wed Apr 18 2001 David Clissold <cliss@austin.ibm.com>
- Binaries weren't being stripped

* Thu Mar 08 2001 Marc Stephenson <marc@austin.ibm.com>
- Add logic for default compiler
- Rebuild against new shared objects

* Mon Feb 19 2001 pkgmgr <pkgmgr@austin.ibm.com>
- Modify for AIX Freeware distribution.
- Based on the 1.3.15i .spec from Mandrake.  Actually packaging 1.2.5i.

* Fri Feb 16 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 1.3.15i-2mdk
- Put a %%dir around the document directory.
- Include the flea utility.

* Tue Feb 13 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 1.3.15i-1mdk
- Put 1.3.15i out for cooker folks.

* Sat Feb 10 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 1.3.14i-1mdk
- Update to 1.3.14 which fixes some major problems with CJK.

* Tue Dec  5 2000 DindinX <odin@mandrakesoft.com> 1.2.5i-7mdk
- requires libncurses5
- buildrequires libncurses5-devel
- use %%make macro

* Sun Dec  3 2000  Daouda Lo <daouda@mandrakesoft.com> 1.2.5i-6mdk
- add color support
- add ssl support
- correct icons handling

* Wed Oct 04 2000 Daouda Lo <daouda@mandrakesoft.com> 1.2.5i-5mdk
- provide icons for menu

* Tue Aug 29 2000 DindinX <odin@mandrakesoft.com> 1.2.5i-4mdk
- Fix the usage of %%lang macro

* Mon Aug 07 2000 Frederic Lepied <flepied@mandrakesoft.com> 1.2.5-3mdk
- automatically added BuildRequires

* Wed Aug  2 2000 Vincent Danen <vdanen@mandrakesoft.com> 1.2.5i-2mdk
- some of us like docs and samples so put them back in
- fix docdir
- more macros

* Sat Jul 29 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 1.2.5i-1mdk
- new version
- macrosifications
- build for the BM

* Fri Jul 07 2000 DindinX <odin@mandrakesoft.com> 1.2.4i-2mdk
- merge Geoffrey Lee's spec changes
- remove /etc/mimes.types from %files which caused a conflit w/ mailcap

* Fri Jul 07 2000 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.2.4i-1mdk
- new release (This version fixes a couple of problems present in 1.2.2, and
  one problem leading to crashes whose fix was missing from 1.2.3.)

* Mon Jun 26 2000 DindinX <odin@mandrakesoft.com> 1.2.2i-3mdk
- put the Serial: tag back

* Fri Jun 23 2000 DindinX <odin@mandrakesoft.com> 1.2.2i-2mdk
- fix the build as user the right way :)

* Thu Jun 22 2000 Vincent Danen <vdanen@linux-mandrake.com> 1.2.2i-1mdk
- 1.2.2i
- removed %defattr which was causing readonly inboxes
- build with ncurses instead of slang to get colors working properly
- removed SSL support (won't compile due to keymaps bug)
- fixed build

* Tue Jun 20 2000 Vincent Danen <vdanen@linux-mandrake.com> 1.2i-2mdk
- enable charmaps in configure
- removed --enable-compressed (no patch)

* Mon Jun 19 2000 Vincent Danen <vdanen@linux-mandrake.com> 1.2i-1mdk
- 1.2i
- enable SSL and NFS fixes in configure

* Wed Apr 27 2000 DindinX <odin@mandrakesoft.com> 1.0.1i-7mdk
- Recompile fix.
- fix the color scheme.

* Wed Apr  5 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 1.0.1i-6mdk
- By default active colors.
- Believe me or not, fix menu and %post.
- Use find_lang macros for locales.

* Tue Apr  4 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 1.0.1i-5mdk
- Fix another chmousucks in menu (yes me too i can believe it).

* Mon Apr  3 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 1.0.1i-4mdk
- Fix chmousucks in menu.
- Add icons in menu.

* Fri Mar 31 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 1.0.1i-3mdk
- Fix menu entry (don't only cp the meny entry from your debian box
  dindin ;)).

* Fri Mar 24 2000 DindinX <odin@mandrakesoft.com> 1.0.1i-2mdk
- Specs and group fixes
- Added menu support

* Sun Feb 06 2000 Andre Steden <andre@steden.de>
- 1.0.1
- add compressed folders patch
- add colour patch

* Sat Nov 06 1999 John Buswell <johnb@mandrakesoft.com>
- Build Release

* Thu Oct 28 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- 1.0.

* Wed Oct  6 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>

- 1.0pre3.

* Mon Aug 09 1999 Daouda LO <daouda@mandrakesoft.com>
 -0.95.7
 -added manual.sgml in documents.

* Sun May 09 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>

- Fix bug of locales.

* Wed Apr 28 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>

- Mandrake adaptations.
- update to 0.99.5.

* Mon Mar  8 1999 Bill Nottingham <notting@redhat.com>
-  update to 0.95.4 - fixes a /tmp race

* Wed Feb 24 1999 Bill Nottingham <notting@redhat.com>
- the RETURN OF WMCONFIG! Aiyeee!

* Fri Feb 12 1999 Bill Nottingham <notting@redhat.com>
- 0.95.3 - fixes mailcap handling

* Mon Jan  4 1999 Bill Nottingham <notting@redhat.com>
- 0.95.1

* Sat Dec 12 1998 Bill Nottingham <notting@redhat.com>
- 0.95

* Fri Jul 31 1998 Bill Nottingham <notting@redhat.com>
- backport some 0.94.2 security fixes
- fix un-setgid
- update to 0.93.2

* Tue Jul 28 1998 Jeff Johnson <jbj@redhat.com>
- security fix
- update to 0.93.1.
- turn off setgid mail.

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

* Tue Apr 21 1998 Cristian Gafton <gafton@redhat.com>
- updated to 0.91.1

* Fri Apr 10 1998 Cristian Gafton <gafton@redhat.com>
- updated to mutt-0.89.1

* Thu Oct 16 1997 Otto Hammersmith <otto@redhat.com>
- Updated to mutt 0.85.
- added wmconfig entries.
- removed mime.types

* Mon Sep 1 1997 Donnie Barnes <djb@redhat.com>
- Rebuilt to insure all sources were fresh and patches were clean.

* Wed Aug 6 1997 Manoj Kasichainula <manojk@io.com>
 - Initial version for 0.81(e)
