Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > by-pkgid > f09b0d4b13db38113c0d8a7ea0c8f2f2 > files > 17

xmame-0.58.2-1mdk.src.rpm

%define fversion 0.58.2

%define buildx11	1
%define buildSDL	1
%define buildsvgalib	1
%define buildxgl	0
%define buildxfx	1
%define buildsvgafx	1

# virtual package to enforce naming convention
#
Summary:	X-Mame Arcade Game Emulator
Name:		xmame
Version:	%fversion
Release:	1mdk

Source:		http://x.mame.net/download/%name-%fversion.tar.bz2
Source1:	%name-16x16.png
Source2:	%name-32x32.png
Source3:	%name-48x48.png
Source4:	%name-rc.tar.bz2

Source10:	http://www.mame.net/roms/polyplay.zip
Source11:	http://www.mame.net/roms/robby.zip
Source12:	http://www.mame.net/roms/gridlee.zip

Source20:	http://www.sys2064.com/files/mame/unoff_hsdat7.9.zip
Source21:	http://www.sys2064.com/files/mame/cheat.zip
Source22:       http://www.mameworld.net/mameinfo/download/Mameinfo382.zip
Source23:	http://fandemame.rcroms.com/Téléchargement/history.dat0.57d.zip

Patch10:	%name-0.56.1-upx.patch.bz2
Patch11:	%name-0.58.2-makefile.patch.bz2
# I have no idea what this one does and if it's still necessary
Patch12:	xmame-mamex.patch.bz2
#               work in progress to port from glide2.46 to glide3
Patch13:        xmame-glide.patch.bz2

License:	MAME
URL:		http://x.mame.net/
Group:		Emulators
ExclusiveArch:	%{ix86}
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildRequires:	nasm esound-devel XFree86-devel zlib-devel upx

%description
X-Mame the UNIX/X11 port of Mame project.
It makes Mame arcade emulator available on *ix machines using the
X11R6 X-Window system (and Linux ones using SVGAlib too).

Mame is a virtual machine emulator: it includes a Z80, 6502, 68000 and
lastly I86 uP emulators, joined to several arcade machine hardware
emulators. Each arcade emulator contains a full description about
hardware, mem maps, video, sounds and so, making possible that if
you have original ROM images of a supported arcade game, you can
play the game.


# base 

%package -n %{name}-base
Summary: X-Mame Arcade Game Emulator compiled for x11
Group:         Emulators
Requires:      xmame >= 0.37b15.1-2mdk
Obsoletes:     xmame <= 0.37b13.2-1mdk

%description -n %{name}-base
X-Mame the UNIX/X11 port of Mame project.
It makes Mame arcade emulator available on *ix machines using the
X11R6 X-Window system (and Linux ones using SVGAlib too).

Mame is a virtual machine emulator: it includes a Z80, 6502, 68000 and
lastly I86 uP emulators, joined to several arcade machine hardware
emulators. Each arcade emulator contains a full description about
hardware, mem maps, video, sounds and so, making possible that if
you have original ROM images of a supported arcade game, you can
play the game.

This package has the high scores, the mamedat, cheats.


# x11 target
%if %buildx11
%package -n %{name}-x11
Summary: X-Mame Arcade Game Emulator compiled for x11
Group:         Emulators
PreReq:        /usr/sbin/update-alternatives
Provides:      %{name}
Requires:      %{name}-base XFree86-libs
Obsoletes:     xmame <= 0.37b13.2-1mdk

%description -n %{name}-x11
X-Mame the UNIX/X11 port of Mame project.
It makes Mame arcade emulator available on *ix machines using the
X11R6 X-Window system (and Linux ones using SVGAlib too).

Mame is a virtual machine emulator: it includes a Z80, 6502, 68000 and
lastly I86 uP emulators, joined to several arcade machine hardware
emulators. Each arcade emulator contains a full description about
hardware, mem maps, video, sounds and so, making possible that if
you have original ROM images of a supported arcade game, you can
play the game.

This version has been compiled with X11 support.
A separate binary without the 68000 asm core is provided in a separate
binary (xmame.x11). Try it if your game does not work well.
If using dga you end up with a messed-up screen, check that XF86Config-4
has 'Load "extmod"' in the module section.
%endif

# xgl target
%if %buildxgl
%package -n %{name}-xgl
Summary: X-Mame Arcade Game Emulator compiled for OpenGL
Group:         Emulators
PreReq:        /usr/sbin/update-alternatives
BuildRequires: Mesa-common-devel libjpeg-devel
Provides:      %{name}
Requires:      %{name}-base
Obsoletes:     xmame <= 0.37b13.2-1mdk

%description -n %{name}-xgl
X-Mame the UNIX/X11 port of Mame project.
It makes Mame arcade emulator available on *ix machines using the
X11R6 X-Window system (and Linux ones using SVGAlib too).

Mame is a virtual machine emulator: it includes a Z80, 6502, 68000 and
lastly I86 uP emulators, joined to several arcade machine hardware
emulators. Each arcade emulator contains a full description about
hardware, mem maps, video, sounds and so, making possible that if
you have original ROM images of a supported arcade game, you can
play the game.

