Summary: A MIDI sound file player.
Summary(ja): MIDI 音源ファイルプレーヤ
Name: playmidi
Version: 2.4
Release: 14%{?_dist_release}
Source: ftp://ftp.linpeople.org/pub/People/nathan/playmidi-2.4.tar.gz
Source2: awe_voice.h
License: GPL2
Group: Applications/Multimedia
Patch0: playmidi-2.3-hertz.patch
Patch1: playmidi-2.3-awe2.patch
Patch2: playmidi-2.4-make.patch
Patch3: playmidi-2.4-midimap.patch

BuildRequires: XOrg-devel ncurses-devel
Buildroot: %{_tmppath}/%{name}-%{version}-root

%description
Playmidi plays MIDI (Musicial Instrument Digital Interface) sound
files through a sound card synthesizer.  This package includes basic
drum samples for use with simple FM synthesizers.

Install playmidi if you want to play MIDI files using your computer's
sound card.
#'

%package X11
Summary: An X Window System Interface based MIDI sound file player.
Requires: playmidi = %{version}
Requires: XOrg-libs
Group: Applications/Multimedia

%description X11
Playmidi-X11 provides an X Window System interface for playing MIDI
(Musical Instrument Digital Interface) sound files through a sound
card synthesizer.  This package includes basic drum samples for use
with simple FM synthesizers.

Install playmidi-X11 if you want to use an X interface to play MIDI
sound files using your computer's sound card.
#'

%prep
%setup -q
cp $RPM_SOURCE_DIR/awe_voice.h .
%patch0 -p1 -b .consthertz
%patch1 -p1 -b .awe2
%patch2 -p1 -b .make
%patch3 -p1 -b .midimap


%build
PATH=.:$PATH
%ifarch x86_64
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS" \
	LIBX11="-L%{_libdir} -lXaw -lXmu -lXt -lX11 -lXext -lSM -lICE" \
	playmidi xplaymidi <<EOF
2
EOF
%else
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS" playmidi xplaymidi <<EOF
2
EOF
%endif


%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc/midi
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_libdir}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/X11/app-defaults
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1

install -s -m 755 playmidi xplaymidi $RPM_BUILD_ROOT%{_bindir}
install -m 644 XPlaymidi.ad $RPM_BUILD_ROOT%{_datadir}/X11/app-defaults/XPlaymidi
install -m 644 playmidi.1 $RPM_BUILD_ROOT%{_mandir}/man1

mkdir -p $RPM_BUILD_ROOT/etc/midi
for n in std.o3 drums.o3 std.sb drums.sb
do
	install -m 644 $n $RPM_BUILD_ROOT/etc/midi/$n
done


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)
%doc BUGS COPYING QuickStart README* *.mid techref/
%{_bindir}/playmidi 
%config /etc/midi/std.o3
%config /etc/midi/std.sb
%config /etc/midi/drums.o3
%config /etc/midi/drums.sb
%{_mandir}/man1/playmidi.*

%files X11
%defattr(-,root,root)
%{_bindir}/xplaymidi
%config %{_datadir}/X11/app-defaults/XPlaymidi


%changelog
* Sun Nov 09 2008 Shu KONNO <owa@bg.wakwak.com> 2.4-14vl5
- rebuild with libXaw.so.7 (libXaw-1.0.5)

* Thu Oct 09 2008 Shu KONNO <owa@bg.wakwak.com> 2.4-13vl5
- applied new versioning policy, spec in utf-8
- modified X11 paths

* Fri Dec 28 2007 Shu KONNO <owa@bg.wakwak.com> - 2.4-12vl4
- added option LIBX11 to make (for x86_64)

* Fri Jan 28 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.4-12vl3
- rebuild with new toolchains
- added BuildRequires: XOrg-devel ncurses-devel
- added Requires: XOrg-libs to X11 subpackage 
- s/Copyright/License/

* Fri Nov 16 2001 Jun Nishii <jun@vinelinux.org>
- 2.4-12vl2
- added some files in %doc

* Mon Dec 18 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
- 2.4-12vl1
- based on 2.4-12 on rawhide
- rebuild for Vine Linux with ncurses5

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

* Sat Jun 10 2000 Bill Nottingham <notting@redhat.com>
- rebuild, FHS stuff

* Mon Mar  3 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- rebuild with current ncurses

* Thu Feb  3 2000 Bill Nottingham <notting@redhat.com>
- handle compressed man pages

* Thu Jul 15 1999 Bill Nottingham <notting@redhat.com>
- don't ship splaymidi

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

* Tue Feb 23 1999 Bill Nottingham <notting@redhat.com>
- wmconfig goes away

* Mon Dec 28 1998 Bill Nottingham <notting@redhat.com>
- build against glibc-2.1

* Mon Nov 23 1998 Bill Nottingham <notting@redhat.com>
- oops. We broke FM synth. Fixed.

* Sat Oct 10 1998 Cristian Gafton <gafton@redhat.com>
- strip binaries
- updated to version 2.4

* Wed Sep  9 1998 Bill Nottingham <notting@redhat.com>
- added AWE32 support

* Mon Aug 17 1998 Jeff Johnson <jbj@redhat.com>
- build root
- sound font data in /etc/midi

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

* Wed Apr 15 1998 Erik Troan <ewt@redhat.com>
- built against new ncurses

* Tue Oct 21 1997 Otto Hammersmith <otto@redhat.com>
- added wmconfig entries

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