Summary: A program for handling multimedia mail using the mailcap file.
Summary(ja): mailcap ファイルを使ってマルチメディアメールを扱うプログラム
Name: metamail
Version: 2.7
Release: 29%{?_dist_release}
License: Distributable
Group: Applications/Internet
Source: ftp://ftp.research.telcordia.com/pub/nsb/mm2.7.tar.Z
Patch0: mm-2.7-make.patch
Patch1: mm-2.7-fonts.patch
Patch2: mm-2.7-glibc.patch
Patch3: mm-2.7-csh.patch
Patch4: mm-2.7-uudecode.patch
Patch5: mm-2.7-sunquote.patch
Patch6: mm-2.7-tmpfile.patch
Patch7: mm-2.7-ohnonotagain.patch
Patch8: mm-2.7-arghhh.patch
Patch9: mm-2.7-sml.patch
Patch10: metamail-2.7-nl.patch
Patch11: mm-2.7-linux.patch
Patch12: metamail-2.7-fixpartial.patch
Patch13: metamail-2.7-fixawk.patch
Patch14: metamail-2.7-usesox.patch
Patch15: metamail-2.7-ulf.patch
Patch16: mm2.7-shared.patch
Patch17: mm2.7-richtext.patch
Patch18: mm2.7-Makefile.patch

Requires: mktemp sharutils csh
BuildRequires: libtermcap-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-root


%description
Metamail is a system for handling multimedia mail, using the mailcap
file.  Metamail reads the mailcap file, which tells Metamail what
helper program to call in order to handle a particular type of
non-text mail.  Note that metamail can also add multimedia support to
certain non-mail programs.

Metamail should be installed if you need to add multimedia support to
mail programs and some other programs, using the mailcap file.

%description -l ja
metamail は mailcap ファイルを使ってマルチメディアメールを扱うための
システムです．metamail は，テキストではないメールの各部分を，mailcap 
ファイルを読んでそれぞれどのヘルパーアプリケーションを使って読むかを
決定します．metamail はメール以外のデータを扱うプログラムに
マルチメディアサポートを追加することも出来ます．

mailcap ファイルを使ってメールプログラムやその他のプログラムに
マルチメディアサポートを追加したい場合は，metamail をインストールして
下さい．


%prep
%setup -q -n mm2.7
%patch0 -p1 -b .make
%patch1 -p1 -b .font
%patch2 -p1 -b .glibc
%patch3 -p1 -b .csh
%patch4 -p1 -b .tmpfiles
%patch5 -p1 -b .quote
#%patch6 -p1 -b .tmpagain
%patch7 -p1 -b .sigh
%patch8 -p1 -b .arghhh
%patch9 -p1 -b .sml
%patch10 -p1
%patch11 -p1 -b .linux
%patch12 -p1 -b .fixpartial
%patch13 -p1 -b .fixawk
%patch14 -p1 -b .usesox
pushd src/metamail
%patch15 -p0 -b .ulf
popd
%patch16 -p1 -b .shared
%patch17 -p1 -b .richtext
%patch18 -p1 -b .Makefile


%build
cd src
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS" basics

%install
rm -rf $RPM_BUILD_ROOT
#mkdir -p $RPM_BUILD_ROOT/{usr/bin,usr/lib/metamail/fonts,%{_mandir}/man{1,4}}
mkdir -p $RPM_BUILD_ROOT/{%{_bindir},%{_mandir}/man{1,4}}

cd src
make INSTROOT=$RPM_BUILD_ROOT%{_prefix} \
     MAN1DIR=$RPM_BUILD_ROOT%{_mandir}/man1 \
     MAN4DIR=$RPM_BUILD_ROOT%{_mandir}/man4 \
     install-all || :