This version has been compiled with OpenGL support.
A separate binary without the 68000 asm core is provided in a separate
binary (xmame.xgl). Try it if your game does not work well.
If using dga you end up with a messed-up screen, check that XF86Config-4
loads extmod, dri and glx in the module section, and that your kernel is loaded
with agpgart along with either mga, tdfx, radeon, gamma, i810 or r128 depending
on your card.
%endif

# svgalib target
%if %buildsvgalib
%package -n %{name}-svgalib
Summary: X-Mame Arcade Game Emulator compiled for SVGA lib
Group:         Emulators
PreReq:        /usr/sbin/update-alternatives
BuildRequires: svgalib-devel
Provides:      %{name}
Requires:      %{name}-base svgalib
Obsoletes:     xmame <= 0.37b13.2-1mdk

%description -n %{name}-svgalib
X-Mame the UNIX/X11 port of Mame project.
It makes Mame arcade emulator available on *ix machines using the
X11R6 X-Window system (and Linux ones using SVGAlib too).

Mame is a virtual machine emulator: it includes a Z80, 6502, 68000 and
lastly I86 uP emulators, joined to several arcade machine hardware
emulators. Each arcade emulator contains a full description about
hardware, mem maps, video, sounds and so, making possible that if
you have original ROM images of a supported arcade game, you can
play the game.

This version has been compiled with SVGA lib support.
A separate binary without the 68000 asm core is provided in a separate
binary (xmame.svgalib). Try it if your game does not work well.
%endif

# SDL target
%if %buildSDL
%package -n %{name}-SDL
Summary: X-Mame Arcade Game Emulator compiled for SDL
Group:         Emulators
PreReq:        /usr/sbin/update-alternatives
BuildRequires: libSDL1.2-devel
Provides:      %{name}
Requires:      %{name}-base libSDL1.2
Obsoletes:     xmame <= 0.37b13.2-1mdk

%description -n %{name}-SDL
X-Mame the UNIX/X11 port of Mame project.
It makes Mame arcade emulator available on *ix machines using the
X11R6 X-Window system (and Linux ones using SVGAlib too).

Mame is a virtual machine emulator: it includes a Z80, 6502, 68000 and
lastly I86 uP emulators, joined to several arcade machine hardware
emulators. Each arcade emulator contains a full description about
hardware, mem maps, video, sounds and so, making possible that if
you have original ROM images of a supported arcade game, you can
play the game.

This version has been compiled with SDL support.
A separate binary without the 68000 asm core is provided in a separate
binary (xmame.SDL). Try it if your game does not work well.
%endif

# Glide/X11 target
%if %buildxfx
%package -n %{name}-xfx
Summary: X-Mame Arcade Game Emulator compiled for 3Dfx cards with X11
Group:         Emulators
PreReq:        /usr/sbin/update-alternatives
BuildRequires: Glide_V3 Glide_V3-devel
Provides:      %{name}
Requires:      %{name}-base Glide_V3
Obsoletes:     xmame <= 0.37b13.2-1mdk

%description -n %{name}-xfx
X-Mame the UNIX/X11 port of Mame project.
It makes Mame arcade emulator available on *ix machines using the
X11R6 X-Window system (and Linux ones using SVGAlib too).

Mame is a virtual machine emulator: it includes a Z80, 6502, 68000 and
lastly I86 uP emulators, joined to several arcade machine hardware
emulators. Each arcade emulator contains a full description about
hardware, mem maps, video, sounds and so, making possible that if
you have original ROM images of a supported arcade game, you can
play the game.

This version has been compiled with voodoo/X11 support for voodoo3
only.
A separate binary without the 68000 asm core is provided in a separate
binary (xmame.xfx). Try it if your game does not work well.
%endif

# Glide/svgalib target
%if %buildsvgafx
%package -n %{name}-svgafx
Summary: X-Mame Arcade Game Emulator compiled for 3Dfx cards with X11
Group:         Emulators
PreReq:        /usr/sbin/update-alternatives
BuildRequires: Glide_V3 Glide_V3-devel
Provides:      %{name}
Requires:      %{name}-base Glide_V3
Obsoletes:     xmame <= 0.37b13.2-1mdk

%description -n %{name}-svgafx
X-Mame the UNIX/X11 port of Mame project.
It makes Mame arcade emulator available on *ix machines using the
X11R6 X-Window system (and Linux ones using SVGAlib too).

Mame is a virtual machine emulator: it includes a Z80, 6502, 68000 and
lastly I86 uP emulators, joined to several arcade machine hardware
emulators. Each arcade emulator contains a full description about
hardware, mem maps, video, sounds and so, making possible that if
you have original ROM images of a supported arcade game, you can
play the game.

This version has been compiled with voodoo/svgalib support.
A separate binary without the 68000 asm core is provided in a separate
binary (xmame.svgafx). Try it if your game does not work well.
%endif

%prep
rm -rf %buildroot


%setup -q -n %{name}-%{fversion}
%patch10 -p1
%patch11 -p1
%patch12 -p1
# %patch13 -p1

unzip -aa -o %{SOURCE20} -d $RPM_BUILD_DIR/%{name}-%{version} hiscore.dat
unzip -aa -o %{SOURCE21} -d $RPM_BUILD_DIR/%{name}-%{version}
unzip -aa -o %{SOURCE22} -d $RPM_BUILD_DIR/%{name}-%{version} mameinfo.dat
unzip -aa -o %{SOURCE23} -d $RPM_BUILD_DIR/%{name}-%{version} history.dat


