# ldplayer can be disabled by --without ldplayer or by changing to %bcond_with # if it does not build. The debug build is disabled by default, please use # --with debug to override %bcond_without ldplayer %bcond_with debug %bcond_with simd %global baseversion 153 #global sourceupdate 1 #global svn 21418 %if 0%{?svn} %global svnrelease .%{svn}svn %endif # work around low memory on the RPM Fusion builder %bcond_without lowmem %if %{with lowmem} %global _find_debuginfo_dwz_opts %{nil} %endif Name: mame %if 0%{?sourceupdate} Version: 0.%{baseversion}u%{sourceupdate} %else Version: 0.%{baseversion} %endif Release: %mkrel 1 Summary: Multiple Arcade Machine Emulator Group: Emulators License: MAME License and BSD URL: http://mamedev.org/ %if 0%{?svn} Source0: %{name}-svn%{svn}.tar.xz %else Source0: http://mamedev.org/downloader.php?file=releases/%{name}0%{baseversion}s.exe #Source100: whatsnew.zip %if 0%{?sourceupdate} #Source updates #Source1: http://mamedev.org/updates/0%{baseversion}u1_diff.zip #Source2: http://mamedev.org/updates/0%{baseversion}u2_diff.zip #Source3: http://mamedev.org/updates/0%{baseversion}u3_diff.zip #Source4: http://mamedev.org/updates/0%{baseversion}u4_diff.zip #Source5: http://mamedev.org/updates/0%{baseversion}u5_diff.zip #Source6: http://mamedev.org/updates/0%{baseversion}u6_diff.zip #Source7: http://mamedev.org/updates/0%{baseversion}u7_diff.zip #Source8: http://mamedev.org/updates/0%{baseversion}u8_diff.zip #Source9: http://mamedev.org/updates/0%{baseversion}u9_diff.zip %endif %endif Patch0: %{name}-fortify.patch Patch2: %{name}-verbosebuild.patch BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(flac) BuildRequires: jpeg-devel %if !0%{?svn} BuildRequires: p7zip %endif BuildRequires: portmidi-devel BuildRequires: python BuildRequires: qt4-devel BuildRequires: SDL_ttf-devel BuildRequires: zlib-devel Requires: %{name}-data = %{version}-%{release} Provides: bundled(lzma-sdk) = 9.22 %description MAME stands for Multiple Arcade Machine Emulator. When used in conjunction with an arcade game's data files (ROMs), MAME will more or less faithfully reproduce that game on a PC. The ROM images that MAME utilizes are "dumped" from arcade games' original circuit-board ROM chips. MAME becomes the "hardware" for the games, taking the place of their original CPUs and support chips. Therefore, these games are NOT simulations, but the actual, original games that appeared in arcades. MAME's purpose is to preserve these decades of video-game history. As gaming technology continues to rush forward, MAME prevents these important "vintage" games from being lost and forgotten. This is achieved by documenting the hardware and how it functions, thanks to the talent of programmers from the MAME team and from other contributors. Being able to play the games is just a nice side-effect, which doesn't happen all the time. MAME strives for emulating the games faithfully. %package tools Summary: Additional tools for MAME Requires: %{name} = %{version}-%{release} %description tools %{summary}. %if %{with ldplayer} %package ldplayer Summary: Standalone laserdisc player based on MAME %description ldplayer %{summary}. %endif %package -n mess Summary: Multi Emulator Super System Requires: mess-data = %{version}-%{release} %if 0%{?fedora} < 18 Provides: bundled(libjpeg) = 8c %endif Provides: bundled(lzma-sdk) = 9.22 %description -n mess MESS is an acronym that stands for Multi Emulator Super System. MESS will more or less faithfully reproduce computer and console systems on a PC. MESS emulates the hardware of the systems and sometimes utilizes ROM images to load programs and games. Therefore, these systems are NOT simulations, but the actual emulations of the hardware. %package -n mess-tools Summary: Additional tools for MESS Requires: mess = %{version}-%{release} %description -n mess-tools %{summary}. %package data Summary: Data files used by both MAME and MESS Provides: mess-data = %{version}-%{release} BuildArch: noarch %description data %{summary}. %package data-software-lists Summary: Software lists used by both MAME and MESS Requires: %{name}-data = %{version}-%{release} Provides: mess-data-software-lists = %{version}-%{release} Obsoletes: mess-data < 0.146-2 BuildArch: noarch %description data-software-lists %{summary}. These are split from the main -data subpackage due to relatively large size. %prep %if 0%{?svn} %setup -qn %{name}-export %else %setup -qcT for sourcefile in %{sources}; do 7za x $sourcefile done find . -type f -not -name *.png -exec sed -i 's/\r//' {} \; %if 0%{?sourceupdate} i=1 while [ $i -le %{sourceupdate} ]; do patch -p0 -E < 0%{baseversion}u${i}.diff i=`expr $i + 1` done %endif %endif %patch0 -p1 -b .fortify %patch2 -p1 -b .verbosebuild # Fix encoding for whatsnew in whatsnew.txt messnew.txt; do iconv -f iso8859-1 -t utf-8 $whatsnew > $whatsnew.conv mv -f $whatsnew.conv $whatsnew done # Create ini files cat > %{name}.ini << EOF # Define multi-user paths artpath %{_datadir}/%{name}/artwork;%{_datadir}/%{name}/effects cheatpath %{_datadir}/%{name}/cheat ctrlrpath %{_datadir}/%{name}/ctrlr fontpath %{_datadir}/%{name}/fonts hashpath %{_datadir}/%{name}/hash rompath %{_datadir}/%{name}/roms;%{_datadir}/%{name}/chds samplepath %{_datadir}/%{name}/samples # Allow user to override ini settings inipath \$HOME/.%{name}/ini;%{_sysconfdir}/%{name} # Set paths for local storage cfg_directory \$HOME/.%{name}/cfg comment_directory \$HOME/.%{name}/comments diff_directory \$HOME/.%{name}/diff input_directory \$HOME/.%{name}/inp memcard_directory \$HOME/.%{name}/memcard nvram_directory \$HOME/.%{name}/nvram snapshot_directory \$HOME/.%{name}/snap state_directory \$HOME/.%{name}/sta # Fedora custom defaults video opengl autosave 1 EOF #make a copy for MESS sed 's/%{name}/mess/g' %{name}.ini > mess.ini %if %{with simd} sed -i 's/USE_SIMD (0)/USE_SIMD (1)/' src/emu/cpu/rsp/rsp.h %endif %build %setup_compile_flags #these flags are already included in the Makefile RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -e 's/-O2 -g -pipe -Wall //') %if %{with simd} RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -e 's/-mtune=generic/-march=corei7-avx/') %endif #save some space MAME_FLAGS="NOWERROR=1 SYMBOLS=1 OPTIMIZE=2 BUILD_EXPAT=0 BUILD_ZLIB=0 \ BUILD_FLAC=0 BUILD_JPEGLIB=0 BUILD_MIDILIB=0 SUFFIX64=" #only use assembly on supported architectures %ifnarch %{ix86} x86_64 ppc ppc64 MAME_FLAGS="$MAME_FLAGS NOASM=1" %endif %if %{with ldplayer} %make $MAME_FLAGS TARGET=ldplayer \ OPT_FLAGS="$RPM_OPT_FLAGS -DINI_PATH='\"%{_sysconfdir}/%{name};\"'" %endif %if %{with debug} %make $MAME_FLAGS DEBUG=1 \ OPT_FLAGS="$RPM_OPT_FLAGS -DINI_PATH='\"%{_sysconfdir}/%{name};\"'" all find obj -type f -not -name \*.lh -and -not -name drivlist.c -exec rm {} \; %make $MAME_FLAGS DEBUG=1 TARGET=mess \ OPT_FLAGS="$RPM_OPT_FLAGS -DINI_PATH='\"%{_sysconfdir}/mess;\"'" all %else %make $MAME_FLAGS \ OPT_FLAGS="$RPM_OPT_FLAGS -DINI_PATH='\"%{_sysconfdir}/%{name};\"'" all find obj -type f -not -name \*.lh -and -not -name drivlist.c -exec rm {} \; %make $MAME_FLAGS TARGET=mess\ OPT_FLAGS="$RPM_OPT_FLAGS -DINI_PATH='\"%{_sysconfdir}/mess;\"'" all %endif %install rm -rf %{buildroot} # create directories install -d %{buildroot}%{_sysconfdir}/%{name} install -d %{buildroot}%{_sysconfdir}/mess for folder in cfg comments diff ini inp memcard nvram snap sta do install -d %{buildroot}%{_sysconfdir}/skel/.%{name}/$folder install -d %{buildroot}%{_sysconfdir}/skel/.mess/$folder done install -d %{buildroot}%{_bindir} for folder in artwork chds cheats ctrlr effects fonts hash hlsl keymaps roms \ samples shader do install -d %{buildroot}%{_datadir}/%{name}/$folder done for folder in artwork chds cheats ctrlr effects fonts hash hlsl keymaps roms \ samples shader software do install -d %{buildroot}%{_datadir}/mess/$folder done install -d %{buildroot}%{_mandir}/man1 install -d %{buildroot}%{_mandir}/man6 # install files install -pm 644 %{name}.ini %{buildroot}%{_sysconfdir}/%{name} install -pm 644 mess.ini %{buildroot}%{_sysconfdir}/mess %if %{with ldplayer} install -pm 755 ldplayer %{buildroot}%{_bindir} %endif %if %{with debug} install -pm 755 %{name}d %{buildroot}%{_bindir} install -pm 755 messd %{buildroot}%{_bindir} %else install -pm 755 %{name} %{buildroot}%{_bindir} install -pm 755 mess %{buildroot}%{_bindir} %endif install -pm 755 chdman jedutil ldresample ldverify romcmp testkeys unidasm \ castool floptool imgtool pngcmp nltool %{buildroot}%{_bindir} #for tool in regrep runtest split src2html srcclean for tool in regrep split src2html srcclean do install -pm 755 $tool %{buildroot}%{_bindir}/%{name}-$tool done install -pm 644 artwork/* %{buildroot}%{_datadir}/%{name}/artwork install -pm 644 hash/* %{buildroot}%{_datadir}/%{name}/hash install -pm 644 hlsl/* %{buildroot}%{_datadir}/%{name}/hlsl install -pm 644 keymaps/* %{buildroot}%{_datadir}/%{name}/keymaps pushd src/osd/sdl install -pm 644 shader/*.?sh %{buildroot}%{_datadir}/%{name}/shader for folder in artwork hash hlsl keymaps shader do pushd %{buildroot}%{_datadir}/%{name}/$folder for i in * do ln -s ../../%{name}/$folder/$i ../../mess/$folder/$i done popd done pushd man %if %{with ldplayer} install -pm 644 ldplayer.1 %{buildroot}%{_mandir}/man1 %endif install -pm 644 castool.1 chdman.1 imgtool.1 jedutil.1 ldresample.1 ldverify.1 \ romcmp.1 testkeys.1 %{buildroot}%{_mandir}/man1 install -pm 644 mame.6 mess.6 %{buildroot}%{_mandir}/man6 popd popd %files %doc docs/config.txt docs/hlsl.txt docs/license.txt docs/mame.txt %doc docs/newvideo.txt docs/nscsi.txt %if !0%{?svn} %doc whatsnew*.txt %endif %config(noreplace) %{_sysconfdir}/%{name}/%{name}.ini %dir %{_sysconfdir}/%{name} %{_sysconfdir}/skel/.%{name} %if %{with debug} %{_bindir}/%{name}d %else %{_bindir}/%{name} %endif %{_mandir}/man6/mame.6* %files tools %{_bindir}/chdman %{_bindir}/jedutil %{_bindir}/ldresample %{_bindir}/ldverify %{_bindir}/%{name}-regrep %{_bindir}/nltool %{_bindir}/pngcmp %{_bindir}/romcmp #%{_bindir}/%{name}-runtest %{_bindir}/%{name}-split %{_bindir}/%{name}-src2html %{_bindir}/%{name}-srcclean %{_bindir}/testkeys %{_bindir}/unidasm %{_mandir}/man1/chdman.1* %{_mandir}/man1/jedutil.1* %{_mandir}/man1/ldresample.1* %{_mandir}/man1/ldverify.1* %{_mandir}/man1/romcmp.1* %{_mandir}/man1/testkeys.1* %if %{with ldplayer} %files ldplayer %{_bindir}/ldplayer %{_mandir}/man1/ldplayer.1* %endif %files -n mess %if !0%{?svn} %doc messnew*.txt %endif %config(noreplace) %{_sysconfdir}/mess/mess.ini %dir %{_sysconfdir}/mess %{_sysconfdir}/skel/.mess %if %{with debug} %{_bindir}/messd %else %{_bindir}/mess %endif %{_mandir}/man6/mess.6* %files -n mess-tools %doc docs/imgtool.txt %{_bindir}/castool %{_bindir}/floptool %{_bindir}/imgtool %{_mandir}/man1/castool.1* %{_mandir}/man1/imgtool.1* %files data %{_datadir}/%{name} %exclude %{_datadir}/%{name}/hash/* %{_datadir}/mess %exclude %{_datadir}/mess/hash/* %files data-software-lists %{_datadir}/%{name}/hash/* %{_datadir}/mess/hash/*