# These fonts are now included in XFree86 4.0.2...
#install -m644 fonts/*.pcf %{buildroot}/usr/lib/metamail/fonts
#install -m644 fonts/fonts.alias %{buildroot}/usr/lib/metamail/fonts
#mkfontdir %{buildroot}/usr/lib/metamail/fonts
#rm -fr $RPM_BUILD_ROOT/usr/lib/metamail/fonts


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(755,root,root)
%{_bindir}/audiocompose
%{_bindir}/audiosend
%{_bindir}/extcompose
%{_bindir}/getfilename
%{_bindir}/mailserver
%{_bindir}/mailto
%{_bindir}/mailto-hebrew
%{_bindir}/metamail
%{_bindir}/metasend
%{_bindir}/mimencode
%{_bindir}/mmencode
%{_bindir}/patch-metamail
%{_bindir}/rcvAppleSingle
%{_bindir}/richtext
%{_bindir}/richtoatk
%{_bindir}/showaudio
%{_bindir}/showexternal
%{_bindir}/shownonascii
%{_bindir}/showpartial
%{_bindir}/showpicture
%{_bindir}/sndAppleSingle
%{_bindir}/splitmail
%{_bindir}/sun-audio-file
%{_bindir}/sun-message.csh
%{_bindir}/sun-to-mime
%{_bindir}/sun2mime
%defattr(644,root,root)
%{_mandir}/man1/audiocompose.1*
%{_mandir}/man1/audiosend.1*
%{_mandir}/man1/extcompose.1*
%{_mandir}/man1/getfilename.1*
%{_mandir}/man1/mailto-hebrew.1*
%{_mandir}/man1/mailto.1*
%{_mandir}/man1/metamail.1*
%{_mandir}/man1/metasend.1*
%{_mandir}/man1/mime.1*
%{_mandir}/man1/mimencode.1*
%{_mandir}/man1/mmencode.1*
%{_mandir}/man1/patch-metamail.1*
%{_mandir}/man1/richtext.1*
%{_mandir}/man1/showaudio.1*
%{_mandir}/man1/showexternal.1*
%{_mandir}/man1/shownonascii.1*
%{_mandir}/man1/showpartial.1*
%{_mandir}/man1/showpicture.1*
%{_mandir}/man1/splitmail.1*
#%{_libdir}/metamail


%changelog
* Fri Aug 15 2008 Shu KONNO <owa@bg.wakwak.com> 2.7-29vl5
- applied new versioning policy, spec in utf-8

* Thu Aug 30 2007 Shu KONNO <owa@bg.wakwak.com> 2.7-29vl3
- added Patch16: mm2.7-shared.patch
- added Patch17: mm2.7-richtext.patch
- added Patch18: mm2.7-Makefile.patch

* Tue Mar  2 2004 IWAI, Masaharu <iwai@alib.jp> 2.7-29vl2
- add BuildRequires: libtermcap-devel
- fix changelog: build date in 2.7-29vl1

* Sun Feb 22 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.7-29vl1
- based on 2.7-29 from Redhat AW 2.1 updates
  * Tue Feb 10 2004 Nalin Dahyabhai <nalin@redhat.com> 2.7-29
  - update source URL
  - apply rollup patch from Ulf H辰rnhammar to correct some format-string
    vulnerabilities and buffer overflows (CAN-2004-0104, CAN-2004-0105)
  * Tue Feb 13 2001 Preston Brown <pbrown@redhat.com>
  - remove duplicate fonts (#26862)
  * Thu Feb  1 2001 Preston Brown <pbrown@redhat.com>
  - fix showpartial usage (#16029)
  - use sox to play files with showaudio, if present (#21494)
  - nawk --> gawk for sun2mime (#17429)
- rebuild with new toolchains
- s/Copyright/License/

* Thu Jan 25 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
- 2.7-25vl1
- based on 2.7-25 from Rawhide
- added Japanese summary and description

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

* Sun Jun 18 2000 Matt Wilson <msw@redhat.com>
- use %%{_mandir}
- remove stupid #defines that break building against any sane set of C
  libraries (patch11)

* Sun Feb 06 2000 Preston Brown <pbrown@redhat.com>
- rebuild w/gzipped man pages and new description

* Thu Sep 09 1999 Cristian Gafton <gafton@redhat.com>
- fox the newline parsing for the mailto content-type problem

* Fri Jul 30 1999 Michael K. Johnson <johnsonm@redhat.com>
- changed all instances of /usr/lib/sendmail to /usr/sbin/sendmail [bug #4010]

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

* Fri Dec 18 1998 Cristian Gafton <gafton@redhat.com>
- rebuild against glibc 2.1

* Tue Aug  4 1998 Jeff Johnson <jbj@redhat.com>
- build root

* Tue Jun 23 1998 Alan Cox <alan@redhat.com>
- Here we go again. One more quoting issue.

* Mon Jun 22 1998 Alan Cox <alan@redhat.com>
- If you want to know how not to write secure software
  then metamail is a good worked example. Mind you to
  be fair the original author wrote it as a prototype
  MIME tool and it stuck. Anyway it might actually be
  safe now. More from the Linux Security Audit Project.

* Tue Jun 16 1998 Alan Cox <alan@redhat.com>
- Round and round the tmp fixes go
  Where they stop nobody knows
- More holes in metamail fixed - (Linux Security Audit Project)

* Tue May 19 1998 Prospector System <bugs@redhat.com>
- translations modified for de

* Tue May 19 1998 Alan Cox <alan@redhat.com>
- Fixed the quoting bug in sun mail handling noted by Chris Evans and
  a while back via bugtraq.

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

* Fri Oct 24 1997 Erik Troan <ewt@redhat.com>
- added security fix for uudecode 
- requires mktemp, sharutils

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

* Tue Apr 22 1997 Erik Troan <ewt@redhat.com>
- Added security patch from Olaf for csh escapes.