%build
# all default settings have been positioned through the Makefile.unix patch 

# options from xmame not provided by our RPM variables
# -funroll-loops -fstrength-reduce  -fomit-frame-pointer -ffast-math
# -malign-functions=2 -malign-jumps=2 -malign-loops=2 -s -fno-exceptions
# -fstrict-aliasing


# x11 target with 68k asm support
%if %buildx11
make -f makefile.unix PREFIX=%{_prefix} TARGET=mame \
	OPTIMIZE_FLAGS="$RPM_OPT_FLAGS -fstrict-aliasing" \
	X86_ASM_68000=1 \
	X11_DGA=1 \
	XMAMEROOT=%{_sysconfdir}/xmame \
	DISPLAY_METHOD=x11
mv xmame.x11 xmame.x11-68k
%endif

# SDL target with 68k asm support
%if %buildSDL
make -f makefile.unix PREFIX=%{_prefix} TARGET=mame \
	OPTIMIZE_FLAGS="$RPM_OPT_FLAGS -fstrict-aliasing" \
	X86_ASM_68000=1 \
	DISPLAY_METHOD=SDL
mv xmame.SDL xmame.SDL-68k
%endif

# svgalib target with 68k asm support
%if %buildsvgalib
make -f makefile.unix PREFIX=%{_prefix} TARGET=mame \
	OPTIMIZE_FLAGS="$RPM_OPT_FLAGS -fstrict-aliasing" \
	X86_ASM_68000=1 \
	DISPLAY_METHOD=svgalib
mv xmame.svgalib xmame.svgalib-68k
%endif

# OpenGL target with 68k asm support
%if %buildxgl
make -f makefile.unix PREFIX=%{_prefix} TARGET=mame \
	OPTIMIZE_FLAGS="$RPM_OPT_FLAGS -fstrict-aliasing" \
	X86_ASM_68000=1 \
	DISPLAY_METHOD=xgl
mv xmame.xgl xmame.xgl-68k
%endif

# Glide/X11 target with 68k asm support
%if %buildxfx
make -f makefile.unix PREFIX=%{_prefix} TARGET=mame \
	OPTIMIZE_FLAGS="$RPM_OPT_FLAGS -fstrict-aliasing" \
	X86_ASM_68000=1 \
	DISPLAY_METHOD=xfx
mv xmame.xfx xmame.xfx-68k
%endif

# Glide/svgalib target with 68k asm support
%if %buildsvgafx
make -f makefile.unix PREFIX=%{_prefix} TARGET=mame \
	OPTIMIZE_FLAGS="$RPM_OPT_FLAGS -fstrict-aliasing" \
	X86_ASM_68000=1 \
	DISPLAY_METHOD=svgafx
mv xmame.svgafx xmame.svgafx-68k
%endif

# won't recompile without the 68k asm core if not clean
make -f makefile.unix PREFIX=%{_prefix} TARGET=mame clean68k

	
# x11 target without 68k asm support
%if %buildx11
make -f makefile.unix PREFIX=%{_prefix} TARGET=mame \
	OPTIMIZE_FLAGS="$RPM_OPT_FLAGS -fstrict-aliasing" \
	X11_DGA=1 \
	DISPLAY_METHOD=x11
%endif

# SDL target without 68k asm support
%if %buildSDL
make -f makefile.unix PREFIX=%{_prefix} TARGET=mame \
	OPTIMIZE_FLAGS="$RPM_OPT_FLAGS -fstrict-aliasing" \
	DISPLAY_METHOD=SDL
%endif

# svgalib target without 68k asm support
%if %buildsvgalib
make -f makefile.unix PREFIX=%{_prefix} TARGET=mame \
	OPTIMIZE_FLAGS="$RPM_OPT_FLAGS -fstrict-aliasing" \
	DISPLAY_METHOD=svgalib
%endif

# OpenGL target without 68k asm support
%if %buildxgl
make -f makefile.unix PREFIX=%{_prefix} TARGET=mame \
	OPTIMIZE_FLAGS="$RPM_OPT_FLAGS -fstrict-aliasing" \
	DISPLAY_METHOD=xgl
%endif

# Glide/X11 target without 68k asm support
%if %buildxfx
make -f makefile.unix PREFIX=%{_prefix} TARGET=mame \
	OPTIMIZE_FLAGS="$RPM_OPT_FLAGS -fstrict-aliasing" \
	DISPLAY_METHOD=xfx
%endif

# Glide/svgalib target without 68k asm support
%if %buildsvgafx
make -f makefile.unix PREFIX=%{_prefix} TARGET=mame \
	OPTIMIZE_FLAGS="$RPM_OPT_FLAGS -fstrict-aliasing" \
	DISPLAY_METHOD=svgafx
%endif

%install
rm -rf %buildroot
mkdir -p %buildroot%{_libdir}/games/%{name}/{roms,cab,samples,artwork} \
	%buildroot%{_mandir}/man6 \
	%buildroot%{_bindir} \
	%buildroot%{_sysconfdir}/%{name}/rc \
	%buildroot%{_iconsdir} \
	%buildroot%{_liconsdir} \
	%buildroot%{_miconsdir} \
	%buildroot%{_menudir} \
	%buildroot/usr/X11R6/bin

#installing the free roms
cp %{SOURCE10} %buildroot%{_libdir}/games/%{name}/roms
cp %{SOURCE11} %buildroot%{_libdir}/games/%{name}/roms
cp %{SOURCE12} %buildroot%{_libdir}/games/%{name}/roms

# the man page
install -m 644 doc/xmame.6 %buildroot%{_mandir}/man6/

# the binaries
%if %buildSDL
install -m  755 xmame.{SDL,SDL-68k} %buildroot/usr/X11R6/bin/
%endif

%if %buildxfx
install -m  755 xmame.{xfx,xfx-68k} %buildroot/usr/X11R6/bin/
%endif

%if %buildxgl
install -m  755 xmame.{xgl,xgl-68k} %buildroot/usr/X11R6/bin/
%endif

%if %buildx11
install -m 4755 xmame.{x11,x11-68k} %buildroot/usr/X11R6/bin/
%endif

%if %buildsvgalib
install -m 4755 xmame.svgalib{-68k,} %buildroot%{_bindir}
%endif

%if %buildsvgafx
install -m 4755 xmame.svgafx{-68k,} %buildroot%{_bindir}
%endif

# xmame-screensaver from contrib/tools
install -m 755 contrib/tools/xmame-screensaver %buildroot/usr/X11R6/bin/

# the cab files
make -f makefile.unix XMAMEROOT=%buildroot%{_libdir}/games/%{name} copycab

install -m 644 ./doc/xmamerc.dist %buildroot%{_libdir}/games/%{name}/xmame-x11rc
install -m 644 ./cheat.dat %buildroot%{_libdir}/games/%{name}/cheat.dat
install -m 644 ./history.dat %buildroot%{_libdir}/games/%{name}/history.dat
# install -m 644 ./driverinfo.dat %buildroot%{_libdir}/games/%{name}/driverinfo.dat
install -m 644 ./mameinfo.dat %buildroot%{_libdir}/games/%{name}/mameinfo.dat
install -m 644 ./hiscore.dat  %buildroot%{_libdir}/games/%{name}/hiscore.dat
install contrib/frontends/mamex.new %buildroot%{_bindir}/mamex

# icons
install -m 644 %SOURCE1 %buildroot%_miconsdir/%name.png
install -m 644 %SOURCE2 %buildroot%_iconsdir/%name.png
install -m 644 %SOURCE3 %buildroot%_liconsdir/%name.png

# rc files
tar xvjf %{SOURCE4} -C %buildroot%{_sysconfdir}/%{name}
touch %buildroot%{_sysconfdir}/%{name}/xmame-xfxrc
touch %buildroot%{_sysconfdir}/%{name}/xmame-svgafxrc

# x11 target
%if %buildx11
cat << EOF > %buildroot%{_menudir}/%{name}-x11
?package(%{name}-x11):command="/usr/X11R6/bin/%{name}.x11" icon="%{name}.png"\\
	needs="X11" section="Amusement/Arcade" title="Xmame (X11)"\\
	longtitle="Arcade emulator"
EOF
%endif

# svgalib target

# no menu entry for a command line ...


# xgl target
%if %buildxgl
install -m 755 -d %buildroot%{_menudir}
cat << EOF > %buildroot%{_menudir}/%{name}-xgl
?package(%{name}-xgl):command="/usr/X11R6/bin/%{name}.xgl" icon="%{name}.png"\\
	needs="X11" section="Amusement/Arcade" title="Xmame (OpenGL)"\\
	longtitle="Arcade emulator"
EOF
ln -sf %{_libdir}/games/%{name}/cab %buildroot%{_sysconfdir}/%{name}/cab
%endif

# SDL target
%if %buildSDL
cat << EOF > %buildroot%{_menudir}/%{name}-SDL
?package(%{name}-SDL):command="/usr/X11R6/bin/%{name}.SDL" icon="%{name}.png"\\
	needs="X11" section="Amusement/Arcade" title="Xmame (SDL)"\\
	longtitle="Arcade emulator"
EOF
%endif

# Glide/x11 target
%if %buildxfx
install -m 755 -d %buildroot%{_menudir}
cat << EOF > %buildroot%{_menudir}/%{name}-xfx
?package(%{name}-xfx):command="/usr/X11R6/bin/%{name}.xfx" icon="%{name}.png"\\
	needs="X11" section="Amusement/Arcade" title="Xmame (Glide)"\\
	longtitle="Arcade emulator"
EOF
%endif

# Glide/svgalib target
# no menu entry for a command line ...

export DONT_STRIP=1

# base
#
%files -n %{name}-base
%defattr(-,root,root)
%doc doc/*
%dir               %{_sysconfdir}/%{name}
%dir               %{_sysconfdir}/%{name}/rc
%config(noreplace) %{_sysconfdir}/%{name}/rc/*
%attr(755,root,games) %{_bindir}/mamex
%dir %{_libdir}/games/%{name}
%dir %{_libdir}/games/%{name}/roms
%dir %{_libdir}/games/%{name}/samples
%dir %{_libdir}/games/%{name}/artwork
%attr(644,root,games) %{_libdir}/games/%{name}/roms/*
%{_libdir}/games/%{name}/cheat.dat
%{_libdir}/games/%{name}/history.dat
%{_libdir}/games/%{name}/hiscore.dat
%{_libdir}/games/%{name}/mameinfo.dat
%attr(644,root,man) %{_mandir}/man6/*


# x11 target
#
%if %buildx11
%post -n %{name}-x11
%{update_menus}
update-alternatives --install %{_bindir}/%{name} %{name} /usr/X11R6/bin/%{name}.x11-68k 9
update-alternatives --install %{_bindir}/%{name} %{name} /usr/X11R6/bin/%{name}.x11     10
# without the following, the group stays in default manual mode,
#  and no link is created
[ -e %{_bindir}/%{name} ] || update-alternatives --auto %{name}

%postun -n %{name}-x11
%{clean_menus} 
if [ "$1" = 0 ]; then
  # Remove update-alternatives entries
  update-alternatives --remove %{name} /usr/X11R6/bin/%{name}.x11-68k
  update-alternatives --remove %{name} /usr/X11R6/bin/%{name}.x11
  update-alternatives --auto %{name}
fi

%files -n %{name}-x11
%defattr(-,root,root)
%doc doc/readme.mame
%dir               %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/xmame-x11rc
%attr(-,root,games) /usr/X11R6/bin/xmame.x11
%attr(-,root,games) /usr/X11R6/bin/xmame.x11-68k
# %attr(-,root,games) /usr/X11R6/bin/xmame-screensaver
%attr(644,root,root) %{_liconsdir}/%{name}.png
%attr(644,root,root) %{_miconsdir}/%{name}.png
%attr(644,root,root) %{_iconsdir}/%{name}.png
%attr(644,root,root) %{_menudir}/%{name}-x11
%endif

# svgalib target
#
%if %buildsvgalib
%post -n %{name}-svgalib
update-alternatives --install %{_bindir}/%{name} %{name} %{_prefix}/bin/%{name}.svgalib-68k 9
update-alternatives --install %{_bindir}/%{name} %{name} %{_prefix}/bin/%{name}.svgalib     10
# without the following, the group stays in default manual mode,
#  and no link is created
[ -e %{_bindir}/%{name} ] || update-alternatives --auto %{name}

%postun -n %{name}-svgalib
if [ "$1" = 0 ]; then
  # Remove update-alternatives entries
  update-alternatives --remove %{name} %{_prefix}/bin/%{name}.svgalib-68k
  update-alternatives --remove %{name} %{_prefix}/bin/%{name}.svgalib
  update-alternatives --auto %{name}
fi

%files -n %{name}-svgalib
%defattr(-,root,root)
%doc doc/readme.mame
%dir               %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/xmame-svgalibrc
%attr(-,root,games) %{_bindir}/xmame.svgalib
%attr(-,root,games) %{_bindir}/xmame.svgalib-68k
%endif

# OpenGL target
#
%if %buildxgl
%post -n %{name}-xgl
%{update_menus}
update-alternatives --install %{_bindir}/%{name} %{name} /usr/X11R6/bin/%{name}.xgl-68k 9
update-alternatives --install %{_bindir}/%{name} %{name} /usr/X11R6/bin/%{name}.xgl     10
# without the following, the group stays in default manual mode,
#  and no link is created
[ -e %{_bindir}/%{name} ] || update-alternatives --auto %{name}

%postun -n %{name}-xgl
%{clean_menus} 
if [ "$1" = 0 ]; then
  # Remove update-alternatives entries
  update-alternatives --remove %{name} /usr/X11R6/bin/%{name}.xgl
  update-alternatives --remove %{name} /usr/X11R6/bin/%{name}.xgl-68k
  update-alternatives --auto %{name}
fi

%files -n %{name}-xgl
%defattr(-,root,root)
%doc doc/readme.mame
%dir               %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/xmame-xglrc
%attr(-,root,games) /usr/X11R6/bin/%{name}.xgl
%attr(-,root,games) /usr/X11R6/bin/%{name}.xgl-68k
%dir %{_libdir}/games/%{name}/cab
%{_libdir}/games/%{name}/cab/*
%{_sysconfdir}/%{name}/cab
%attr(644,root,root) %{_liconsdir}/%{name}.png
%attr(644,root,root) %{_miconsdir}/%{name}.png
%attr(644,root,root) %{_iconsdir}/%{name}.png
%attr(644,root,root) %{_menudir}/%{name}-xgl
%endif

# SDL target
#
%if %buildSDL
%post -n %{name}-SDL
%{update_menus}
update-alternatives --install %{_bindir}/%{name} %{name} /usr/X11R6/bin/%{name}.SDL-68k 9
update-alternatives --install %{_bindir}/%{name} %{name} /usr/X11R6/bin/%{name}.SDL     10
# without the following, the group stays in default manual mode,
#  and no link is created
[ -e %{_bindir}/%{name} ] || update-alternatives --auto %{name}

%postun -n %{name}-SDL
%{clean_menus} 
if [ "$1" = 0 ]; then
  # Remove update-alternatives entries
  update-alternatives --remove %{name} /usr/X11R6/bin/%{name}.SDL-68k
  update-alternatives --remove %{name} /usr/X11R6/bin/%{name}.SDL
  update-alternatives --auto %{name}
fi

%files -n %{name}-SDL
%defattr(-,root,root)
%doc doc/readme.mame
%dir               %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/xmame-SDLrc
%attr(-,root,games) /usr/X11R6/bin/xmame.SDL
%attr(-,root,games) /usr/X11R6/bin/xmame.SDL-68k
%attr(644,root,root) %{_liconsdir}/%{name}.png
%attr(644,root,root) %{_miconsdir}/%{name}.png
%attr(644,root,root) %{_iconsdir}/%{name}.png
%attr(644,root,root) %{_menudir}/%{name}-SDL
%endif

# Glide/X11 target
#
%if %buildxfx
%post -n %{name}-xfx
%{update_menus}
update-alternatives --install %{_bindir}/%{name} %{name} /usr/X11R6/bin/%{name}.xfx-68k 9
update-alternatives --install %{_bindir}/%{name} %{name} /usr/X11R6/bin/%{name}.xfx     10
# without the following, the group stays in default manual mode,
#  and no link is created
[ -e %{_bindir}/%{name} ] || update-alternatives --auto %{name}

%postun -n %{name}-xfx
%{clean_menus} 
if [ "$1" = 0 ]; then
  # Remove update-alternatives entries
  update-alternatives --remove %{name} /usr/X11R6/bin/%{name}.xfx-68k
  update-alternatives --remove %{name} /usr/X11R6/bin/%{name}.xfx
  update-alternatives --auto %{name}
fi

%files -n %{name}-xfx
%defattr(-,root,root)
%doc doc/readme.mame
%dir               %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/xmame-xfxrc
%attr(-,root,games) /usr/X11R6/bin/xmame.xfx
%attr(-,root,games) /usr/X11R6/bin/xmame.xfx-68k
%attr(644,root,root) %{_liconsdir}/%{name}.png
%attr(644,root,root) %{_miconsdir}/%{name}.png
%attr(644,root,root) %{_iconsdir}/%{name}.png
%attr(644,root,root) %{_menudir}/%{name}-xfx
%endif


# Glide/svgalib target
#
%if %buildsvgafx
%post -n %{name}-svgafx
update-alternatives --install %{_bindir}/%{name} %{name} %{_prefix}/bin/%{name}.svgafx-68k 9
update-alternatives --install %{_bindir}/%{name} %{name} %{_prefix}/bin/%{name}.svgafx     10
# without the following, the group stays in default manual mode,
#  and no link is created
[ -e %{_bindir}/%{name} ] || update-alternatives --auto %{name}

%postun -n %{name}-svgafx
if [ "$1" = 0 ]; then
  # Remove update-alternatives entries
  update-alternatives --remove %{name} %{_bindir}/%{name}.svgafx-68k
  update-alternatives --remove %{name} %{_bindir}/%{name}.svgafx
  update-alternatives --auto %{name}
fi

%files -n %{name}-svgafx
%defattr(-,root,root)
%doc doc/readme.mame
%dir               %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/xmame-svgafxrc
%attr(-,root,games) %{_bindir}/xmame.svgafx
%attr(-,root,games) %{_bindir}/xmame.svgafx-68k
%endif


%clean
rm -rf %buildroot 


%changelog
* Tue Feb 12 2002 HA Quôc-Viêt <viet@mandrakesoft.com> 0.58.2-1mdk
- new source update.
- MameInfo 3.82.
- I haven't compiled the new xgl, because of troubles with vector games.
- switch from the old history.dat to fandemame's and updated URL.
- MAME_NET enabled by default in makefile.unix.
- XMAMEROOT set by default in makefile.unix (still dependent on TARGET though).
- xpm icons converted to png.
- the SDL target needs some additional dependencies.

* Sat Feb 02 2002 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.57.1-4mdk
- enabled SDL & x11 modules.

* Wed Jan 16 2002 Lenny Cartier <lenny@mandrakesoft.com> 0.57.1-3mdk
- new upload

* Wed Jan 09 2002 HA Quôc-Viêt <viet@mandrakesoft.com> 0.57.1-2mdk
- patch to xgl from Sven Goethel for voodoo boards.

* Mon Jan 07 2002 HA Quôc-Viêt <viet@mandrakesoft.com> 0.57.1-1mdk
- new source update.
- MameInfo 3.71.
- switch from official hiscores (Apr 2001) to unofficial (Dec 2001).
- switch to a new (?) source for the cheat.zip file.

* Thu Jan 03 2002 HA Quôc-Viêt <viet@mandrakesoft.com> 0.56.2-1mdk
- new source update.
- MameInfo 3.70.

* Tue Nov 27 2001 HA Quôc-Viêt <viet@mandrakesoft.com> 0.56.1-2mdk
- strip now breaks upx encoded binaries ... oh well. workaround applied.

* Tue Nov 27 2001 HA Quôc-Viêt <viet@mandrakesoft.com> 0.56.1-1mdk
- MameInfo 3.64.
- new source update.
- minor modification to the patch (Makefile.unix) to make it apply cleanly.
- has GLmame v0.91 (patch 22).

* Fri Oct 5 2001 HA Quôc-Viêt <viet@mandrakesoft.com> 0.55.2-1mdk
- MameInfo 3.54.
- new source update.
- the glide patch for svgafx and xfx is not yet working. Disable it
  to compile the glide targets first.

* Mon Oct 1 2001 HA Quôc-Viêt <viet@mandrakesoft.com> 0.55.1-3mdk
- MameInfo 3.53.
- new cheat.dat (updated on September 14th).
- removed update-menus and clean-menus for svgalib menuless target.

* Fri Sep 21 2001 HA Quôc-Viêt <viet@mandrakesoft.com> 0.55.1-2mdk
- MameInfo 3.51.
- DGA support added to x11 targets.
- Decreased update-alternative priority of 68k asm core.
- removed xmame-screensaver until fixed.
- Viele danke Goetz Waschk.
- rc files updated (volume decreased to -3, SDL is no longer doubled size).

* Wed Sep 19 2001 HA Quôc-Viêt <viet@mandrakesoft.com> 0.55.1-1mdk
- new source update.
- MameInfo 3.50.
- romcheck was removed from the source, so I removed it too.
- removed rc/ddonpach and rc/donpachi since their visual has been fixed.

* Mon Sep 10 2001 HA Quôc-Viêt <viet@mandrakesoft.com> 0.54.2-1mdk
- new source update.
- MameInfo 3.42.
- rc files updates (samples dir, artwork dir, spool and screenshot dir).
- added romcheck and xmame-screensaver from contrib/tools.
- wrong test in %postun removed.

* Tue Aug 28 2001 HA Quôc-Viêt <viet@mandrakesoft.com> 0.54.1-1mdk
- new source update.
- MameInfo 3.41.
- using "unzip -aa" to avoid a later "perl -pi -e"

* Sat Aug 25 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.53.1-2mdk
- Glide_V3 in BuildRequires for xfx.

* Thu Aug 23 2001 HA Quôc-Viêt <viet@mandrakesoft.com> 0.53.1-1mdk
- new source update.
- MameInfo 3.32.

* Sat Aug 11 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.37b16.1-3mdk
- added link to %{_sysconfdir}/xmame/cab for xgl target.

* Sat Aug 11 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.37b16.1-2mdk
- cleaned spec file.
- added conditional compilation %build* flags.
- scanlines 1 in SDLrc file.
- removed X86_ASM_68000=0 otherwise both 68k and non-68k executables
  are the same.
- added Mesa-common-devel in BuildRequires (glu.h).

* Fri Aug 10 2001 HA Quôc-Viêt <viet@mandrakesoft.com> 0.37b16.1-1mdk
- removed glide/X11 and glide/svgalib targets because they do not work
- source update
- cps2 patch update

* Thu Jun 28 2001 HA Quôc-Viêt <viet@mandrakesoft.com> 0.37b15.1-3mdk
- added glide/X11     target (xfx)
- added glide/svgalib target (svgafx)
- cps2 updated to revision 20010627
- not released because the glide targets do not work properly

* Mon Jun 25 2001 HA Quôc-Viêt <viet@mandrakesoft.com> 0.37b15.1-2mdk
- added the Stijn Hoop's cps2mame patch, with Sarayan' blessing (Dan Beimborn)
- mameinfo.dat version 3.15.
- xmame-SDLrc is ok now
- binaries are compressed with upx to save space on the hard drive
- FIX cab files are now in the xgl target
- BUG the latest package installed does not automatically become the prefered
  alternative
- BUG the xgl target does not work on all cards, it depends upon the glx support
- TODO svga, xgl, x11 and xmame rc files are not final yet
- TODO one day, I might move x11 specific binaries to /usr/X11R6/bin

* Wed Jun 06 2001 HA Quôc-Viêt <viet@mandrakesoft.com> 0.37b15.1-1mdk
- updated to version 0.37b15.1.
- mameinfo.dat version 3.13.
- cosmetic mods to the spec (menu section).
- transparent icons added for menus.
- configuration files moved to /etc/xmame/* per request from rpmlint
- multi-binary rpm splitted into multiple single-binary rpms :o)
- added opengl and svgalib binaries.
- 68k asm has been moved to a separate binary because some games do not work
  well with it (rayforce).
- setuid root the binaries for DGA and svgalib binaries
- two FREE roms added as default games
- added the mame hiscore.dat revision 7
- BUG the latest package installed does not automatically become the prefered
  alternative
- BUG the xgl target does not work, I am still struggling to know why
- TODO rc files are not final yet
- TODO one day, I might create a separate xmame-base to gather the doc,
  hiscore, etc
- TODO one day, I might move x11 specific binaries to /usr/X11R6/bin

* Mon May 07 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.37b13.2-1mdk
- updated to version 0.37b13.2.

* Sat Mar 31 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.37b12.1-1mdk
- updated to version 0.37b12.1.
- removed patch14.

* Fri Mar 30 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.37b11.2-4mdk
- rebuild because .src.rpm were discarded.

* Mon Mar 12 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.37b11.2-3mdk
- rebuild with latest gcc-2.96-0.41mdk.

- added patch for rollrace support (imported from 0.37b12[dos]).
* Sat Feb 24 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.37b11.2-2mdk
- added patch for rollrace support (imported from 0.37b12[dos]).

* Fri Feb 23 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.37b11.2-1mdk
- updated to version 0.37b11.2.
- cleaned spec file.
- mameinfo.dat version 2.81.

* Wed Sep 20 2000 Lenny Cartier <lenny@mandrakesoft.com> 0.37b4.1-3mdk
- more macros.
- menu.

* Wed Aug 30 2000 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.37b4.1-2mdk
- use of %%{_mandir}.
- updated cheat file.

* Tue Aug 29 2000 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.37b4.1-1mdk
- updated to new release.
- removed SDL, svgalib version.
- removed xmess.

* Wed May 17 2000 Pixel <pixel@mandrakesoft.com> 0.36.1-3mdk
- add exclusivearch x86.

* Wed May 04 2000 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.36.1-2mdk
- updated URL.
- added history.dat
- removed esound support (does not worked)
- fixed optimization flags causing seg faults.
- removed bzip2 man pages (now handled by spec_helper).

* Wed Apr 19 2000 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.36.1-1mdk
- fixed group
- updated version
- added new cheat.dat

* Thu Mar 16 2000 Giuseppe Ghibò <ghibo@mandrakesoft.com>
  [0.36rc1.1-1mdk]
- updated to newer version.
- added SDL binaries.

* Fri Feb 18 2000 Giuseppe Ghibò <ghibo@mandrakesoft.com>
  [0.36b15.2-3mdk]
- fixed %doc dir in spec file.

* Mon Feb 07 2000 Giuseppe Ghibò <ghibo@linux-mandrake.com>
  [0.36b15.2-2mdk]
- added xmess.

* Fri Feb 04 2000 Giuseppe Ghibò <ghibo@linux-mandrake.com>
  [0.36b15.2-1mdk]
- updated to new version.
- cleaned the SPEC file.

* Sat Jul 24 1999 Giuseppe Ghibò <ghibo@linux-mandrake.com>
  [0.35.3-1mdk]
- mandrake adaptions
- removed suid.
- added and fixed mamex script from contrib.

* Mon May 24 1999 Arne Coucheron <arneco@online.no>
  [0.35b12.1-1]
- added history.dat to %doc section
- network support currently broken, so xmame is compiled without it

* Wed Feb 03 1999 Arne Coucheron <arneco@online.no>
  [0.35b2.1-1]
- removed changes in xmamerc regarding joystick support, fixed in sources

* Tue Jan 12 1999 Arne Coucheron <arneco@online.no>
  [0.35b1.1-1]

* Sat Jan 09 1999 Arne Coucheron <arneco@online.no>
  [0.34.2-1]
- changed xmamerc regarding joystick support

* Tue Jan 05 1999 Arne Coucheron <arneco@online.no>
  [0.34.1-1]
- those getting the : undefined symbol: __deregister_frame_info
  error message when running xmame, need to either rebuild it from the src.rpm
  or upgrade to the XFree86 v3.3.3 rpm package provided by Red Hat

* Sun Dec 20 1998 Arne Coucheron <arneco@online.no>
  [0.34rc1.1-1]

* Sat Dec 12 1998 Arne Coucheron <arneco@online.no>
  [0.34b8.1-1]
- the DGA and X11 version are now built into the same binary
- changed Source and URL tag

* Sun Nov 15 1998 Arne Coucheron <arneco@online.no>
  [0.34b7.1-1]
- no changes in spec file

* Tue Nov 10 1998 Arne Coucheron <arneco@online.no>
  [0.34b6.1-1]
- added URL: tag
- added compiling of multiplayer support for all display targets

* Thu Oct 22 1998 Arne Coucheron <arneco@online.no>
  [0.34b5.2-1]
- compiling with multiplayer support
- compiling and installing the OpenGL version
- installing CHEAT.DAT
- using assembler 68k engine during compile

* Mon Oct 19 1998 Arne Coucheron <arneco@online.no>
  [0.34b3.1-1]
- using %%{name} and %%{version} macros
- using %defattr
- using OPTFLAGS="$RPM_OPT_FLAGS" for optimization
- added -q parameter to %setup
- dropped i386.makefile patch, implemented it in spec file instead
- to comply better with Red Hat standard, moved rom directory to
  /usr/lib/games/xmame and highscore directory to /var/lib/games/xmame
- various cleanups in spec file

* Mon Aug 24 1998 Jeff Breidenbach <jeff@jab.org>
- RPM builds on linux for alpha,powerpc,i386 (only i386 tested)
- added xmame.svga, xmame.xf86_dga when appropriate
- redid patches to reflect new changes in makefile

* Sun Aug 23 1998 Jeff Breidenbach <jeff@jab.org>
- enabled i386 assembly code when appropriate

* Sat Aug 1 1998 Jeff Breidenbach <jeff@jab.org>
- separated i386 portion of makefile patch into separate file
  so that it might be reasonable to build this rpm on
  a non-i386 linux box. (untested)
- minor tweaks to spec file and i386 patch.
- updated version of xmame.

* Wed Jun 10 1998 Jeremy Hansen <jeremy@xxedgexx.com>
- Made changes to the spec file mainly in the document
  structure.
- Made changes to the xmamerc patch.  Enabled sound if
  available.

* Tue Jun 9 1998 Jeremy Hansen <jeremy@xxedgexx.com>
- Made some rpm fixes.
- Fixed xmamerc.

* Mon Jun 8 1998 Jeremy Hansen <jeremy@xxedgexx.com>
- built and tested package.
- Relocated xmamerc, high scores, and roms directory into
  /usr/lib/xmame.  All roms rpm I make will install into
  /usr/lib/xmame/roms.